-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.js
More file actions
122 lines (119 loc) · 3.71 KB
/
Copy pathcore.js
File metadata and controls
122 lines (119 loc) · 3.71 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import { defineConfig } from 'oxlint';
/**
* Core rules shared across all presets.
*
* Only includes non-formatting rules that oxlint supports.
* Formatting rules (spacing, semicolons, indentation, etc.) are intentionally
* omitted — use oxfmt for those.
*
* Rules not available in oxlint are documented in the README.
*/
export default defineConfig({
plugins: ['import', 'node'],
env: { es2024: true, jest: true },
globals: {
console: 'readonly',
exports: 'readonly',
global: 'readonly',
module: 'readonly',
require: 'readonly',
},
rules: {
curly: ['warn', 'all'],
'constructor-super': 'warn',
eqeqeq: ['warn', 'smart'],
'getter-return': 'warn',
'no-alert': 'off',
'no-array-constructor': 'warn',
'no-caller': 'warn',
'no-case-declarations': 'warn',
'no-compare-neg-zero': 'warn',
'no-cond-assign': 'warn',
'no-const-assign': 'error',
'no-constant-condition': ['warn', { checkLoops: false }],
'no-control-regex': 'off',
'no-debugger': 'warn',
'no-delete-var': 'error',
'no-dupe-class-members': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty-character-class': 'warn',
'no-empty-pattern': 'warn',
'no-eval': 'warn',
'no-ex-assign': 'warn',
'no-extend-native': 'warn',
'no-extra-bind': 'warn',
'no-extra-boolean-cast': 'warn',
'no-fallthrough': 'warn',
'no-func-assign': 'error',
'no-global-assign': 'warn',
'no-inner-declarations': 'warn',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'warn',
'no-iterator': 'warn',
'no-label-var': 'warn',
'no-labels': ['warn', { allowLoop: true, allowSwitch: true }],
'no-lone-blocks': 'warn',
'no-multi-assign': 'warn',
'no-new': 'warn',
'no-new-func': 'warn',
'no-new-native-nonconstructor': 'warn',
'no-object-constructor': 'warn',
'no-obj-calls': 'warn',
'no-proto': 'warn',
'no-redeclare': 'warn',
'no-return-assign': 'warn',
'no-script-url': 'warn',
'no-self-assign': 'warn',
'no-self-compare': 'warn',
'no-sequences': 'warn',
'no-shadow-restricted-names': 'warn',
'no-sparse-arrays': 'warn',
'no-this-before-super': 'warn',
'no-throw-literal': 'warn',
'no-undef': 'error',
'no-unexpected-multiline': 'warn',
'no-unneeded-ternary': 'warn',
'no-unreachable': 'warn',
'no-unsafe-negation': 'warn',
'no-unused-expressions': ['warn', { allowShortCircuit: true, enforceForJSX: true }],
'no-unused-labels': 'warn',
'no-unused-vars': [
'warn',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: true,
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
},
],
'no-useless-computed-key': 'warn',
'no-useless-concat': 'warn',
'no-useless-constructor': 'warn',
'no-useless-escape': 'warn',
'no-useless-rename': 'warn',
'no-useless-return': 'warn',
'no-var': 'warn',
'no-void': 'warn',
'no-with': 'warn',
'object-shorthand': 'warn',
'prefer-const': ['warn', { destructuring: 'all', ignoreReadBeforeAssign: true }],
'prefer-promise-reject-errors': 'warn',
'prefer-rest-params': 'warn',
'prefer-spread': 'warn',
radix: 'warn',
'unicode-bom': ['warn', 'never'],
'use-isnan': 'error',
'valid-typeof': 'error',
yoda: ['warn', 'never', { exceptRange: true }],
'import/default': 'off',
'import/export': 'error',
'import/first': 'warn',
'import/namespace': ['error', { allowComputed: true }],
'import/no-duplicates': 'error',
// import/order is not supported by oxlint — see README
'node/handle-callback-err': ['warn', '^(e|err|error|.+Error)$'],
'node/no-new-require': 'warn',
},
});