Last active
September 23, 2018 18:43
-
-
Save gcangussu/e93b78258067b8c85f470764cd255ce5 to your computer and use it in GitHub Desktop.
Eslint front end setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coverage | |
build | |
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
parser: 'babel-eslint', | |
parserOptions: { | |
ecmaVersion: 8, | |
sourceType: 'module', | |
ecmaFeatures: { | |
jsx: true, | |
}, | |
}, | |
plugins: ['import', 'jsx-a11y', 'react', 'redux-saga', 'jest'], | |
extends: [ | |
'plugin:jest/recommended', | |
'plugin:redux-saga/recommended', | |
'airbnb', | |
'prettier', | |
'prettier/react', | |
], | |
env: { | |
es6: true, | |
browser: true, | |
node: true, | |
jest: true, | |
}, | |
settings: { | |
'import/resolver': { | |
node: { | |
extensions: ['.js', '.ts', '.tsx'], | |
}, | |
}, | |
}, | |
rules: { | |
// Be able to make only one named export | |
'import/prefer-default-export': 'off', | |
// Don't alow ".jsx" | |
'react/jsx-filename-extension': ['error', { extensions: ['.js'] }], | |
// Allow use before definition | |
'no-use-before-define': 'off', | |
// Airbnb enforces input nesting and id linking, this is too strict | |
// These following two rules make only one strategy required | |
'jsx-a11y/label-has-for': [ | |
'error', | |
{ | |
components: [], | |
required: { | |
some: ['nesting', 'id'], | |
}, | |
allowChildren: false, | |
}, | |
], | |
'jsx-a11y/label-has-associated-control': [ | |
'error', | |
{ | |
labelComponents: [], | |
labelAttributes: [], | |
controlComponents: [], | |
depth: 25, | |
}, | |
], | |
// Airbnb makes this an error | |
// Make it a warning temporarily while we refactor the code | |
'react/destructuring-assignment': ['warn', 'always'], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment