Skip to content

Instantly share code, notes, and snippets.

@phanlyhuynh
Last active October 13, 2020 08:03
Show Gist options
  • Save phanlyhuynh/c60ea5ee47b4086371420a53da224e4e to your computer and use it in GitHub Desktop.
Save phanlyhuynh/c60ea5ee47b4086371420a53da224e4e to your computer and use it in GitHub Desktop.
Eslint file's configuration
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
["lodash", { "id": ["lodash", "recompose"] }],
"@babel/plugin-syntax-dynamic-import"
]
}
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"settings": {
"import/resolver": "webpack"
},
"env": {
"es6": true,
"browser": true
},
"globals": {},
"extends": ["airbnb"],
"plugins": [
"react-hooks"
],
"rules": {
// "linebreak-style": ["error", "windows", "Unix"],
"linebreak-style": 0,
"arrow-parens": "warn",
"comma-dangle": ["error", {
"functions": "ignore"
}],
"consistent-return": "off",
"eqeqeq": "off",
"function-paren-newline": "off",
"import/extensions": ["error", {
"js": "never"
}],
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"import/no-unresolved": "error",
"import/no-extraneous-dependencies": ["error", {
"devDependencies": true
}],
"indent": ["error", 4],
"jsx-a11y/alt-text": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/anchor-has-content": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/mouse-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-quotes": ["warn", "prefer-single"],
"max-len": ["warn", 120],
"no-plusplus": ["error", {
"allowForLoopAfterthoughts": true
}],
"no-return-assign": "off",
"no-use-before-define": ["error", {
"functions": false
}],
"object-curly-newline": ["error", {
"ObjectExpression": {
"consistent": true
},
"ObjectPattern": {
"consistent": true
},
"ImportDeclaration": {
"consistent": true
},
"ExportDeclaration": {
"consistent": true
}
}],
"object-curly-spacing": "off",
"prefer-const": "warn",
"react/jsx-boolean-value": "warn",
"react/jsx-filename-extension": ["error", {
"extensions": [".js"]
}],
"react/jsx-indent-props": ["error", 4],
"react/jsx-indent": ["error", 4],
"react/jsx-no-bind": ["warn", {
"ignoreRefs": true
}],
"react/no-array-index-key": "warn",
"jsx-a11y/label-has-for": "off",
"no-underscore-dangle": "off",
"react/forbid-prop-types": "off",
"max-lines": ["error", 200],
"react/no-danger": "off",
"no-restricted-globals": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"global-require": "off"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment