-
-
Save brainomite/d259b1d17b1d70959ab5c6f6ecd019a9 to your computer and use it in GitHub Desktop.
Eslint Configs
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 = { | |
env: { | |
browser: true, | |
es2021: true, | |
}, | |
extends: ["airbnb-base", "prettier"], | |
parserOptions: { | |
ecmaVersion: 12, | |
sourceType: "module", | |
}, | |
rules: { | |
"id-length": [ // turn on rule that checks length of variables | |
"error", // trigger an error if a variable is less than min length | |
{ | |
min: 2, // set minimum length to 2 | |
exceptions: ["_"], // used for packages, lodash and underscore | |
}, | |
], | |
}, | |
}; |
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 = { | |
env: { | |
browser: true, | |
commonjs: true, | |
es2021: true, | |
}, | |
extends: ["airbnb-base", "prettier"], | |
parserOptions: { | |
ecmaVersion: 12, | |
}, | |
rules: { | |
"id-length": [ // turn on rule that checks length of variables | |
"error", // trigger an error if a variable is less than min length | |
{ | |
min: 2, // set minimum length to 2 | |
exceptions: ["_"], // used for packages, lodash and underscore | |
}, | |
], | |
}, | |
}; |
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 = { | |
env: { | |
browser: true, | |
es2021: true, | |
}, | |
extends: ["plugin:react/recommended", "airbnb", "prettier", "prettier/react"], | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
}, | |
ecmaVersion: 12, | |
sourceType: "module", | |
}, | |
plugins: ["react"], | |
rules: { | |
"id-length": [ | |
// turn on rule that checks length of variables | |
"error", // trigger an error if a variable is less than min length | |
{ | |
min: 2, // set minimum length to 2 | |
exceptions: ["_"], // used for packages, lodash and underscore | |
}, | |
], | |
// the following overrules the AirBnB style guide for react | |
"react/jsx-filename-extension": [1, { extensions: [".js", ".jsx"] }], | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md | |
"react/destructuring-assignment": "off", | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md | |
"default-props-match-prop-types": "off", | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/default-props-match-prop-types.md | |
"react/require-default-props": "off", | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md | |
"react/style-prop-object": "off", | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md | |
"react/jsx-no-target-blank": "off", | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md | |
"react/prop-types": "off", | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md | |
"react/no-array-index-key": "off", | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment