CodeX basic ESLint configuration
Install
Add package to your dev-dependencies using npm or yarn:
$ npm i -D eslint-config-codex eslint
$ yarn add -D eslint-config-codex eslint
Usage in JavaScript
Add .eslintrc
file to your project's root if you don't have it.
./node_modules/.bin/eslint init
Then add the extends
section to there:
{
"extends": [
"codex"
]
}
Usage in TypeScript
- Follow instructions for JavaScript
- Extend from
codex/ts
instead ofcodex
{
"extends": [
"codex/ts"
]
}
Troubleshooting
ESLint couldn't determine the plugin ... uniquely
Since 7.x ESLint loads plugins from the location of each config file which has the plugins
field. Resolve this issue by adding the root flag to your .eslintrc
config
{
"root": true
}