Skip to content

Commit ebcae3a

Browse files
committed
update eslint
1 parent 5e99ffd commit ebcae3a

File tree

7 files changed

+1432
-16
lines changed

7 files changed

+1432
-16
lines changed

.eslintrc.json

Lines changed: 100 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,110 @@
11
{
2-
"extends": "react-app",
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"react-app",
5+
"prettier",
6+
"standard",
7+
"plugin:unicorn/recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:import/errors",
11+
"plugin:import/warnings"
12+
],
13+
"settings": {
14+
"import/parsers": {
15+
"@typescript-eslint/parser": [".ts", ".tsx"]
16+
},
17+
"import/resolver": {
18+
"node": { "extensions": [".js", ".mjs", ".cjs"] },
19+
"typescript": {}
20+
}
21+
},
22+
"plugins": ["@typescript-eslint", "simple-import-sort", "import"],
323
"rules": {
424
"react/react-in-jsx-scope": "off",
525
"react/display-name": "off",
626
"react/prop-types": "off",
727
"react/jsx-key": "error",
828
"no-console": 1,
929
"no-unused-vars": "off",
10-
"@typescript-eslint/no-unused-vars": "error"
30+
"@typescript-eslint/no-unused-vars": "error",
31+
"simple-import-sort/imports": "error",
32+
"simple-import-sort/exports": "error",
33+
"import/newline-after-import": "error",
34+
"import/no-duplicates": "error",
35+
// Enforce import order
36+
// "import/order": ["error"],
37+
// Imports should come first
38+
"import/first": "error",
39+
// Other import rules
40+
"import/no-mutable-exports": "error",
41+
// Allow unresolved imports
42+
"import/no-unresolved": "off",
43+
44+
"semi": 0,
45+
"quotes": 0,
46+
"indent": 0,
47+
"space-before-function-paren": 0,
48+
"arrow-parens": 0,
49+
"comma-dangle": 0,
50+
"keyword-spacing": 0,
51+
"no-multiple-empty-lines": 0,
52+
"no-trailing-spaces": 0,
53+
"unicorn/number-literal-case": 0,
54+
"unicorn/template-indent": 0,
55+
"generator-star-spacing": 0,
56+
"space-infix-ops": 0,
57+
"comma-spacing": 0,
58+
"brace-style": 0,
59+
"space-in-parens": 0,
60+
"space-before-blocks": 0,
61+
"semi-spacing": 0,
62+
"object-property-newline": 0,
63+
"no-multi-spaces": 0,
64+
"key-spacing": 0,
65+
"eol-last": 0,
66+
"func-call-spacing": 0,
67+
"comma-style": 0,
68+
69+
// Disable some unnecessary or conflicting rules
70+
"no-use-before-define": "off",
71+
"unicorn/prevent-abbreviations": 0,
72+
"unicorn/no-await-expression-member": 0,
73+
"unicorn/no-useless-undefined": 0,
74+
"unicorn/no-array-push-push": 0,
75+
"unicorn/filename-case": 0,
76+
"@typescript-eslint/no-explicit-any": 0,
77+
"@typescript-eslint/no-empty-function": 0,
78+
"@typescript-eslint/no-var-requires": 0,
79+
"@typescript-eslint/ban-ts-comment": 0,
80+
"@typescript-eslint/no-empty-interface": 0,
81+
82+
// Prefer const over let
83+
"prefer-const": [
84+
"error",
85+
{
86+
"destructuring": "any",
87+
"ignoreReadBeforeAssign": false
88+
}
89+
],
90+
91+
// No single if in an "else" block
92+
"no-lonely-if": "error",
93+
94+
// Force curly braces for control flow,
95+
// including if blocks with a single statement
96+
"curly": ["error", "all"],
97+
98+
// No async function without await
99+
"require-await": "error",
100+
101+
// Force dot notation when possible
102+
"dot-notation": "error",
103+
104+
// Force object shorthand where possible
105+
"object-shorthand": "error",
106+
107+
// No useless destructuring/importing/exporting renames
108+
"no-useless-rename": "error"
11109
}
12110
}

0 commit comments

Comments
 (0)