-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
80 lines (79 loc) · 2.31 KB
/
Copy pathoxlint.config.ts
File metadata and controls
80 lines (79 loc) · 2.31 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
import { defineConfig } from 'oxlint';
export default defineConfig({
options: {
typeAware: true,
},
plugins: ['react', 'jsx-a11y', 'typescript', 'import', 'unicorn', 'oxc', 'vitest', 'promise'],
categories: {
correctness: 'error',
suspicious: 'warn',
perf: 'warn',
style: 'off',
},
env: {
browser: true,
builtin: true,
},
rules: {
'import/no-unassigned-import': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'react/react-in-jsx-scope': 'off',
'react/jsx-filename-extension': ['error', { extensions: ['.tsx', '.jsx'] }],
'react/rules-of-hooks': 'error',
'react/exhaustive-deps': 'error',
'react/iframe-missing-sandbox': 'off',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/prefer-tag-over-role': 'off',
'typescript/no-explicit-any': 'error',
'typescript/consistent-type-imports': 'error',
'typescript/only-throw-error': 'error',
'typescript/no-unsafe-type-assertion': 'off',
'typescript/no-floating-promises': 'off',
'typescript/no-unnecessary-type-arguments': 'off',
// Maybe reconsider this in the future, but it causes a lot of cascading issues
// because of types we use that don't exist in the matrix-js-sdk
'typescript/no-unnecessary-type-assertion': 'off',
'oxc/no-map-spread': 'off',
'promise/always-return': 'off',
'no-underscore-dangle': [
'warn',
{
allow: [
'_fetched',
'__dirname',
'__WB_MANIFEST',
'_unstable_sendDelayedEvent',
'_unstable_getDelayedEvents',
'_unstable_updateDelayedEvent',
'_unstable_sendDelayedStateEvent',
'_unstable_getSharedRooms',
],
},
],
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
rules: {
'typescript/no-unused-vars': [
'error',
{
args: 'after-used',
ignoreRestSiblings: true,
vars: 'all',
},
],
'typescript/no-shadow': 'error',
},
},
{
files: ['**/*.test.ts', '**/*.test.tsx'],
rules: {
'typescript/unbound-method': 'off',
'typescript/no-unsafe-enum-comparison': 'off',
},
},
],
});