{"id":15413589,"url":"https://github.com/kidkarolis/healthier","last_synced_at":"2025-08-20T03:32:06.183Z","repository":{"id":34038706,"uuid":"166482018","full_name":"KidkArolis/healthier","owner":"KidkArolis","description":"🧘‍♀️ Healthier is an opinionated style agnostic code linter – a friendly companion to Prettier","archived":false,"fork":false,"pushed_at":"2023-11-01T22:48:19.000Z","size":1401,"stargazers_count":84,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-09T18:13:14.526Z","etag":null,"topics":["development","ecmascript","eslint","javascript","linter","nodejs","prettier","standard","static-code-analysis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KidkArolis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-01-18T22:45:56.000Z","updated_at":"2024-06-05T09:52:20.000Z","dependencies_parsed_at":"2023-01-15T04:07:51.697Z","dependency_job_id":null,"html_url":"https://github.com/KidkArolis/healthier","commit_stats":{"total_commits":97,"total_committers":4,"mean_commits":24.25,"dds":0.05154639175257736,"last_synced_commit":"3df34581cf8da866c9dd1900bff3175a65cf61bf"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KidkArolis%2Fhealthier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KidkArolis%2Fhealthier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KidkArolis%2Fhealthier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KidkArolis%2Fhealthier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KidkArolis","download_url":"https://codeload.github.com/KidkArolis/healthier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230388131,"owners_count":18217755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development","ecmascript","eslint","javascript","linter","nodejs","prettier","standard","static-code-analysis"],"created_at":"2024-10-01T16:58:08.251Z","updated_at":"2025-08-20T03:32:06.171Z","avatar_url":"https://github.com/KidkArolis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ⚠️ Deprecated\n\nThis project is no longer actively maintained.\n\nIt is recommended to use [NeoStandard](https://github.com/neostandard/neostandard) instead. NeoStandard offers a modern approach to JavaScript linting, compatible with ESLint's flat config and built for today's ecosystem.\n\nTo migrate, you can follow these steps:\n\n```bash\n# 1. Uninstall healthier\nnpm uninstall healthier\n\n# 2. Install NeoStandard and ESLint\nnpm install -D neostandard eslint\n\n# 3. Generate an ESLint flat configuration file (eslint.config.js)\n#    Use --esm for ESM projects or omit for CJS projects\nnpx neostandard --esm \u003e eslint.config.js\n\n# 4. Run ESLint\neslint . # Or specify your source files/directories\n```\n\nNeoStandard provides a similar zero-config experience but leverages the latest ESLint features and community best practices.\n\n# Healthier\n\nAn opinionated code style agnostic linter – a friendly companion to Prettier.\n\n## Why?\n\nPrettier is a powerful code formatter. However, linting your code in addition to formatting can reveal a number of code quality issues and potential bugs.\n\nHealthier is a code linter that you should run in addition to formatting your code with Prettier to find the most common issues with your code. It saves you having to install or configure any of the 100s of ESLint rules by hand or hand pick the plugins to use.\n\nHealthier delegates all of the code quality related decisions to [Standard][standard/standard]. The community has put a lot of effort into that project and Healthier simply helps you get the benefits of it when using a different code style, such as Prettier.\n\nThe goal is to avoid creating yet another opinionated set of rules and instead reuse well established existing options in an easy to use workflow.\n\nBecause Healthier is only concerned with code quality linting, it means you can use any code formatter, such as Prettier or any of it's variants like [prettierx][prettierx] or [prettier-standard][prettier-standard].\n\n## Why not just use Prettier with Standard?\n\nStandard is not only checking your code quality, but also your code style. Unfortunately Prettier and Standard code styles are incompatible in subtle ways. This means you can't use the two tools together. Healthier completely lets go off Standard's code style in favor of Prettier's and combines the best aspects of each tool:\n\n1. Use Prettier to format your JavaScript, CSS and other files.\n2. Use Healthier to lint your JavaScript for code quality issues.\n3. Benefit from Healthier's Standard inspired zero config approach – no glob patterns necessary, no ESLint plugins, no manual rule configuration.\n\nYou can create a `.prettierrc` file in your project with the following content to bring your code style pretty close to Standard:\n\n```\n{\n  \"semi\": false,\n  \"singleQuote\": true,\n  \"jsxSingleQuote\": true,\n  \"printWidth\": 120\n}\n```\n\n## Usage\n\n```\nnpm install healthier\n```\n\nThen run in your project:\n\n```\n$ npx healthier\n\n/App.js\n  4:1  error  'useState' is not defined  no-undef\n\n✖ 1 problem (1 error, 0 warnings)\n```\n\nNote: `npx` prefix can be omitted if you have `./node_modules/.bin` in your `PATH`.\n\n## Recommended setup\n\nThe recommended setup is to install Prettier and Healthier and configure them in `package.json`:\n\n```json\n{\n  \"name\": \"my-cool-package\",\n  \"scripts\": {\n    \"test\": \"ava \u0026\u0026 healthier \u0026\u0026 prettier --check '**/*.{js,json,css}'\",\n    \"format\": \"prettier --write '**/*.{js,json,css,yml}'\"\n  },\n  \"devDependencies\": {\n    \"healthier\": \"*\",\n    \"prettier\": \"*\"\n  }\n}\n```\n\nWhen you use Prettier and Healthier code editor extensions, you will get both auto formatting and linting working in tandem. And in CI, `npm test` will warn you about missed code quality issues or if something was not formatted with Prettier.\n\n## Editor plugins\n\n- [Sublime Text](./docs/01-sublime-text.md)\n- [VSCode](./docs/02-vscode.md)\n- [Vim](./docs/03-vim.md)\n\n## Rules\n\nHealthier is based on `standard-engine` which in itself is based on `eslint`. Healthier combines the following ESLint config rules and plugins:\n\n- eslint-config-standard\n- eslint-config-standard-jsx\n- eslint-config-standard-react\n- eslint-config-prettier\n\nWhich in turn depend on the following plugins:\n\n- eslint-plugin-import\n- eslint-plugin-node\n- eslint-plugin-promise\n- eslint-plugin-react\n- eslint-plugin-react-hooks\n\nThat's a lot of things you don't need to install!\n\nReview the full list of `standard` rules here https://github.com/standard/standard/blob/master/RULES.md.\n\n## Configuration\n\nHealthier can be configured in `package.json` in `healthier` field.\n\n### Custom Parser\n\nUsing a custom parser is sometimes necessary when using futuristic JS features. To use one, install it from npm (e.g. `npm install @babel/eslint-parser`) and configure it in your package.json:\n\n```json\n{\n  \"healthier\": {\n    \"parser\": \"@babel/eslint-parser\"\n  }\n}\n```\n\n## Automatic formatter\n\nThere exist certain `standard` rules that `prettier` has no opinion about. For example the `lines-between-class-members` rule is turned on by `standard` to improve readability by enforcing lines between class members. However `prettier` allows class members without lines in between. In these cases you can get healthier to fix those issues for you:\n\nYou can use `healthier --fix` to fix such issues automatically.\n\n### Ignoring files\n\nJust like in Standard, The paths `node_modules/**`, `*.min.js`, `bundle.js`, `coverage/**`, hidden files/folders (beginning with `.`), and all patterns in a project's root `.gitignore` file are automatically excluded when looking for `.js` files to check. Additionally everything in `.prettierignore` is also ignored, since if you're not formatting something, you probably don't want to lint it.\n\nSometimes you need to ignore additional folders or specific minified files. To do that, add a `healthier.ignore` property to `package.json`:\n\n```json\n\"healthier\": {\n  \"ignore\": [\n    \"**/out/\",\n    \"/lib/select2/\",\n    \"/lib/ckeditor/\",\n    \"tmp.js\"\n  ]\n}\n```\n\n### Globals\n\nIf you want to allow certain globals, configure like so:\n\n```json\n{\n  \"healthier\": {\n    \"globals\": [\"describe\", \"it\"]\n  }\n}\n```\n\n### TypeScript\n\nTo use TypeScript, you need to run Healthier with `@typescript-eslint/parser` as the parser, `@typescript-eslint/eslint-plugin` as a plugin, and tell Healthier to lint `*.ts` files (since it doesn't by default).\n\n```bash\nnpm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin\n```\n\nThen run:\n\n```bash\n$ healthier --parser @typescript-eslint/parser --plugin @typescript-eslint *.ts\n```\n\nOr, add this to `package.json`:\n\n```json\n{\n  \"healthier\": {\n    \"parser\": \"@typescript-eslint/parser\",\n    \"plugins\": [\"@typescript-eslint\"]\n  }\n}\n```\n\nWith that in `package.json`, you can run:\n\n```bash\nhealthier *.ts\n```\n\n### ESLint Environments\n\nESLint has an [environment](http://eslint.org/docs/user-guide/configuring.html#specifying-environments) feature that defines what global variables are allowed to be used. For a list of what globals are available for these environments, check the [globals](https://github.com/sindresorhus/globals/blob/master/globals.json) npm module.\n\nFor example, to support mocha global variables in test files, add this to the top of the test files:\n\n```js\n/* eslint-env mocha */\n```\n\nOr, run:\n\n```bash\n$ healthier --env mocha\n```\n\n### Extending ESLint Rules\n\nHealthier allows extending ESLint rules by creating `.eslintrc` file. For full documentation see [Configuring ESLint](https://eslint.org/docs/user-guide/configuring).\n\nFor example, to make snake_case allowed in your code, set the following in your `.eslintrc`:\n\n```\n{\n  \"rules\": {\n    \"camelcase\": 0\n  }\n}\n```\n\nYou can also use this method to extend other configs and plugins, for example, to use `standard-react` and `jsx-a11y` when developing a React application, install the following:\n\n```\nnpm i -D eslint-config-standard-react eslint-plugin-jsx-a11y\n```\n\nAnd put this in your `.eslintrc`:\n\n```json\n{\n  \"extends\": [\"plugin:jsx-a11y/strict\", \"standard-react\"]\n}\n```\n\n## Ejecting\n\nTo stop using Healthier and switch to pure ESLint while preserving most of Healthier's functionality, [follow this guide](./docs/04-ejecting.md).\n\n[npm-image]: https://img.shields.io/npm/v/healthier.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/healthier\n[downloads-image]: https://img.shields.io/npm/dm/healthier.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/healthier\n[prettier/prettier]: https://github.com/prettier/prettier\n[standard/standard]: https://github.com/standard/standard\n[prettier-standard]: https://github.com/sheerun/prettier-standard\n[prettierx]: https://github.com/brodybits/prettierx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkidkarolis%2Fhealthier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkidkarolis%2Fhealthier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkidkarolis%2Fhealthier/lists"}