Skip to content

Commit 1163477

Browse files
committed
Add eslint
1 parent 32ca9cb commit 1163477

File tree

5 files changed

+5781
-2027
lines changed

5 files changed

+5781
-2027
lines changed

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copied from '.gitignore', please keep it in sync.
2+
/.eslintcache
3+
/.cspellcache
4+
/node_modules
5+
/dist
6+
/*.graphql
7+
src/editor/main.js
8+
src/editor/main.js.map
9+
src/editor/main.css
10+
src/editor/main.css.map

.eslintrc.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
parserOptions:
2+
sourceType: script
3+
env:
4+
es2022: true
5+
browser: true
6+
plugins: ['simple-import-sort', 'react', 'react-hooks']
7+
settings:
8+
react:
9+
version: detect
10+
extends:
11+
- 'eslint:recommended'
12+
- 'plugin:import/recommended'
13+
- 'plugin:react/recommended'
14+
- 'plugin:react/jsx-runtime'
15+
- 'plugin:react-hooks/recommended'
16+
rules:
17+
# 'simple-import-sort/imports': error
18+
'simple-import-sort/exports': error
19+
'import/no-extraneous-dependencies':
20+
[error, { devDependencies: ['**/*.config.{js,ts}', 'tests/**'] }]
21+
22+
# FIXME: remove below rules
23+
'no-var': off
24+
'prefer-const': off
25+
'simple-import-sort/imports': off
26+
27+
overrides:
28+
- files: '**/*.js'
29+
env:
30+
node: true
31+
32+
- files: ['**/*.ts', '**/*.tsx']
33+
parser: '@typescript-eslint/parser'
34+
parserOptions:
35+
sourceType: module
36+
project: ['tsconfig.json', 'src/editor/tsconfig.json']
37+
plugins: ['@typescript-eslint']
38+
extends:
39+
- 'plugin:import/typescript'
40+
- 'plugin:@typescript-eslint/strict'
41+
- 'plugin:@typescript-eslint/recommended'
42+
- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
43+
rules:
44+
# '@typescript-eslint/array-type': [error, { default: generic }]
45+
'@typescript-eslint/consistent-indexed-object-style':
46+
[error, index-signature]
47+
48+
# FIXME: remove below rules
49+
'no-empty': off
50+
'no-var': off
51+
'prefer-const': off
52+
'react/jsx-no-target-blank': off
53+
'import/no-duplicates': off
54+
'import/no-extraneous-dependencies': off
55+
'@typescript-eslint/unbound-method': off
56+
'@typescript-eslint/no-floating-promises': off
57+
'@typescript-eslint/no-unused-vars': off
58+
'@typescript-eslint/array-type': off
59+
'@typescript-eslint/prefer-optional-chain': off
60+
'@typescript-eslint/no-base-to-string': off
61+
'@typescript-eslint/no-misused-promises': off
62+
'@typescript-eslint/consistent-type-definitions': off
63+
'@typescript-eslint/prefer-nullish-coalescing': off
64+
65+
# FIXME: blocked by improper type checking should be fixed
66+
# after we switch TSC in strict mode
67+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': off
68+
'@typescript-eslint/no-explicit-any': off
69+
'@typescript-eslint/dot-notation': off
70+
'@typescript-eslint/no-dynamic-delete': off
71+
'@typescript-eslint/restrict-plus-operands': off
72+
'@typescript-eslint/no-unsafe-call': off
73+
'@typescript-eslint/no-unsafe-return': off
74+
'@typescript-eslint/no-unsafe-argument': off
75+
'@typescript-eslint/no-unsafe-assignment': off
76+
'@typescript-eslint/no-unsafe-member-access': off
77+
'@typescript-eslint/no-unnecessary-condition': off
78+
'@typescript-eslint/restrict-template-expressions': off

0 commit comments

Comments
 (0)