Repository navigation
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
87 lines (84 loc) · 2.51 KB
/
Copy pathoxlint.config.ts
File metadata and controls
87 lines (84 loc) · 2.51 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
import { defineConfig } from 'oxlint';
export default defineConfig({
plugins: ['eslint', 'typescript', 'oxc', 'unicorn', 'import', 'promise', 'vue', 'vitest'],
categories: {
correctness: 'error',
},
// Type-aware rules run through oxlint-tsgolint, which ships its own checker
// binary, so this does not depend on the project's TypeScript version.
// Note it only analyses .ts files -- .vue script blocks are covered by
// `pnpm typecheck` (vue-tsc) instead.
options: {
typeAware: true,
},
env: {
browser: true,
es2026: true,
},
globals: {
process: 'readonly',
},
ignorePatterns: [
'src/libs/**',
'dist/**',
'coverage/**',
'auto-imports.d.ts',
'components.d.ts',
],
rules: {
'eslint/curly': ['error', 'all'],
'typescript/no-use-before-define': [
'error',
{ allowNamedExports: true, functions: false },
],
'eslint/no-restricted-imports': [
'error',
{
paths: [
{
name: '@vueuse/core',
importNames: ['useClipboard'],
message: 'Please use local useCopy from src/composable/copy.ts instead of useClipboard.',
},
],
},
],
'no-undef': 'off',
'eslint/no-unused-vars': [
'error',
{ caughtErrors: 'none', varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
'eslint/no-useless-escape': 'off',
// Staged as warnings while the existing findings are worked through, so
// they surface without failing the build. Promote to "error" per rule as
// each one reaches zero.
'typescript/await-thenable': 'warn',
'typescript/no-base-to-string': 'warn',
'typescript/no-duplicate-type-constituents': 'warn',
'typescript/no-floating-promises': 'warn',
'typescript/no-for-in-array': 'warn',
'typescript/no-misused-spread': 'warn',
'typescript/no-redundant-type-constituents': 'warn',
'typescript/no-useless-default-assignment': 'warn',
'typescript/restrict-template-expressions': 'warn',
'typescript/unbound-method': 'warn',
'import/default': 'off',
'vue/no-dupe-keys': 'off',
'vitest/valid-expect': 'off',
'vitest/expect-expect': 'off',
'vitest/require-to-throw-message': 'off',
},
overrides: [
{
files: ['**/*.test.ts', '**/*.spec.ts', '**/*.e2e.spec.ts'],
env: { vitest: true },
},
{
files: ['**/calendar-converter/calendar-converter.service.ts'],
rules: {
'eslint/no-unused-vars': 'off',
'oxc/erasing-op': 'off',
},
},
],
});