1+ {
2+ "env": {
3+ "browser": true,
4+ "es2020": true
5+ },
6+ "parser": "@typescript-eslint/parser",
7+ "parserOptions": {
8+ "ecmaFeatures": {
9+ "jsx": true
10+ },
11+ "ecmaVersion": 11,
12+ "sourceType": "module"
13+ },
14+ "plugins": [
15+ "@typescript-eslint",
16+ "unused-imports",
17+ "spellcheck",
18+ "simple-import-sort"
19+ ],
20+ "extends": [
21+ "plugin:import/recommended",
22+ "plugin:import/errors",
23+ "plugin:import/warnings",
24+ "plugin:import/typescript"
25+ ],
26+ "rules": {
27+ // turn on errors for missing imports
28+ "import/no-unresolved": "error",
29+ "spellcheck/spell-checker": [
30+ "error",
31+ {
32+ "comments": false,
33+ "strings": true,
34+ "identifiers": true,
35+ "templates": true,
36+ "ignoreRequire": true,
37+ "lang": "en_US",
38+ "skipWords": [],
39+ // Check if word contains numbers
40+ "skipIfMatch": [
41+ "\\d+",
42+ "^[a-z]+$"
43+ ],
44+ "minLength": 3
45+ }
46+ ],
47+ "import/no-useless-path-segments": [
48+ "error",
49+ {
50+ "noUselessIndex": true
51+ }
52+ ],
53+ "import/export": "off",
54+ "import/namespace": "warn",
55+ "import/no-duplicates": [
56+ "error",
57+ {
58+ "prefer-inline": true
59+ }
60+ ],
61+ "import/newline-after-import": [
62+ "error",
63+ {
64+ "count": 1
65+ }
66+ ],
67+ "unused-imports/no-unused-imports": "error",
68+ "simple-import-sort/imports": [
69+ "error",
70+ {
71+ // docs: https://github.com/lydell/eslint-plugin-simple-import-sort#custom-grouping
72+ "groups": [
73+ // Side effect imports.
74+ [
75+ "^\\u0000"
76+ ],
77+ // Node.js builtins prefixed with `node:`.
78+ [
79+ "^node:"
80+ ],
81+ // Packages.
82+ // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
83+ [
84+ "^react",
85+ "^\\w",
86+ "^@\\w"
87+ ],
88+ // Absolute imports and other imports such as Vue-style `@/foo`.
89+ // Anything not matched in another group.
90+ [
91+ "^"
92+ ],
93+ // Relative imports.
94+ [
95+ "^../../"
96+ ],
97+ // Anything that starts with a dot.
98+ [
99+ "^../",
100+ "^./",
101+ "^\\."
102+ ],
103+ // Global CSS files at bottom
104+ [
105+ "\\.css$"
106+ ]
107+ ]
108+ }
109+ ],
110+ "function-call-argument-newline": [
111+ "error",
112+ "consistent"
113+ ],
114+ "no-var": "error",
115+ "no-bitwise": "error",
116+ "no-multi-spaces": "error",
117+ "no-multiple-empty-lines": "error",
118+ "space-in-parens": "error",
119+ "semi": "error",
120+ "prefer-const": "error",
121+ // off cuz eslint is dumb: https://stackoverflow.com/questions/63818415/react-was-used-before-it-was-defined
122+ "no-use-before-define": "off",
123+ "@typescript-eslint/no-use-before-define": [
124+ "error"
125+ ],
126+ // Codestyle
127+ "indent": [
128+ "error",
129+ "tab",
130+ {
131+ "SwitchCase": 1
132+ }
133+ ],
134+ "camelcase": [
135+ "error",
136+ {
137+ "allow": [
138+ "^UNSAFE_",
139+ "^UNSTABLE_"
140+ ]
141+ }
142+ ],
143+ "arrow-parens": [
144+ "error",
145+ "always"
146+ ],
147+ "operator-linebreak": [
148+ "error",
149+ "after",
150+ {
151+ "overrides": {
152+ "?": "before",
153+ ":": "before"
154+ }
155+ }
156+ ],
157+ "space-before-function-paren": [
158+ "error",
159+ {
160+ "asyncArrow": "always",
161+ "anonymous": "never",
162+ "named": "never"
163+ }
164+ ]
165+ }
166+ }
0 commit comments