Skip to content

Instantly share code, notes, and snippets.

@liesislukas
Created September 3, 2021 06:06
Show Gist options
  • Save liesislukas/17f913719d5c5e9a82efc2da50a39d62 to your computer and use it in GitHub Desktop.
Save liesislukas/17f913719d5c5e9a82efc2da50a39d62 to your computer and use it in GitHub Desktop.
Eslint rules to work next to prettier. I use prettier's default to format everything and eslint to highlight code issues.
module.exports = {
env: {
browser: true,
es6: true,
node: true,
commonjs: true,
},
extends: ["eslint:recommended", "plugin:react/recommended"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
define: true,
expect: true,
path: true,
beforeAll: true,
afterAll: true,
},
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
jsx: true,
experimentalObjectRestSpread: true,
},
ecmaVersion: 2018,
sourceType: "module",
},
parser: "babel-eslint",
plugins: ["react"],
rules: {
// prettier is handling all the syntax formatting
quotes: 0,
semi: 0,
"comma-dangle": 0,
"object-curly-spacing": 0,
"array-bracket-spacing": 0,
"space-before-function-paren": 0,
"arrow-spacing": 0,
"arrow-parens": 0,
"arrow-body-style": 0,
"no-multiple-empty-lines": 0,
"func-style": 0,
"no-empty-pattern": 0,
indent: 0,
"linebreak-style": 0,
"jsx-quotes": 0,
"react/jsx-max-props-per-line": 0,
"react/jsx-props-no-multi-spaces": 0,
"react/jsx-indent": 0,
"react/jsx-indent-props": 0,
"react/jsx-first-prop-new-line": 0,
"react/jsx-equals-spacing": 0,
"react/jsx-curly-newline": 0,
"react/jsx-closing-bracket-location": 0,
"react/jsx-curly-spacing": 0,
"react/jsx-child-element-spacing": 0,
"react/jsx-closing-tag-location": 0,
"react/jsx-tag-spacing": 0,
"react/react-in-jsx-scope": 0,
"react/display-name": 0,
"react/prop-types": 0,
"no-console": 0,
"no-empty": "warn",
strict: ["error", "global"],
"no-unused-vars": "warn",
"consistent-return": "warn",
"no-shadow": "error",
"no-confusing-arrow": "warn",
"no-constant-condition": "error",
"no-undef": "error",
"require-yield": "warn",
"no-async-promise-executor": "warn",
"react/jsx-no-duplicate-props": "warn",
"react/jsx-key": "warn",
"no-case-declarations": "error",
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment