{"id":13483760,"url":"https://github.com/davidjbradshaw/eslint-config-auto","last_synced_at":"2025-05-16T11:07:04.987Z","repository":{"id":37089216,"uuid":"270135867","full_name":"davidjbradshaw/eslint-config-auto","owner":"davidjbradshaw","description":"Automatically configure ESLint based on project dependencies","archived":false,"fork":false,"pushed_at":"2024-05-01T07:57:04.000Z","size":109,"stargazers_count":404,"open_issues_count":19,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-01T20:38:24.677Z","etag":null,"topics":["airbnb","babel","eslint","eslint-config","eslint-config-airbnb","eslint-plugin","eslint-rules","lodash","react","redux","sonarjs","typescript","unicorn"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidjbradshaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"davidjbradshaw","custom":["https://www.buymeacoffee.com/davidjbradshaw"]}},"created_at":"2020-06-06T23:39:03.000Z","updated_at":"2025-03-31T04:25:36.000Z","dependencies_parsed_at":"2024-02-17T10:30:47.762Z","dependency_job_id":"966f95c7-644c-4ac7-91f4-ff40eade85ef","html_url":"https://github.com/davidjbradshaw/eslint-config-auto","commit_stats":{"total_commits":142,"total_committers":6,"mean_commits":"23.666666666666668","dds":0.5,"last_synced_commit":"80a1a44e6434f5ef5f7eb61fbc4f1664da18353a"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidjbradshaw%2Feslint-config-auto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidjbradshaw%2Feslint-config-auto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidjbradshaw%2Feslint-config-auto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidjbradshaw%2Feslint-config-auto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidjbradshaw","download_url":"https://codeload.github.com/davidjbradshaw/eslint-config-auto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253799264,"owners_count":21966251,"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":["airbnb","babel","eslint","eslint-config","eslint-config-airbnb","eslint-plugin","eslint-rules","lodash","react","redux","sonarjs","typescript","unicorn"],"created_at":"2024-07-31T17:01:15.026Z","updated_at":"2025-05-16T11:06:59.964Z","avatar_url":"https://github.com/davidjbradshaw.png","language":"JavaScript","funding_links":["https://github.com/sponsors/davidjbradshaw","https://www.buymeacoffee.com/davidjbradshaw"],"categories":["JavaScript","Configs","babel"],"sub_categories":["Other Prominent Configs (100 stars or so)"],"readme":"# eslint-config-auto \u0026nbsp;[![NPM version](https://badge.fury.io/js/eslint-config-auto.svg)](http://badge.fury.io/js/eslint-config-auto) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n\u003e Automatically configure ESLint based on project dependencies\n\nThis project got created because I got tired of managing [eslint](https://eslint.org) in multiple different projects and trying to keep them all vaguely in sync. It will automatically configure the most appropriate version of the [airbnb eslint rules](https://github.com/airbnb/javascript) and a curated selection of [plugins](https://github.com/davidjbradshaw/eslint-config-auto#rules) based on the contents of your project's `package.json` file each time you run eslint. When you add a new library to your project, the associated plugin will get automatically included.\n\nThe aim here is to include a range of _mostly reasonable_ plugins, whilst not being overly restrictive. The recommended configs for each plugin are used with a few exceptions for rules that have been [disabled](https://github.com/davidjbradshaw/eslint-config-auto#rules-1) for appearing unduely restrictive or conflicting with other plugins. If you use Prettier then all the formating rules are also omitted by including [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier).\n\nIn addition to JavaScript, suport is included for linting TypeScript, HTML, Json, and MarkDown files.\n\n## Alternative\n\nIf you like the ideas behind this config, but not the AirBnB styleguide, then checkout [eslint-config-adjunt](https://github.com/davidjbradshaw/eslint-config-adjunct). It includes most of the extra plugins used here, but lets you choose your prefered main eslint config.\n\n## Contibuting\n\nSuggestions for adding new plugings will be carefully considered against the _mostly reasonable_ standard and usefulness. If you would like to help out, then I would like to add support for _Vue_ and other popular frameworks. Thanks goes to [awesome-eslint](https://github.com/dustinspecker/awesome-eslint) for having collated the packages this project utalises.\n\n## Install\n\nTo install this config, run the following command.\n\n```sh\nnpm install eslint-config-auto --save-dev\n```\n\n## Configure\n\nCreate an `.eslintrc` file with the following contents.\n\n```json\n{\n  \"extends\": [\"auto\"]\n}\n```\n\nYou can now include `html`, `json` and `markdown` in the list of files passed to `eslint` to lint any JavaScript contained.\n\n```json\n{\n  \"scripts\": {\n    \"eslint\": \"eslint --color --ext .html,.js,.json,.jsx,.md,.ts,.tsx *.* src\",\n    \"eslint:fix\": \"npm run eslint -- --fix\"\n  }\n}\n```\n\n## Install Dependencies\n\nAfter you have configured `eslint` to include this package, the first time you run `eslint` it will output the `npm` command to install the dependencies required for your project. Copy and paste this command into the console, and you are then ready to start linting.\n\n## Rules\n\n### AirBNB\n\nThe most appropreate version of the AirBNB eslint config will be automatically selected.\n\n### Babel\n\nIf the project includes Babel in it's `devDependencies`, then [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) and [eslint-config-airbnb-babel](https://github.com/davidjbradshaw/eslint-config-airbnb-babel) will be loaded and the parser will be set to `babel-eslint`.\n\nSome project setup utils, such as [Create React App](https://github.com/facebook/create-react-app), use Babel without including it as a project dependancies. In such cases you can turn Babel support on by adding `settings: { babel: true }` to your `.eslintrc` config file.\n\n### Code Quality\n\nThese two plugins provide a range of code quality rules:\n\n- [eslint-plugin-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs)\n- [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)\n\n### Compat\n\nIf `settings.compat = true` in your `.eslintrc`, then [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat) is loaded.\n\n### Langauges\n\nThe following plugins expand esLint to support TypeScript, JSON, and lint code contiained in HTML and MarkDown files:\n\n- [@eslint-typescript](https://github.com/typescript-eslint/typescript-eslint)\n- [eslint-plugin-json](https://github.com/azeemba/eslint-plugin-json)\n- [eslint-plugin-html](https://github.com/BenoitZugmeyer/eslint-plugin-html)\n- [eslint-plugin-markdown](https://github.com/eslint/eslint-plugin-markdown)\n\n_If the project includes TypeScript, then the rules will adapt to lint typescript files and the parser will be set to `@typescript-eslint/parser` for `ts` and `tsx` filetypes._\n\n_When linting code snippets in Markdown files, a few [rules](https://github.com/davidjbradshaw/eslint-config-adjunct/blob/master/rules/markdown.js#L3) relating to globals and unused vars are disabled._\n\n### Library Plugins\n\nThese plugins will be loaded in based on your project `dependencies` in `package.json`. If a supported library is part of your project then it's related esLint plugins will be loaded. The following packages are supported:\n\n- [eslint-plugin-lodash](https://github.com/wix/eslint-plugin-lodash)\n- [eslint-plugin-lodash-fp](https://github.com/jfmengels/eslint-plugin-lodash-fp)\n- [eslint-plugin-ramda](https://github.com/ramda/eslint-plugin-ramda)\n\n### Node\n\nIf `env.node = true` in your `.eslintrc` file, then [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) is loaded.\n\n### React\n\nIf a project contains React, then a React version of the AirBNB config will be used and if Redux is installed the following extra plugins will be loaded.\n\n- [eslint-plugin-fsa](https://github.com/joseph-galindo/eslint-plugin-fsa)\n- [eslint-plugin-react-redux](https://github.com/DianaSuvorova/eslint-plugin-react-redux#readme)\n- [eslint-plugin-redux-saga](https://github.com/pke/eslint-plugin-redux-saga)\n\n### Practices\n\nThe following esLint plugins enforce good coding practices:\n\n- [eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)\n- [eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments)\n- [eslint-plugin-no-constructor-bind](https://github.com/markalfred/eslint-plugin-no-constructor-bind)\n- [eslint-plugin-no-use-extend-native](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native)\n- [eslint-plugin-optimize-regex](https://github.com/BrainMaestro/eslint-plugin-optimize-regex)\n- [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise)\n- [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort)\n- [eslint-plugin-switch-case](https://github.com/lukeapage/eslint-plugin-switch-case)\n\n### Prettier\n\nIf prettier is installed, any rules that may conflict with Prettier will be disabled. The plugin should read you Prettier config from your project's root.\n\n- [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier)\n\nThe prettier configs for different eslint plugins are also automatically included based on which eslint plugins have been installed into your project.\n\n### Security\n\nThese plugins add code security rules to esLint:\n\n- [eslint-plugin-no-secrets](https://github.com/nickdeis/eslint-plugin-no-secrets)\n- [eslint-plugin-no-unsanitized](https://github.com/mozilla/eslint-plugin-no-unsanitized)\n- [eslint-plugin-scanjs-rules](https://github.com/mozfreddyb/eslint-plugin-scanjs-rules)\n- [eslint-plugin-security](https://github.com/nodesecurity/eslint-plugin-security)\n\n### Test Libraries\n\nTest plugins are loaded based on which testing tools you have listed in `devDependencies` of `package.json`. The following test plugins are supported:\n\n- [eslint-plugin-ava](https://github.com/avajs/eslint-plugin-ava)\n- [eslint-plugin-chai-expect](https://github.com/turbo87/eslint-plugin-chai-expect)\n- [eslint-plugin-chai-friendly](https://github.com/ihordiachenko/eslint-plugin-chai-friendly)\n- [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress)\n- [eslint-plugin-jasmine](https://github.com/tlvince/eslint-plugin-jasmine)\n- [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest)\n- [eslint-plugin-jest-async](https://www.npmjs.com/package/eslint-plugin-jest-async)\n- [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha)\n- [eslint-plugin-mocha-cleanup](https://github.com/onechiporenko/eslint-plugin-mocha-cleanup/)\n- [eslint-plugin-qunit](https://github.com/platinumazure/eslint-plugin-qunit)\n- [eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library)\n\n_For test files a few [rules](https://github.com/davidjbradshaw/eslint-config-adjunct/blob/master/rules/test-overrides.js) are turned off, to better to support normal unit test coding styles._\n\n## Rules\n\nIn the most part the default rules are used for the plugins listed above, with the following exceptions.\n\n### Switch-Case\n\nAdds the `fallthrough: 'never'` option to the `newline-between-switch-case` rule.\n\n```js\n// Good\n\nswitch (foo) {\n  case 1:\n    something()\n    break\n\n  case 2:\n  case 3:\n    somethingElse()\n    break\n\n  default:\n    defaultThing()\n}\n```\n\n### Disabled rules\n\nThe following rules are disabled due to them being considered unduly restrictive or unhelpful.\n\n- jest/no-disabled-tests\n- react-redux/prefer-separate-component-file\n- redux-saga/no-unhandled-errors\n- lodash/prefer over native rules\n- lodash-fp/use-fp\n- unicorn/no-array-for-each\n- unicorn/no-fn-reference-in-iterator\n- unicorn/no-array-for-each\n- unicorn/no-reduce\n- unicorn/no-null\n- unicorn/prefer-number-properties\n- unicorn/prefer-optional-catch-binding\n- unicorn/prevent-abbreviations\n\nThe following rules are disabled due to clashing with other plugins\n\n- array-func/prefer-array-from\n- import/order\n- sort-imports\n\n## License\n\nCopyright \u0026copy; 2020-21 [David J. Bradshaw](https://github.com/davidjbradshaw).\nLicensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidjbradshaw%2Feslint-config-auto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidjbradshaw%2Feslint-config-auto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidjbradshaw%2Feslint-config-auto/lists"}