Various eslint configs for my personal use. My approach with all of these is:
- Extend the recommended configs for all plugins (including eslint itself)
- Tweak where it I diagree with the recommended or want extra lints
- Don't use any stylistic lints, rely on Prettier for those instead
NOTE: when extending any of these configs, you will need to set
parserOptions.ecmaVersion
(not required for the TypeScript config as it uses its own parser) andenv
for your project.
Some of the configs make no sense without another one, in such cases they extend it so you don't need to. Bear in mind that extend order is important – for example, you'll need to extend the TypeScript config after the React one so that the TypeScript one can fix any eslint rules that don't work with TS syntax.
Also note that peer dependencies for eslint configs are set in package.json
so you will get warned about the peerDependencies
for the React config even if you're not extending it.
-
Base:
@benadamstyles
-
Node (extends Base):
@benadamstyles/eslint-config/node
-
TypeScript (extends Base):
@benadamstyles/eslint-config/typescript
NOTE: You will need some extra local settings when extending the typescript config.
-
Flow (extends Base):
@benadamstyles/eslint-config/flow
-
React (extends Base):
@benadamstyles/eslint-config/react
- React Native (extends React):
@benadamstyles/eslint-config/react-native
- React Native (extends React):
-
Top-level await
(TLA) is available in Node v14+, but not currently supported by eslint. To use it with this eslint config, you will need to extend the flow
config (because that uses @babel/eslint-parser
which does support TLA) and make sure you have the @babel/plugin-syntax-top-level-await
plugin in your own project's Babel config.
This package uses semantic-release with the default settings applied, to manage releases.