Repository navigation
Expand file tree
/
Copy pathoxlint.config.mts
More file actions
61 lines (59 loc) · 1.61 KB
/
Copy pathoxlint.config.mts
File metadata and controls
61 lines (59 loc) · 1.61 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
import {defineConfig} from 'oxlint';
import {loadDefaultSettings} from './src/utility.mjs';
// Emscripten settings are made available to the compiler as global
// variables. Make sure oxlint knows about them.
const settings = loadDefaultSettings();
const settingsGlobals: Record<string, 'writable'> = {};
for (const name of Object.keys(settings)) {
settingsGlobals[name] = 'writable';
}
export default defineConfig({
plugins: ['typescript', 'oxc', 'unicorn', 'node', 'import', 'promise'],
categories: {
correctness: 'error',
perf: 'error',
},
env: {
browser: true,
node: true,
},
globals: settingsGlobals,
ignorePatterns: [
'**/*.js',
'**/*.cjs',
'src/pthread_esm_startup.mjs',
'**/out/',
'**/dist/',
'**/site/',
'**/cache/',
'**/third_party/',
'**/test/',
'tools/experimental/',
],
rules: {
'arrow-body-style': ['error', 'as-needed'],
'prefer-object-has-own': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-object-spread': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'logical-assignment-operators': ['error', 'always'],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'no-unexpected-multiline': 'error',
'no-case-declarations': 'error',
'no-empty': 'error',
'no-fallthrough': 'error',
'no-prototype-builtins': 'error',
'no-redeclare': 'error',
'no-regex-spaces': 'error',
'no-undef': 'error',
'no-useless-assignment': 'error',
'preserve-caught-error': 'error',
},
});