Skip to content

Commit 0bbd4b3

Browse files
committed
Modify ESLint setup
1 parent 0ab1598 commit 0bbd4b3

File tree

3 files changed

+71
-372
lines changed

3 files changed

+71
-372
lines changed

.eslintrc.cjs

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@ module.exports = {
33
parser: '@typescript-eslint/parser',
44
parserOptions: {
55
sourceType: 'module',
6-
ecmaVersion: 2020,
6+
ecmaVersion: 'latest',
77
project: './tsconfig.json',
88
extraFileExtensions: ['.svelte'],
99
},
10+
env: {
11+
browser: true,
12+
es2017: true,
13+
node: true,
14+
},
1015
plugins: [
11-
'@typescript-eslint',
16+
'import',
1217
'import-no-duplicates-prefix-resolved-path',
13-
'prettier',
18+
'simple-import-sort',
19+
'@typescript-eslint',
1420
],
1521
extends: [
1622
'eslint:recommended',
1723
'plugin:@typescript-eslint/recommended',
18-
'plugin:prettier/recommended',
24+
'plugin:@typescript-eslint/strict-type-checked',
25+
'plugin:@typescript-eslint/stylistic-type-checked',
26+
'prettier',
1927
],
20-
env: {
21-
browser: true,
22-
es2017: true,
23-
node: true,
24-
},
2528
settings: {
2629
'import/parsers': {
2730
'@typescript-eslint/parser': ['.cjs', '.js', '.ts'],
@@ -33,10 +36,20 @@ module.exports = {
3336
},
3437
},
3538
rules: {
36-
'prettier/prettier': 'error',
3739
'no-unused-vars': 'off',
3840
// Useful for triggering Svelte reactivity
3941
'no-self-assign': 'off',
42+
'simple-import-sort/imports': 'error',
43+
'simple-import-sort/exports': 'error',
44+
'import/first': 'error',
45+
'import/newline-after-import': 'error',
46+
'import/no-duplicates': 'off',
47+
'import-no-duplicates-prefix-resolved-path/no-duplicates': [
48+
'error',
49+
{
50+
prefixResolvedPathWithImportName: true,
51+
},
52+
],
4053
'@typescript-eslint/no-unused-vars': [
4154
'error',
4255
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
@@ -50,6 +63,18 @@ module.exports = {
5063
'@typescript-eslint/explicit-function-return-type': 'off',
5164
'@typescript-eslint/explicit-module-boundary-types': 'off',
5265
'@typescript-eslint/no-namespace': 'off',
66+
'@typescript-eslint/consistent-indexed-object-style': 'off',
67+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
68+
'@typescript-eslint/no-unsafe-member-access': 'off',
69+
'@typescript-eslint/no-unsafe-argument': 'off',
70+
'@typescript-eslint/no-unsafe-assignment': 'off',
71+
'@typescript-eslint/no-throw-literal': 'off',
72+
'@typescript-eslint/unbound-method': 'off',
73+
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
74+
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
75+
'@typescript-eslint/no-confusing-void-expression': 'off',
76+
'@typescript-eslint/no-unnecessary-condition': 'off',
77+
'@typescript-eslint/no-extraneous-class': 'off',
5378
},
5479
overrides: [
5580
{
@@ -61,12 +86,27 @@ module.exports = {
6186
extends: ['plugin:svelte/recommended', 'plugin:svelte/prettier'],
6287
rules: {},
6388
},
89+
{
90+
files: ['./scripts/testing/load/tests/**/*.js'],
91+
rules: {
92+
'import/no-unresolved': 'off',
93+
'@typescript-eslint/no-unsafe-assignment': 'off',
94+
'@typescript-eslint/no-unsafe-call': 'off',
95+
'@typescript-eslint/no-unsafe-member-access': 'off',
96+
},
97+
},
6498
{
6599
files: ['**/*.cjs', '**/*.js'],
66100
rules: {
67101
'@typescript-eslint/no-var-requires': 'off',
68102
},
69103
},
104+
{
105+
files: ['src/**/*.{node-test,dom-test}.ts'],
106+
rules: {
107+
'@typescript-eslint/require-await': 'off',
108+
},
109+
},
70110
{
71111
// No `.spec.{js,ts}` files, because those are for server unit tests
72112
files: ['src/**/*.{test,browser-test}.{js,ts}'],

0 commit comments

Comments
 (0)