-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.eslintrc
More file actions
80 lines (80 loc) · 3.7 KB
/
.eslintrc
File metadata and controls
80 lines (80 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react", "prettier", "only-warn", "unused-imports", "import", "simple-import-sort", "immutable", "react-hooks"],
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"prettier/react", // disables react-specific linting rules that conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
"ignorePatterns": ["dist"],
"rules": {
"immutable/no-let": "warn",
"immutable/no-this": "warn",
"immutable/no-mutation": "warn",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"require-await": "warn",
"no-param-reassign": "error",
"no-console": "warn",
"no-useless-constructor": "warn",
"no-await-in-loop": "warn", // Disallow await operations in a loop. Use promise.all instead
"no-template-curly-in-string": "error", // Disallow when a regular string contains what looks like a template literal placeholder
"curly": "warn", // (Fixable) Disallow the omission of curly braces when a block contains only one statement.
"no-else-return": ["warn", { "allowElseIf": true }],
"no-extra-boolean-cast": "warn", // (Fixable)
"sort-imports": "off", // Turned off in favor of using "eslint-plugin-import"
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": "off", // Turned off in favor of using "eslint-plugin-unused-imports"
"no-unused-vars": "off",
"unused-imports/no-unused-imports-ts": "off", // (Fixable) Disallow unused imports
"unused-imports/no-unused-vars-ts": "warn", // Disallow unused variables
"import/order": "off",
"import/first": "warn", // (Fixable)
"import/newline-after-import": "warn", // (Fixable)
"import/no-duplicates": "warn", // (Fixable)
"simple-import-sort/sort": [
"warn",
{
"groups": [
// Node.js builtins. You could also generate this regex if you use a `.js` config.
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
[
"^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)"
],
// Packages. `react` related packages come first.
["^react", "^@?\\w"],
// Internal packages.
["^(@|@company|@ui|components|utils|config|api|css|images|vendored-lib)(/.*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.s?css$"]
]
}
]
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true // Allows for the parsing of JSX
}
},
"settings": {
"react": {
"version": "detect" // Tells eslint-plugin-react to automatically detect the version of React to use
}
}
}