eslint-config-osedea
Peer dependencies
eslint == 6.8.0
is a requirement. See external dependencies list below.
Configuring rules for project
eslint-config-osedea
comes with the following environments, some of which are already pre-configured, however you can mix-and-match the environments if you want.
Config name | Extends | External Dependencies (besides eslint) |
---|---|---|
angular | ||
cypress | cypress | |
es5 | ||
esnext | es5 | |
flow | flow-bin | |
jest | jest, jest-dom, testing-library | |
mocha | mocha | |
node | esnext, mocha | |
prettier | prettier | |
react | esnext | |
react-native | react | |
typescript | esnext | typescript |
Create a file called .eslintrc.yml
in the root of your project. Here, you will specify your rules, and extend one (or more) of the above rulesets.
Some example .eslintrc.yml
configs:
extends: - osedea/react # extends other configs, see above - osedea/typescript - osedea/prettier # always needs to be last
extends: - osedea/react-native # extends other configs, see above - osedea/flow - osedea/prettier # always needs to be last
extends: - osedea/node # extends other configs, see above
extends: - osedea/es5 - osedea/angular # You can override rules from the linter here. Use at your own risk.# rules:# comma-dangle: off # For example, if you do not want the linter to check for dangling commas ever
Global settings
Depending on your config, you may need to add a settings block to your .eslintrc.yml
.
osedea/typescript
Add this block to your eslintrc:
parserOptions:
project: './tsconfig.json'
If using VSCode & eslint errors aren't displaying, add this to your settings.json
:
"eslint.validate": ,
osedea/react-native
For react-native
config, in order to resolve imports (import x from CoolProject/.../...), the project name must be defined. The plugin will use the name
param of the package.json in order to solve this.
osedea/node
For node
config, it uses the engines
section of package.json
:
osedea/prettier
Needs to be added last so it is able to override other configs.
osedea/import
If you're using webpack to alias your directories, you can fix this by installing eslint-import-resolver-webpack
and adding to your project's eslintrc:
settings:
import/resolver: webpack
osedea/flow
Use a flow plugin for your editor (for example, flow language support
for VSCode). Otherwise using eslint-plugin-flowtype-errors
is an option.