-
-
Notifications
You must be signed in to change notification settings - Fork 458
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
109 lines (108 loc) · 3.22 KB
/
Copy pathoxlint.config.ts
File metadata and controls
109 lines (108 loc) · 3.22 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
import e18e from '@e18e/eslint-plugin';
import { defineConfig } from 'oxlint';
export default defineConfig({
plugins: ['typescript', 'import'],
jsPlugins: ['@e18e/eslint-plugin'],
categories: {
correctness: 'error',
},
rules: {
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
'no-console': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'no-param-reassign': 'off',
'dot-notation': 'off',
'array-callback-return': 'off',
...e18e.configs.recommended.rules,
'e18e/prefer-array-at': 'off',
'e18e/prefer-spread-syntax': 'off',
'e18e/prefer-static-regex': 'off',
'e18e/no-delete-property': 'error',
'e18e/no-spread-in-reduce': 'error',
'e18e/prefer-charcode-at-in-loop': 'error',
'e18e/prefer-exponentiation-operator': 'error',
'e18e/prefer-flatmap-over-map-flat': 'error',
'e18e/prefer-includes-over-regex-test': 'error',
'e18e/prefer-inline-equality': 'error',
'e18e/prefer-slice-over-split-index': 'error',
'e18e/prefer-static-collator': 'error',
'e18e/prefer-throw-if-no-entry': 'error',
},
ignorePatterns: ['**/dist', '**/tmp', '**/vendor', 'packages/docs/.astro', '.vscode', 'templates'],
overrides: [
{
files: ['**/*.astro'],
rules: { 'no-unused-vars': 'off' },
},
{
files: ['packages/knip/**'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'node:path',
message: 'Please use src/util/path.js instead.',
},
{
name: 'path',
message: 'Please use src/util/path.js instead.',
},
{
name: 'node:assert',
message: 'Please use node:assert/strict instead.',
},
],
},
],
'import/extensions': ['error', 'always', { ignorePackages: true }],
},
},
{
files: ['packages/docs/**', 'packages/create-config/**'],
rules: { 'no-restricted-imports': 'off', 'no-console': 'off' },
},
{
files: ['packages/language-server/**'],
rules: { 'no-console': 'off' },
},
{
files: [
'packages/knip/src/reporters/**',
'packages/knip/scripts/**',
'packages/vscode-knip/scripts/**',
'packages/vscode-knip/test/**',
],
rules: { 'no-console': 'off' },
},
{
files: ['packages/vscode-knip/scripts/publish.js'],
rules: { 'e18e/no-delete-property': 'off' },
},
{
files: ['packages/knip/fixtures/**'],
rules: {
'e18e/ban-dependencies': 'off',
'e18e/prefer-array-from-map': 'off',
'e18e/prefer-includes': 'off',
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'no-console': 'off',
'no-duplicate-enum-values': 'off',
'no-restricted-imports': 'off',
'triple-slash-reference': 'off',
'import/namespace': 'off',
'import/extensions': 'off',
},
},
],
});