Skip to content

Commit f3820af

Browse files
Copilotfengmk2
andcommitted
feat: use @eggjs/oxlint-config extends .oxlintrc.json
Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com>
1 parent 9a5ad11 commit f3820af

1 file changed

Lines changed: 2 additions & 132 deletions

File tree

.oxlintrc.json

Lines changed: 2 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,12 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"extends": ["./node_modules/@eggjs/oxlint-config/.oxlintrc.json"],
34
"env": {
45
"node": true,
56
"mocha": true
67
},
7-
"categories": {
8-
"correctness": "error",
9-
"perf": "error",
10-
"nursery": "error",
11-
"restriction": "error",
12-
"style": "error",
13-
"pedantic": "error",
14-
"suspicious": "error"
15-
},
16-
"plugins": [
17-
"import",
18-
"typescript",
19-
"unicorn",
20-
"jsdoc",
21-
"node",
22-
"promise",
23-
"oxc"
24-
],
258
"rules": {
26-
// eslint
27-
"constructor-super": "error",
28-
"getter-return": "error",
29-
"no-undef": "error",
30-
"no-unreachable": "error",
31-
"no-var": "error",
32-
"no-eq-null": "error",
33-
"no-await-in-loop": "allow",
34-
"eqeqeq": ["error", "smart"],
35-
"init-declarations": "allow",
36-
"curly": "allow",
37-
"no-ternary": "allow",
38-
"max-params": ["error", 5],
39-
"no-await-expression-member": "error",
40-
"no-continue": "allow",
41-
"guard-for-in": "allow",
42-
"func-style": "allow",
43-
"sort-imports": "allow",
44-
"yoda": "allow",
45-
"sort-keys": "allow",
46-
"no-magic-numbers": "allow",
47-
"no-duplicate-imports": "error",
48-
"no-multi-assign": "error",
49-
"func-names": "error",
50-
"default-param-last": "error",
51-
"prefer-object-spread": "error",
52-
"no-undefined": "allow",
53-
"no-plusplus": "allow",
54-
"no-console": "allow",
55-
"no-extraneous-class": "allow",
56-
"no-empty-function": "allow",
57-
"max-depth": ["error", 6],
58-
"max-lines-per-function": "allow",
59-
"no-lonely-if": "error",
60-
"max-lines": "allow",
61-
"require-await": "allow",
62-
"max-nested-callbacks": ["error", 5],
63-
"max-classes-per-file": "allow",
64-
"radix": "allow",
65-
"no-negated-condition": "error",
66-
"no-else-return": "error",
67-
"no-throw-literal": "error",
68-
69-
// import
70-
"import/exports-last": "allow",
71-
"import/max-dependencies": "allow",
72-
"import/no-cycle": "error",
73-
"import/no-anonymous-default-export": "allow",
74-
"import/no-namespace": "error",
75-
"import/named": "error",
76-
"import/export": "error",
77-
"import/no-default-export": "allow",
78-
"import/unambiguous": "error",
79-
"import/group-exports": "allow",
80-
81-
// promise
82-
"promise/no-return-wrap": "error",
83-
"promise/param-names": "error",
84-
"promise/prefer-await-to-callbacks": "error",
85-
"promise/prefer-await-to-then": "error",
86-
"promise/prefer-catch": "error",
87-
"promise/no-return-in-finally": "error",
88-
"promise/avoid-new": "error",
89-
90-
// unicorn
91-
"unicorn/error-message": "error",
92-
"unicorn/no-null": "allow",
93-
"unicorn/filename-case": "allow",
94-
"unicorn/prefer-structured-clone": "error",
95-
"unicorn/prefer-logical-operator-over-ternary": "error",
96-
"unicorn/prefer-number-properties": "error",
97-
"unicorn/prefer-array-some": "error",
98-
"unicorn/prefer-string-slice": "error",
99-
// "unicorn/no-null": "error",
100-
"unicorn/throw-new-error": "error",
101-
"unicorn/catch-error-name": "allow",
102-
"unicorn/prefer-spread": "allow",
103-
"unicorn/numeric-separators-style": "error",
104-
"unicorn/prefer-string-raw": "error",
105-
"unicorn/text-encoding-identifier-case": "error",
106-
"unicorn/no-array-for-each": "error",
107-
"unicorn/explicit-length-check": "error",
108-
"unicorn/no-lonely-if": "error",
109-
"unicorn/no-useless-undefined": "allow",
110-
"unicorn/prefer-date-now": "error",
111-
"unicorn/no-static-only-class": "allow",
112-
"unicorn/no-typeof-undefined": "error",
113-
"unicorn/prefer-negative-index": "error",
114-
"unicorn/no-anonymous-default-export": "allow",
115-
116-
// oxc
117-
"oxc/no-map-spread": "error",
118-
"oxc/no-rest-spread-properties": "allow",
119-
"oxc/no-optional-chaining": "allow",
120-
"oxc/no-async-await": "allow",
121-
122-
// typescript
123-
"typescript/explicit-function-return-type": "allow",
124-
"typescript/consistent-type-imports": "error",
125-
"typescript/consistent-type-definitions": "error",
126-
"typescript/consistent-indexed-object-style": "allow",
127-
"typescript/no-inferrable-types": "error",
128-
"typescript/array-type": "error",
129-
"typescript/no-non-null-assertion": "error",
130-
"typescript/no-explicit-any": "error",
131-
"typescript/no-import-type-side-effects": "error",
132-
"typescript/no-dynamic-delete": "error",
133-
"typescript/prefer-ts-expect-error": "error",
134-
"typescript/ban-ts-comment": "error",
135-
"typescript/prefer-enum-initializers": "error",
136-
137-
// jsdoc
138-
"jsdoc/require-returns": "allow",
139-
"jsdoc/require-param": "allow"
9+
"no-empty-function": "allow"
14010
},
14111
"ignorePatterns": ["index.d.ts", "test/fixtures/**", "__snapshots__"]
14212
}

0 commit comments

Comments
 (0)