Skip to content

Instantly share code, notes, and snippets.

@paulhhowells
Created May 11, 2020 21:49
Show Gist options
  • Save paulhhowells/bfec487c9b2a7262b6d57a4075740e8c to your computer and use it in GitHub Desktop.
Save paulhhowells/bfec487c9b2a7262b6d57a4075740e8c to your computer and use it in GitHub Desktop.
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"env": {
"browser": true,
"es6":true,
"jest": true, // stop globals errors in test files
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"settings": {
"react": {
"pragma": "React",
"version": "16.13.1"
}
},
"rules": {
"indent": ["error", "tab", {"SwitchCase": 1}],
"max-len": [
"error",
{
"code": 160, // set high as eslint cannot --fix
// "comments": 160,
"tabWidth": 2,
"ignoreUrls": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"arrow-parens": ["error", "as-needed"],
"brace-style": ["error", "1tbs"], // else stroustrup
"comma-dangle": ["error", "only-multiline"],
"linebreak-style": "off", // git checks out LF as CRLF on windows
"keyword-spacing": ["error", { "before": true, "after": true }],
"array-bracket-spacing": ["error", "always"],
"object-curly-spacing": ["error", "always"],
"space-before-blocks": "error",
"space-infix-ops": "error",
"prefer-const": "error",
"quotes": ["error", "single", { "allowTemplateLiterals": true }],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"vars-on-top": "error",
"eqeqeq": "warn",
"react/jsx-closing-bracket-location": ["warn"], // ? "line-aligned"]
// eslint-plugin-react-hooks
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
// JSX
"react/jsx-curly-spacing": [
"error",
{"when": "always", "children": true}
]
}
}
//func-call-spacing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment