|
1 | 1 | { |
2 | 2 | "$schema": "./node_modules/oxlint/configuration_schema.json", |
3 | | - "plugins": ["typescript", "import", "jsdoc", "vitest"], |
| 3 | + "extends": ["./.oxlintrc.base.json"], |
| 4 | + "options": { |
| 5 | + "typeAware": true |
| 6 | + }, |
4 | 7 | "jsPlugins": [ |
5 | 8 | { |
6 | 9 | "name": "sdk", |
|
9 | 12 | ], |
10 | 13 | "categories": {}, |
11 | 14 | "rules": { |
12 | | - "no-unused-vars": [ |
13 | | - "warn", |
14 | | - { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" } |
15 | | - ], |
16 | | - |
17 | | - // === Base rules from eslint-config-sdk/base.js === |
18 | | - "no-console": "error", |
19 | | - "no-alert": "error", |
20 | | - "no-param-reassign": "error", |
21 | | - "prefer-template": "error", |
22 | | - "no-bitwise": "error", |
23 | | - "complexity": ["error", { "max": 33 }], |
24 | | - "no-unused-expressions": ["error", { "allowShortCircuit": true }], |
25 | | - "guard-for-in": "error", |
26 | | - "array-callback-return": ["error", { "allowImplicit": true }], |
27 | | - "quotes": ["error", "single", { "avoidEscape": true }], |
28 | | - "no-return-await": "error", |
29 | | - "max-lines": ["error", { "max": 300, "skipComments": true, "skipBlankLines": true }], |
30 | | - |
31 | | - // === Import rules === |
32 | | - "import/namespace": "off", |
33 | | - "import/no-unresolved": "off", |
34 | | - |
35 | | - // === Rules turned off (not enforced in ESLint or causing false positives) === |
36 | | - "no-control-regex": "off", |
37 | | - "jsdoc/check-tag-names": "off", |
38 | | - "jsdoc/require-yields": "off", |
39 | | - "no-useless-rename": "off", |
40 | | - "no-constant-binary-expression": "off", |
41 | | - "vitest/hoisted-apis-on-top": "off", |
42 | | - "vitest/no-conditional-tests": "off", |
43 | | - "no-unsafe-optional-chaining": "off", |
44 | | - "no-eval": "off", |
45 | | - "no-import-assign": "off", |
46 | | - "typescript/no-duplicate-type-constituents": "off", |
47 | | - |
48 | | - // === Custom SDK rules (via JS plugin) === |
49 | 15 | "sdk/no-eq-empty": "error" |
50 | 16 | }, |
51 | 17 | "overrides": [ |
52 | | - { |
53 | | - "files": ["**/*.ts", "**/*.tsx", "**/*.d.ts"], |
54 | | - "rules": { |
55 | | - "typescript/ban-ts-comment": "error", |
56 | | - "typescript/consistent-type-imports": "error", |
57 | | - "typescript/no-unnecessary-type-assertion": "error", |
58 | | - "typescript/prefer-for-of": "error", |
59 | | - "typescript/no-floating-promises": ["error", { "ignoreVoid": true }], |
60 | | - "typescript/no-dynamic-delete": "error", |
61 | | - "typescript/no-unsafe-member-access": "error", |
62 | | - "typescript/unbound-method": "error", |
63 | | - "typescript/no-explicit-any": "error", |
64 | | - "typescript/no-empty-function": "off", |
65 | | - "typescript/prefer-optional-chain": ["error"], |
66 | | - "typescript/no-redundant-type-constituents": "off", |
67 | | - "typescript/restrict-template-expressions": "off", |
68 | | - "typescript/await-thenable": "warn", |
69 | | - "typescript/no-base-to-string": "off" |
70 | | - } |
71 | | - }, |
72 | | - { |
73 | | - "files": ["**/*.js", "**/*.mjs", "**/*.cjs"], |
74 | | - "rules": { |
75 | | - "typescript/ban-ts-comment": "off", |
76 | | - "typescript/consistent-type-imports": "off", |
77 | | - "typescript/prefer-optional-chain": "off", |
78 | | - "typescript/no-unnecessary-type-assertion": "off", |
79 | | - "typescript/prefer-for-of": "off", |
80 | | - "typescript/no-floating-promises": "off", |
81 | | - "typescript/no-dynamic-delete": "off", |
82 | | - "typescript/no-unsafe-member-access": "off", |
83 | | - "typescript/unbound-method": "off", |
84 | | - "typescript/no-explicit-any": "off" |
85 | | - } |
86 | | - }, |
87 | | - { |
88 | | - "files": [ |
89 | | - "**/*.test.ts", |
90 | | - "**/*.test.tsx", |
91 | | - "**/*.test.js", |
92 | | - "**/*.test.jsx", |
93 | | - "**/test/**", |
94 | | - "**/tests/**", |
95 | | - "**/suites/**", |
96 | | - "**/loader-suites/**" |
97 | | - ], |
98 | | - "rules": { |
99 | | - "typescript/explicit-function-return-type": "off", |
100 | | - "no-unused-expressions": "off", |
101 | | - "typescript/no-unused-expressions": "off", |
102 | | - "typescript/no-unnecessary-type-assertion": "off", |
103 | | - "typescript/no-unsafe-member-access": "off", |
104 | | - "typescript/no-explicit-any": "off", |
105 | | - "typescript/no-non-null-assertion": "off", |
106 | | - "typescript/no-floating-promises": "off", |
107 | | - "typescript/unbound-method": "off", |
108 | | - "max-lines": "off", |
109 | | - "complexity": "off", |
110 | | - "typescript/prefer-optional-chain": "off", |
111 | | - "typescript/no-misused-spread": "off", |
112 | | - "typescript/require-array-sort-compare": "off", |
113 | | - "typescript/no-base-to-string": "off", |
114 | | - "typescript/await-thenable": "off" |
115 | | - } |
116 | | - }, |
117 | | - { |
118 | | - "files": ["*.tsx"], |
119 | | - "rules": { |
120 | | - "jsdoc/require-jsdoc": "off" |
121 | | - } |
122 | | - }, |
123 | | - { |
124 | | - "files": ["*.config.js", "*.config.mjs", "*.config.ts", "vite.config.ts", ".size-limit.js"], |
125 | | - "rules": { |
126 | | - "no-console": "off", |
127 | | - "max-lines": "off" |
128 | | - } |
129 | | - }, |
130 | | - { |
131 | | - "files": [ |
132 | | - "**/scenarios/**", |
133 | | - "**/rollup-utils/**", |
134 | | - "**/bundle-analyzer-scenarios/**", |
135 | | - "**/bundle-analyzer-scenarios/*.cjs", |
136 | | - "**/bundle-analyzer-scenarios/*.js" |
137 | | - ], |
138 | | - "rules": { |
139 | | - "no-console": "off" |
140 | | - } |
141 | | - }, |
142 | 18 | { |
143 | 19 | "files": ["**/src/**"], |
144 | 20 | "rules": { |
145 | | - "no-restricted-globals": ["error", "window", "document", "location", "navigator"], |
146 | 21 | "sdk/no-class-field-initializers": "error", |
147 | 22 | "sdk/no-regexp-constructor": "error" |
148 | 23 | } |
|
0 commit comments