-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
78 lines (77 loc) · 2.49 KB
/
eslint.config.mjs
File metadata and controls
78 lines (77 loc) · 2.49 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import nodePlugin from 'eslint-plugin-n';
import securityPlugin from 'eslint-plugin-security';
import sonarjs from 'eslint-plugin-sonarjs';
import globals from 'globals';
export default tseslint.config(
{
ignores: [
'node_modules/**',
'coverage/**',
'public/**',
'build/**',
'JaMmusic/**',
'vitest.config.ts',
'**/*.json',
'.claude/**',
'scripts/**',
'eslint.config.mjs',
],
},
js.configs.recommended,
nodePlugin.configs['flat/recommended-module'],
securityPlugin.configs.recommended,
sonarjs.configs.recommended,
{
files: ['**/*.ts'],
extends: [...tseslint.configs.recommendedTypeChecked],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node,
vi: 'readonly',
describe: 'readonly',
it: 'readonly',
expect: 'readonly',
beforeAll: 'readonly',
beforeEach: 'readonly',
afterAll: 'readonly',
afterEach: 'readonly',
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'@typescript-eslint/no-floating-promises': ['error', { ignoreIIFE: true }],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'n/no-unsupported-features/es-syntax': 'off',
'n/no-missing-import': 'off',
'no-underscore-dangle': 'off',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
'one-var': ['error', { var: 'never', let: 'always', const: 'never' }],
'max-len': ['error', { code: 150 }],
},
},
{
// Test-only override: deeply-nested arrow chains are the clearest way to
// build mock factories (e.g. socketcluster's receiver/consumer/next chain),
// and refactoring them into named helpers reduces readability rather than
// improving it. Keep the rule active for src/.
files: ['test/**/*.ts'],
rules: {
'sonarjs/no-nested-functions': 'off',
},
},
);