eslint-plugin-arcadia
v1.2.1
Published
Arcadia's ESLint config bundled into a "zero-conf" plugin
Downloads
2
Maintainers
Readme
eslint-plugin-arcadia
Arcadia's ESLint config bundled into a "zero-conf" plugin
Why
We want shareable configs to have as low of an overhead as possible. Users shouldn't have to know exactly what plugins are required by the config, install them and manage their versions manually. This plugin exposes eslint-config-arcadia
for reuse, with plugins automatically installed.
See https://github.com/eslint/eslint/issues/3458 for further discussion on this topic. Approach inspired by
eslint-plugin-react-app
andeslint-plugin-springload
.
Usage
Install the plugin and its minimal peer dependencies:
npm i -D eslint prettier eslint-plugin-arcadia
Configure ESLint to use this config. For example, in your package.json, this would be:
"eslintConfig": {
"extends": "plugin:arcadia/recommended"
},
Jest
Jest-specific rules and environment added to the default export.
"eslintConfig": {
"extends": ["plugin:arcadia/recommended", "plugin:arcadia/jest"]
},
Mocha
Mocha-specific rules and environment added to the default export.
"eslintConfig": {
"extends": ["plugin:arcadia/recommended", "plugin:arcadia/mocha"]
},
Customizing Rules
You can configure the rules like every other eslint
plugin.
Just keep in mind that if you want to change a rule of an included plugin (for example, eslint-plugin-react
) you must prefix the rule with arcadia/
(necessary to prevent namespace collisions).
For example:
{
"extends": [
"plugin:arcadia/recommended"
],
"rules": {
"arcadia/react/react-in-jsx-scope": ["warn"]
}
}
prettier
Editor Plugin Integration
Unfortunately, super-useful editor plugins like prettier-atom
and prettier-vscode
do not load Prettier settings from ESLint config, which is where we load our Prettier options from. To workaround this, add a .prettierrc.js
or prettier.config.js
file to your root with the following content:
module.exports = require('prettier-config-arcadia');
"Bundled" Plugins
We currently encapsulate the following plugins: