-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
84 lines (75 loc) · 2.41 KB
/
eslint.config.js
File metadata and controls
84 lines (75 loc) · 2.41 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
79
80
81
82
83
84
import globals from 'globals';
import typescriptParser from '@typescript-eslint/parser';
import tseslint from 'typescript-eslint';
import authressConfig from '@authress/eslint-config/lib/index.js';
import importPlugin from 'eslint-plugin-import';
const globalVariables = {
...globals.browser,
...globals.es2021,
fetch: 'readonly'
};
// Fix lint problem, this key has an issue, so just delete it
delete globalVariables['AudioWorkletGlobalScope '];
export default [
...tseslint.configs.recommended,
...authressConfig,
// 1. Global ignores
{
ignores: ['node_modules/']
},
{
// Configuration object for JavaScript files
files: ['make.js', '**/*.js', '**/*.ts'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
requireConfigFile: false
},
globals: globalVariables
},
settings: {
"import/resolver": {
node: true
}
},
plugins: {
import: importPlugin
},
rules: {
// Your custom rules go here
'arrow-parens': ['error', 'as-needed'],
'indent': ['error', 2, { SwitchCase: 1, MemberExpression: 'off' }],
'node/no-unsupported-features/es-syntax': 'off',
'no-throw-literal': 'off',
'spaced-comment': 'off',
'no-continue': 'off',
'require-atomic-updates': 'off',
'no-constant-condition': ['error', { checkLoops: false }],
'quotes': 'off',
'n/no-unpublished-import': ['error'],
'n/no-unsupported-features/node-builtins': 'off',
'@typescript-eslint/no-unused-vars': ['error', { 'caughtErrorsIgnorePattern': '^_+$', 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_' }],
'no-unused-vars': ['error', { 'caughtErrorsIgnorePattern': '^_+$', 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_' }],
'no-underscore-dangle': ['error', { allowAfterThis: true, allowAfterThisConstructor: true, allow: ['_unsafeUnwrap', '_unsafeUnwrapErr'] }],
}
},
// TypeScript files: disable no-undef since TypeScript's type checker handles it
{
files: ['**/*.ts'],
rules: {
'no-undef': 'off',
'no-duplicate-imports': 'off'
}
},
// 4. Your specific override for test files and scripts
{
files: ['make.js', 'tests/**'],
rules: {
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'require-await': 'off',
'no-new': 'off'
}
}
];