@apst/oxlint 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -34
- package/dist/presets/common/index.d.ts +2 -2
- package/dist/presets/common/index.js +1 -0
- package/dist/presets/common/index.mjs +2 -2
- package/dist/presets/common/rules/eslint.d.ts +8 -4
- package/dist/presets/common/rules/eslint.js +4 -4
- package/dist/presets/common/rules/eslint.js.map +1 -1
- package/dist/presets/common/rules/eslint.mjs +4 -4
- package/dist/presets/common/rules/eslint.mjs.map +1 -1
- package/dist/presets/common/rules/import.d.ts +10 -0
- package/dist/presets/common/rules/import.js +5 -0
- package/dist/presets/common/rules/import.js.map +1 -1
- package/dist/presets/common/rules/import.mjs +5 -0
- package/dist/presets/common/rules/import.mjs.map +1 -1
- package/dist/presets/common/rules/typescript.d.ts +56 -42
- package/dist/presets/common/rules/typescript.js +19 -14
- package/dist/presets/common/rules/typescript.js.map +1 -1
- package/dist/presets/common/rules/typescript.mjs +19 -14
- package/dist/presets/common/rules/typescript.mjs.map +1 -1
- package/dist/presets/common/rules/unicorn.d.ts +11 -1
- package/dist/presets/common/rules/unicorn.js +6 -0
- package/dist/presets/common/rules/unicorn.js.map +1 -1
- package/dist/presets/common/rules/unicorn.mjs +6 -1
- package/dist/presets/common/rules/unicorn.mjs.map +1 -1
- package/dist/presets/jsx/rules/jsx-a11y.d.ts +16 -0
- package/dist/presets/jsx/rules/jsx-a11y.js +15 -0
- package/dist/presets/jsx/rules/jsx-a11y.js.map +1 -1
- package/dist/presets/jsx/rules/jsx-a11y.mjs +15 -0
- package/dist/presets/jsx/rules/jsx-a11y.mjs.map +1 -1
- package/dist/presets/next/rules/nextjs.js +1 -0
- package/dist/presets/next/rules/nextjs.js.map +1 -1
- package/dist/presets/next/rules/nextjs.mjs +1 -0
- package/dist/presets/next/rules/nextjs.mjs.map +1 -1
- package/dist/presets/react/rules/react.d.ts +17 -0
- package/dist/presets/react/rules/react.js +7 -2
- package/dist/presets/react/rules/react.js.map +1 -1
- package/dist/presets/react/rules/react.mjs +7 -2
- package/dist/presets/react/rules/react.mjs.map +1 -1
- package/dist/presets/vitest/rules/vitest.d.ts +4 -0
- package/dist/presets/vitest/rules/vitest.js +3 -1
- package/dist/presets/vitest/rules/vitest.js.map +1 -1
- package/dist/presets/vitest/rules/vitest.mjs +3 -1
- package/dist/presets/vitest/rules/vitest.mjs.map +1 -1
- package/package.json +11 -41
package/README.md
CHANGED
|
@@ -2,40 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A shareable Oxlint configuration.
|
|
4
4
|
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
Implement the preset into `oxlint.config.ts`:
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import { defineConfig } from "@apst/oxlint";
|
|
11
|
-
import { commonPreset } from "@apst/oxlint/presets/common";
|
|
12
|
-
import { reactPreset } from "@apst/oxlint/presets/react";
|
|
13
|
-
|
|
14
|
-
export default defineConfig([
|
|
15
|
-
commonPreset(),
|
|
16
|
-
reactPreset(),
|
|
17
|
-
]);
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
It is possible to override the default configuration by passing an object to the `defineConfig` function:
|
|
21
|
-
|
|
22
|
-
```ts
|
|
23
|
-
import { defineConfig } from "@apst/oxlint";
|
|
24
|
-
import { IGNORE_PATTERNS_DEFAULT } from "@apst/oxlint/constants/ignore-patterns";
|
|
25
|
-
import { commonPreset } from "@apst/oxlint/presets/common";
|
|
26
|
-
import { reactPreset } from "@apst/oxlint/presets/react";
|
|
27
|
-
|
|
28
|
-
export default defineConfig({
|
|
29
|
-
ignorePatterns: [
|
|
30
|
-
...IGNORE_PATTERNS_DEFAULT,
|
|
31
|
-
// ...
|
|
32
|
-
],
|
|
33
|
-
}, [
|
|
34
|
-
commonPreset(),
|
|
35
|
-
reactPreset(),
|
|
36
|
-
]);
|
|
37
|
-
```
|
|
38
|
-
|
|
39
5
|
## License
|
|
40
6
|
|
|
41
7
|
This project is licensed under the terms of the MIT license.
|
|
@@ -5,5 +5,5 @@ import { RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMP
|
|
|
5
5
|
import { RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION } from "./rules/oxc.js";
|
|
6
6
|
import { RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS } from "./rules/promise.js";
|
|
7
7
|
import { RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS } from "./rules/typescript.js";
|
|
8
|
-
import { RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS } from "./rules/unicorn.js";
|
|
9
|
-
export { PLUGIN_COMMON, RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS, RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS, RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION, RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS, RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS, RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS, commonPreset };
|
|
8
|
+
import { RULES_UNICORN, RULES_UNICORN_NURSERY, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS } from "./rules/unicorn.js";
|
|
9
|
+
export { PLUGIN_COMMON, RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS, RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS, RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION, RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS, RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS, RULES_UNICORN, RULES_UNICORN_NURSERY, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS, commonPreset };
|
|
@@ -38,6 +38,7 @@ exports.RULES_TYPESCRIPT_RESTRICTION = require_typescript.RULES_TYPESCRIPT_RESTR
|
|
|
38
38
|
exports.RULES_TYPESCRIPT_STYLE = require_typescript.RULES_TYPESCRIPT_STYLE;
|
|
39
39
|
exports.RULES_TYPESCRIPT_SUSPICIOUS = require_typescript.RULES_TYPESCRIPT_SUSPICIOUS;
|
|
40
40
|
exports.RULES_UNICORN = require_unicorn.RULES_UNICORN;
|
|
41
|
+
exports.RULES_UNICORN_NURSERY = require_unicorn.RULES_UNICORN_NURSERY;
|
|
41
42
|
exports.RULES_UNICORN_PEDANTIC = require_unicorn.RULES_UNICORN_PEDANTIC;
|
|
42
43
|
exports.RULES_UNICORN_RESTRICTION = require_unicorn.RULES_UNICORN_RESTRICTION;
|
|
43
44
|
exports.RULES_UNICORN_STYLE = require_unicorn.RULES_UNICORN_STYLE;
|
|
@@ -4,7 +4,7 @@ import { RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMP
|
|
|
4
4
|
import { RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION } from "./rules/oxc.mjs";
|
|
5
5
|
import { RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS } from "./rules/promise.mjs";
|
|
6
6
|
import { RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS } from "./rules/typescript.mjs";
|
|
7
|
-
import { RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS } from "./rules/unicorn.mjs";
|
|
7
|
+
import { RULES_UNICORN, RULES_UNICORN_NURSERY, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS } from "./rules/unicorn.mjs";
|
|
8
8
|
import { commonPreset } from "./preset/index.mjs";
|
|
9
9
|
|
|
10
|
-
export { PLUGIN_COMMON, RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS, RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS, RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION, RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS, RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS, RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS, commonPreset };
|
|
10
|
+
export { PLUGIN_COMMON, RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS, RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS, RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION, RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS, RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS, RULES_UNICORN, RULES_UNICORN_NURSERY, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS, commonPreset };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
declare const RULES_ESLINT_NURSERY: {
|
|
2
|
-
readonly "
|
|
3
|
-
readonly "no-unreachable": "error";
|
|
2
|
+
readonly "no-useless-assignment": "error";
|
|
4
3
|
};
|
|
5
4
|
declare const RULES_ESLINT_PEDANTIC: {
|
|
6
5
|
readonly eqeqeq: ["error", "always"];
|
|
@@ -44,6 +43,7 @@ declare const RULES_ESLINT_RESTRICTION: {
|
|
|
44
43
|
};
|
|
45
44
|
declare const RULES_ESLINT_STYLE: {
|
|
46
45
|
readonly "default-case-last": "error";
|
|
46
|
+
readonly "func-name-matching": ["error", "always"];
|
|
47
47
|
readonly "grouped-accessor-pairs": ["error", "getBeforeSet", {
|
|
48
48
|
readonly enforceForTSTypes: true;
|
|
49
49
|
}];
|
|
@@ -70,6 +70,8 @@ declare const RULES_ESLINT_STYLE: {
|
|
|
70
70
|
declare const RULES_ESLINT_SUSPICIOUS: {
|
|
71
71
|
readonly "block-scoped-var": "error";
|
|
72
72
|
readonly "no-extend-native": "error";
|
|
73
|
+
readonly "no-implied-eval": "error";
|
|
74
|
+
readonly "no-unmodified-loop-condition": "error";
|
|
73
75
|
readonly "no-shadow": ["error", {
|
|
74
76
|
readonly builtinGlobals: false;
|
|
75
77
|
readonly hoist: "all";
|
|
@@ -83,6 +85,8 @@ declare const RULES_ESLINT_SUSPICIOUS: {
|
|
|
83
85
|
declare const RULES_ESLINT: {
|
|
84
86
|
readonly "block-scoped-var": "error";
|
|
85
87
|
readonly "no-extend-native": "error";
|
|
88
|
+
readonly "no-implied-eval": "error";
|
|
89
|
+
readonly "no-unmodified-loop-condition": "error";
|
|
86
90
|
readonly "no-shadow": ["error", {
|
|
87
91
|
readonly builtinGlobals: false;
|
|
88
92
|
readonly hoist: "all";
|
|
@@ -93,6 +97,7 @@ declare const RULES_ESLINT: {
|
|
|
93
97
|
readonly "no-unexpected-multiline": "error";
|
|
94
98
|
readonly "no-unneeded-ternary": "error";
|
|
95
99
|
readonly "default-case-last": "error";
|
|
100
|
+
readonly "func-name-matching": ["error", "always"];
|
|
96
101
|
readonly "grouped-accessor-pairs": ["error", "getBeforeSet", {
|
|
97
102
|
readonly enforceForTSTypes: true;
|
|
98
103
|
}];
|
|
@@ -149,8 +154,7 @@ declare const RULES_ESLINT: {
|
|
|
149
154
|
}];
|
|
150
155
|
readonly "no-useless-return": "error";
|
|
151
156
|
readonly radix: "error";
|
|
152
|
-
readonly "
|
|
153
|
-
readonly "no-unreachable": "error";
|
|
157
|
+
readonly "no-useless-assignment": "error";
|
|
154
158
|
};
|
|
155
159
|
export { RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS };
|
|
156
160
|
//# sourceMappingURL=eslint.d.ts.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
const RULES_ESLINT_NURSERY = {
|
|
3
|
-
"getter-return": "error",
|
|
4
|
-
"no-unreachable": "error"
|
|
5
|
-
};
|
|
2
|
+
const RULES_ESLINT_NURSERY = { "no-useless-assignment": "error" };
|
|
6
3
|
const RULES_ESLINT_PEDANTIC = {
|
|
7
4
|
eqeqeq: ["error", "always"],
|
|
8
5
|
"no-array-constructor": "error",
|
|
@@ -35,6 +32,7 @@ const RULES_ESLINT_RESTRICTION = {
|
|
|
35
32
|
};
|
|
36
33
|
const RULES_ESLINT_STYLE = {
|
|
37
34
|
"default-case-last": "error",
|
|
35
|
+
"func-name-matching": ["error", "always"],
|
|
38
36
|
"grouped-accessor-pairs": [
|
|
39
37
|
"error",
|
|
40
38
|
"getBeforeSet",
|
|
@@ -57,6 +55,8 @@ const RULES_ESLINT_STYLE = {
|
|
|
57
55
|
const RULES_ESLINT_SUSPICIOUS = {
|
|
58
56
|
"block-scoped-var": "error",
|
|
59
57
|
"no-extend-native": "error",
|
|
58
|
+
"no-implied-eval": "error",
|
|
59
|
+
"no-unmodified-loop-condition": "error",
|
|
60
60
|
"no-shadow": ["error", {
|
|
61
61
|
builtinGlobals: false,
|
|
62
62
|
hoist: "all",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","names":[],"sources":["../../../../src/presets/common/rules/eslint.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_ESLINT_NURSERY = {\n \"
|
|
1
|
+
{"version":3,"file":"eslint.js","names":[],"sources":["../../../../src/presets/common/rules/eslint.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_ESLINT_NURSERY = {\n \"no-useless-assignment\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_PEDANTIC = {\n eqeqeq: [\n \"error\",\n \"always\",\n ],\n \"no-array-constructor\": \"error\",\n \"no-case-declarations\": \"error\",\n \"no-constructor-return\": \"error\",\n \"no-else-return\": [\n \"error\",\n {\n allowElseIf: false,\n },\n ],\n \"no-fallthrough\": [\n \"error\",\n {\n allowEmptyCase: true,\n },\n ],\n \"no-loop-func\": \"error\",\n \"no-new-wrappers\": \"error\",\n \"no-object-constructor\": \"error\",\n \"no-promise-executor-return\": [\n \"error\",\n {\n allowVoid: false,\n },\n ],\n \"no-redeclare\": [\n \"error\",\n {\n builtinGlobals: true,\n },\n ],\n \"no-useless-return\": \"error\",\n radix: \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_PERF = {\n \"no-useless-call\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_RESTRICTION = {\n \"no-div-regex\": \"error\",\n \"no-undefined\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n allowNamedExports: true,\n classes: true,\n enums: true,\n functions: false,\n ignoreTypeReferences: true,\n typedefs: true,\n variables: false,\n },\n ],\n \"no-var\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_STYLE = {\n \"default-case-last\": \"error\",\n \"func-name-matching\": [\n \"error\",\n \"always\",\n ],\n \"grouped-accessor-pairs\": [\n \"error\",\n \"getBeforeSet\",\n {\n enforceForTSTypes: true,\n },\n ],\n \"no-extra-label\": \"error\",\n \"no-implicit-coercion\": \"error\",\n \"no-label-var\": \"error\",\n \"no-multi-assign\": [\n \"error\",\n {\n ignoreNonDeclaration: false,\n },\n ],\n \"no-template-curly-in-string\": \"error\",\n \"no-useless-computed-key\": [\n \"error\",\n {\n enforceForClassMembers: true,\n },\n ],\n \"prefer-const\": [\n \"error\",\n {\n destructuring: \"all\",\n // avoid conflicts with `no-use-before-define`\n ignoreReadBeforeAssign: true,\n },\n ],\n \"prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n },\n ],\n \"prefer-rest-params\": \"error\",\n \"prefer-spread\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_SUSPICIOUS = {\n \"block-scoped-var\": \"error\",\n \"no-extend-native\": \"error\",\n \"no-implied-eval\": \"error\",\n \"no-unmodified-loop-condition\": \"error\",\n \"no-shadow\": [\n \"error\",\n {\n builtinGlobals: false,\n hoist: \"all\",\n ignoreFunctionTypeParameterNameValueShadow: false,\n ignoreOnInitialization: false,\n ignoreTypeValueShadow: false,\n },\n ],\n \"no-unexpected-multiline\": \"error\",\n \"no-unneeded-ternary\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT = {\n ...RULES_ESLINT_NURSERY,\n ...RULES_ESLINT_PEDANTIC,\n ...RULES_ESLINT_PERF,\n ...RULES_ESLINT_RESTRICTION,\n ...RULES_ESLINT_STYLE,\n ...RULES_ESLINT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_ESLINT,\n RULES_ESLINT_NURSERY,\n RULES_ESLINT_PEDANTIC,\n RULES_ESLINT_PERF,\n RULES_ESLINT_RESTRICTION,\n RULES_ESLINT_STYLE,\n RULES_ESLINT_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,uBAAuB,EACzB,yBAAyB,QAC7B;AAEA,MAAM,wBAAwB;CAC1B,QAAQ,CACJ,SACA,QACJ;CACA,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CACzB,kBAAkB,CACd,SACA,EACI,aAAa,MACjB,CACJ;CACA,kBAAkB,CACd,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,gBAAgB;CAChB,mBAAmB;CACnB,yBAAyB;CACzB,8BAA8B,CAC1B,SACA,EACI,WAAW,MACf,CACJ;CACA,gBAAgB,CACZ,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,qBAAqB;CACrB,OAAO;AACX;AAEA,MAAM,oBAAoB,EACtB,mBAAmB,QACvB;AAEA,MAAM,2BAA2B;CAC7B,gBAAgB;CAChB,gBAAgB;CAChB,wBAAwB,CACpB,SACA;EACI,mBAAmB;EACnB,SAAS;EACT,OAAO;EACP,WAAW;EACX,sBAAsB;EACtB,UAAU;EACV,WAAW;CACf,CACJ;CACA,UAAU;AACd;AAEA,MAAM,qBAAqB;CACvB,qBAAqB;CACrB,sBAAsB,CAClB,SACA,QACJ;CACA,0BAA0B;EACtB;EACA;EACA,EACI,mBAAmB,KACvB;CACJ;CACA,kBAAkB;CAClB,wBAAwB;CACxB,gBAAgB;CAChB,mBAAmB,CACf,SACA,EACI,sBAAsB,MAC1B,CACJ;CACA,+BAA+B;CAC/B,2BAA2B,CACvB,SACA,EACI,wBAAwB,KAC5B,CACJ;CACA,gBAAgB,CACZ,SACA;EACI,eAAe;EAEf,wBAAwB;CAC5B,CACJ;CACA,gCAAgC,CAC5B,SACA,EACI,kBAAkB,MACtB,CACJ;CACA,sBAAsB;CACtB,iBAAiB;AACrB;AAEA,MAAM,0BAA0B;CAC5B,oBAAoB;CACpB,oBAAoB;CACpB,mBAAmB;CACnB,gCAAgC;CAChC,aAAa,CACT,SACA;EACI,gBAAgB;EAChB,OAAO;EACP,4CAA4C;EAC5C,wBAAwB;EACxB,uBAAuB;CAC3B,CACJ;CACA,2BAA2B;CAC3B,uBAAuB;AAC3B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
const RULES_ESLINT_NURSERY = {
|
|
2
|
-
"getter-return": "error",
|
|
3
|
-
"no-unreachable": "error"
|
|
4
|
-
};
|
|
1
|
+
const RULES_ESLINT_NURSERY = { "no-useless-assignment": "error" };
|
|
5
2
|
const RULES_ESLINT_PEDANTIC = {
|
|
6
3
|
eqeqeq: ["error", "always"],
|
|
7
4
|
"no-array-constructor": "error",
|
|
@@ -34,6 +31,7 @@ const RULES_ESLINT_RESTRICTION = {
|
|
|
34
31
|
};
|
|
35
32
|
const RULES_ESLINT_STYLE = {
|
|
36
33
|
"default-case-last": "error",
|
|
34
|
+
"func-name-matching": ["error", "always"],
|
|
37
35
|
"grouped-accessor-pairs": [
|
|
38
36
|
"error",
|
|
39
37
|
"getBeforeSet",
|
|
@@ -56,6 +54,8 @@ const RULES_ESLINT_STYLE = {
|
|
|
56
54
|
const RULES_ESLINT_SUSPICIOUS = {
|
|
57
55
|
"block-scoped-var": "error",
|
|
58
56
|
"no-extend-native": "error",
|
|
57
|
+
"no-implied-eval": "error",
|
|
58
|
+
"no-unmodified-loop-condition": "error",
|
|
59
59
|
"no-shadow": ["error", {
|
|
60
60
|
builtinGlobals: false,
|
|
61
61
|
hoist: "all",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.mjs","names":[],"sources":["../../../../src/presets/common/rules/eslint.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_ESLINT_NURSERY = {\n \"
|
|
1
|
+
{"version":3,"file":"eslint.mjs","names":[],"sources":["../../../../src/presets/common/rules/eslint.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_ESLINT_NURSERY = {\n \"no-useless-assignment\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_PEDANTIC = {\n eqeqeq: [\n \"error\",\n \"always\",\n ],\n \"no-array-constructor\": \"error\",\n \"no-case-declarations\": \"error\",\n \"no-constructor-return\": \"error\",\n \"no-else-return\": [\n \"error\",\n {\n allowElseIf: false,\n },\n ],\n \"no-fallthrough\": [\n \"error\",\n {\n allowEmptyCase: true,\n },\n ],\n \"no-loop-func\": \"error\",\n \"no-new-wrappers\": \"error\",\n \"no-object-constructor\": \"error\",\n \"no-promise-executor-return\": [\n \"error\",\n {\n allowVoid: false,\n },\n ],\n \"no-redeclare\": [\n \"error\",\n {\n builtinGlobals: true,\n },\n ],\n \"no-useless-return\": \"error\",\n radix: \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_PERF = {\n \"no-useless-call\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_RESTRICTION = {\n \"no-div-regex\": \"error\",\n \"no-undefined\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n allowNamedExports: true,\n classes: true,\n enums: true,\n functions: false,\n ignoreTypeReferences: true,\n typedefs: true,\n variables: false,\n },\n ],\n \"no-var\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_STYLE = {\n \"default-case-last\": \"error\",\n \"func-name-matching\": [\n \"error\",\n \"always\",\n ],\n \"grouped-accessor-pairs\": [\n \"error\",\n \"getBeforeSet\",\n {\n enforceForTSTypes: true,\n },\n ],\n \"no-extra-label\": \"error\",\n \"no-implicit-coercion\": \"error\",\n \"no-label-var\": \"error\",\n \"no-multi-assign\": [\n \"error\",\n {\n ignoreNonDeclaration: false,\n },\n ],\n \"no-template-curly-in-string\": \"error\",\n \"no-useless-computed-key\": [\n \"error\",\n {\n enforceForClassMembers: true,\n },\n ],\n \"prefer-const\": [\n \"error\",\n {\n destructuring: \"all\",\n // avoid conflicts with `no-use-before-define`\n ignoreReadBeforeAssign: true,\n },\n ],\n \"prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n },\n ],\n \"prefer-rest-params\": \"error\",\n \"prefer-spread\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_SUSPICIOUS = {\n \"block-scoped-var\": \"error\",\n \"no-extend-native\": \"error\",\n \"no-implied-eval\": \"error\",\n \"no-unmodified-loop-condition\": \"error\",\n \"no-shadow\": [\n \"error\",\n {\n builtinGlobals: false,\n hoist: \"all\",\n ignoreFunctionTypeParameterNameValueShadow: false,\n ignoreOnInitialization: false,\n ignoreTypeValueShadow: false,\n },\n ],\n \"no-unexpected-multiline\": \"error\",\n \"no-unneeded-ternary\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT = {\n ...RULES_ESLINT_NURSERY,\n ...RULES_ESLINT_PEDANTIC,\n ...RULES_ESLINT_PERF,\n ...RULES_ESLINT_RESTRICTION,\n ...RULES_ESLINT_STYLE,\n ...RULES_ESLINT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_ESLINT,\n RULES_ESLINT_NURSERY,\n RULES_ESLINT_PEDANTIC,\n RULES_ESLINT_PERF,\n RULES_ESLINT_RESTRICTION,\n RULES_ESLINT_STYLE,\n RULES_ESLINT_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,uBAAuB,EACzB,yBAAyB,QAC7B;AAEA,MAAM,wBAAwB;CAC1B,QAAQ,CACJ,SACA,QACJ;CACA,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CACzB,kBAAkB,CACd,SACA,EACI,aAAa,MACjB,CACJ;CACA,kBAAkB,CACd,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,gBAAgB;CAChB,mBAAmB;CACnB,yBAAyB;CACzB,8BAA8B,CAC1B,SACA,EACI,WAAW,MACf,CACJ;CACA,gBAAgB,CACZ,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,qBAAqB;CACrB,OAAO;AACX;AAEA,MAAM,oBAAoB,EACtB,mBAAmB,QACvB;AAEA,MAAM,2BAA2B;CAC7B,gBAAgB;CAChB,gBAAgB;CAChB,wBAAwB,CACpB,SACA;EACI,mBAAmB;EACnB,SAAS;EACT,OAAO;EACP,WAAW;EACX,sBAAsB;EACtB,UAAU;EACV,WAAW;CACf,CACJ;CACA,UAAU;AACd;AAEA,MAAM,qBAAqB;CACvB,qBAAqB;CACrB,sBAAsB,CAClB,SACA,QACJ;CACA,0BAA0B;EACtB;EACA;EACA,EACI,mBAAmB,KACvB;CACJ;CACA,kBAAkB;CAClB,wBAAwB;CACxB,gBAAgB;CAChB,mBAAmB,CACf,SACA,EACI,sBAAsB,MAC1B,CACJ;CACA,+BAA+B;CAC/B,2BAA2B,CACvB,SACA,EACI,wBAAwB,KAC5B,CACJ;CACA,gBAAgB,CACZ,SACA;EACI,eAAe;EAEf,wBAAwB;CAC5B,CACJ;CACA,gCAAgC,CAC5B,SACA,EACI,kBAAkB,MACtB,CACJ;CACA,sBAAsB;CACtB,iBAAiB;AACrB;AAEA,MAAM,0BAA0B;CAC5B,oBAAoB;CACpB,oBAAoB;CACpB,mBAAmB;CACnB,gCAAgC;CAChC,aAAa,CACT,SACA;EACI,gBAAgB;EAChB,OAAO;EACP,4CAA4C;EAC5C,wBAAwB;EACxB,uBAAuB;CAC3B,CACJ;CACA,2BAA2B;CAC3B,uBAAuB;AAC3B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -24,6 +24,11 @@ declare const RULES_IMPORT_RESTRICTION: {
|
|
|
24
24
|
declare const RULES_IMPORT_STYLE: {
|
|
25
25
|
readonly "import/consistent-type-specifier-style": ["error", "prefer-top-level"];
|
|
26
26
|
readonly "import/first": "error";
|
|
27
|
+
readonly "import/newline-after-import": ["error", {
|
|
28
|
+
readonly considerComments: true;
|
|
29
|
+
readonly count: 1;
|
|
30
|
+
readonly exactCount: true;
|
|
31
|
+
}];
|
|
27
32
|
readonly "import/no-duplicates": ["error", {
|
|
28
33
|
readonly considerQueryString: true;
|
|
29
34
|
readonly preferInline: false;
|
|
@@ -41,6 +46,11 @@ declare const RULES_IMPORT: {
|
|
|
41
46
|
readonly "import/no-self-import": "error";
|
|
42
47
|
readonly "import/consistent-type-specifier-style": ["error", "prefer-top-level"];
|
|
43
48
|
readonly "import/first": "error";
|
|
49
|
+
readonly "import/newline-after-import": ["error", {
|
|
50
|
+
readonly considerComments: true;
|
|
51
|
+
readonly count: 1;
|
|
52
|
+
readonly exactCount: true;
|
|
53
|
+
}];
|
|
44
54
|
readonly "import/no-duplicates": ["error", {
|
|
45
55
|
readonly considerQueryString: true;
|
|
46
56
|
readonly preferInline: false;
|
|
@@ -29,6 +29,11 @@ const RULES_IMPORT_RESTRICTION = {
|
|
|
29
29
|
const RULES_IMPORT_STYLE = {
|
|
30
30
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
31
31
|
"import/first": "error",
|
|
32
|
+
"import/newline-after-import": ["error", {
|
|
33
|
+
considerComments: true,
|
|
34
|
+
count: 1,
|
|
35
|
+
exactCount: true
|
|
36
|
+
}],
|
|
32
37
|
"import/no-duplicates": ["error", {
|
|
33
38
|
considerQueryString: true,
|
|
34
39
|
preferInline: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","names":[],"sources":["../../../../src/presets/common/rules/import.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_IMPORT_CORRECTNESS = {\n \"import/default\": \"error\",\n \"import/namespace\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_NURSERY = {\n \"import/export\": \"error\",\n \"import/named\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_RESTRICTION = {\n \"import/extensions\": [\n \"error\",\n \"always\",\n {\n // source\n js: \"never\",\n ts: \"never\",\n mjs: \"never\",\n mts: \"never\",\n cjs: \"never\",\n cts: \"never\",\n jsx: \"never\",\n tsx: \"never\",\n // configurations\n checkTypeImports: true,\n ignorePackages: true,\n },\n ],\n \"import/no-cycle\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_STYLE = {\n \"import/consistent-type-specifier-style\": [\n \"error\",\n \"prefer-top-level\",\n ],\n \"import/first\": \"error\",\n \"import/no-duplicates\": [\n \"error\",\n {\n considerQueryString: true,\n preferInline: false,\n },\n ],\n \"import/no-mutable-exports\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_SUSPICIOUS = {\n \"import/no-empty-named-blocks\": \"error\",\n \"import/no-named-as-default\": \"error\",\n \"import/no-self-import\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT = {\n ...RULES_IMPORT_CORRECTNESS,\n ...RULES_IMPORT_NURSERY,\n ...RULES_IMPORT_RESTRICTION,\n ...RULES_IMPORT_STYLE,\n ...RULES_IMPORT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_IMPORT,\n RULES_IMPORT_CORRECTNESS,\n RULES_IMPORT_NURSERY,\n RULES_IMPORT_RESTRICTION,\n RULES_IMPORT_STYLE,\n RULES_IMPORT_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,2BAA2B;CAC7B,kBAAkB;CAClB,oBAAoB;AACxB;AAEA,MAAM,uBAAuB;CACzB,iBAAiB;CACjB,gBAAgB;AACpB;AAEA,MAAM,2BAA2B;CAC7B,qBAAqB;EACjB;EACA;EACA;GAEI,IAAI;GACJ,IAAI;GACJ,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GAEL,kBAAkB;GAClB,gBAAgB;EACpB;CACJ;CACA,mBAAmB;AACvB;AAEA,MAAM,qBAAqB;CACvB,0CAA0C,CACtC,SACA,kBACJ;CACA,gBAAgB;CAChB,wBAAwB,CACpB,SACA;EACI,qBAAqB;EACrB,cAAc;CAClB,CACJ;CACA,6BAA6B;AACjC;AAEA,MAAM,0BAA0B;CAC5B,gCAAgC;CAChC,8BAA8B;CAC9B,yBAAyB;AAC7B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
1
|
+
{"version":3,"file":"import.js","names":[],"sources":["../../../../src/presets/common/rules/import.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_IMPORT_CORRECTNESS = {\n \"import/default\": \"error\",\n \"import/namespace\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_NURSERY = {\n \"import/export\": \"error\",\n \"import/named\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_RESTRICTION = {\n \"import/extensions\": [\n \"error\",\n \"always\",\n {\n // source\n js: \"never\",\n ts: \"never\",\n mjs: \"never\",\n mts: \"never\",\n cjs: \"never\",\n cts: \"never\",\n jsx: \"never\",\n tsx: \"never\",\n // configurations\n checkTypeImports: true,\n ignorePackages: true,\n },\n ],\n \"import/no-cycle\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_STYLE = {\n \"import/consistent-type-specifier-style\": [\n \"error\",\n \"prefer-top-level\",\n ],\n \"import/first\": \"error\",\n \"import/newline-after-import\": [\n \"error\",\n {\n considerComments: true,\n count: 1,\n exactCount: true,\n },\n ],\n \"import/no-duplicates\": [\n \"error\",\n {\n considerQueryString: true,\n preferInline: false,\n },\n ],\n \"import/no-mutable-exports\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_SUSPICIOUS = {\n \"import/no-empty-named-blocks\": \"error\",\n \"import/no-named-as-default\": \"error\",\n \"import/no-self-import\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT = {\n ...RULES_IMPORT_CORRECTNESS,\n ...RULES_IMPORT_NURSERY,\n ...RULES_IMPORT_RESTRICTION,\n ...RULES_IMPORT_STYLE,\n ...RULES_IMPORT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_IMPORT,\n RULES_IMPORT_CORRECTNESS,\n RULES_IMPORT_NURSERY,\n RULES_IMPORT_RESTRICTION,\n RULES_IMPORT_STYLE,\n RULES_IMPORT_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,2BAA2B;CAC7B,kBAAkB;CAClB,oBAAoB;AACxB;AAEA,MAAM,uBAAuB;CACzB,iBAAiB;CACjB,gBAAgB;AACpB;AAEA,MAAM,2BAA2B;CAC7B,qBAAqB;EACjB;EACA;EACA;GAEI,IAAI;GACJ,IAAI;GACJ,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GAEL,kBAAkB;GAClB,gBAAgB;EACpB;CACJ;CACA,mBAAmB;AACvB;AAEA,MAAM,qBAAqB;CACvB,0CAA0C,CACtC,SACA,kBACJ;CACA,gBAAgB;CAChB,+BAA+B,CAC3B,SACA;EACI,kBAAkB;EAClB,OAAO;EACP,YAAY;CAChB,CACJ;CACA,wBAAwB,CACpB,SACA;EACI,qBAAqB;EACrB,cAAc;CAClB,CACJ;CACA,6BAA6B;AACjC;AAEA,MAAM,0BAA0B;CAC5B,gCAAgC;CAChC,8BAA8B;CAC9B,yBAAyB;AAC7B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -28,6 +28,11 @@ const RULES_IMPORT_RESTRICTION = {
|
|
|
28
28
|
const RULES_IMPORT_STYLE = {
|
|
29
29
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
30
30
|
"import/first": "error",
|
|
31
|
+
"import/newline-after-import": ["error", {
|
|
32
|
+
considerComments: true,
|
|
33
|
+
count: 1,
|
|
34
|
+
exactCount: true
|
|
35
|
+
}],
|
|
31
36
|
"import/no-duplicates": ["error", {
|
|
32
37
|
considerQueryString: true,
|
|
33
38
|
preferInline: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.mjs","names":[],"sources":["../../../../src/presets/common/rules/import.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_IMPORT_CORRECTNESS = {\n \"import/default\": \"error\",\n \"import/namespace\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_NURSERY = {\n \"import/export\": \"error\",\n \"import/named\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_RESTRICTION = {\n \"import/extensions\": [\n \"error\",\n \"always\",\n {\n // source\n js: \"never\",\n ts: \"never\",\n mjs: \"never\",\n mts: \"never\",\n cjs: \"never\",\n cts: \"never\",\n jsx: \"never\",\n tsx: \"never\",\n // configurations\n checkTypeImports: true,\n ignorePackages: true,\n },\n ],\n \"import/no-cycle\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_STYLE = {\n \"import/consistent-type-specifier-style\": [\n \"error\",\n \"prefer-top-level\",\n ],\n \"import/first\": \"error\",\n \"import/no-duplicates\": [\n \"error\",\n {\n considerQueryString: true,\n preferInline: false,\n },\n ],\n \"import/no-mutable-exports\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_SUSPICIOUS = {\n \"import/no-empty-named-blocks\": \"error\",\n \"import/no-named-as-default\": \"error\",\n \"import/no-self-import\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT = {\n ...RULES_IMPORT_CORRECTNESS,\n ...RULES_IMPORT_NURSERY,\n ...RULES_IMPORT_RESTRICTION,\n ...RULES_IMPORT_STYLE,\n ...RULES_IMPORT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_IMPORT,\n RULES_IMPORT_CORRECTNESS,\n RULES_IMPORT_NURSERY,\n RULES_IMPORT_RESTRICTION,\n RULES_IMPORT_STYLE,\n RULES_IMPORT_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,2BAA2B;CAC7B,kBAAkB;CAClB,oBAAoB;AACxB;AAEA,MAAM,uBAAuB;CACzB,iBAAiB;CACjB,gBAAgB;AACpB;AAEA,MAAM,2BAA2B;CAC7B,qBAAqB;EACjB;EACA;EACA;GAEI,IAAI;GACJ,IAAI;GACJ,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GAEL,kBAAkB;GAClB,gBAAgB;EACpB;CACJ;CACA,mBAAmB;AACvB;AAEA,MAAM,qBAAqB;CACvB,0CAA0C,CACtC,SACA,kBACJ;CACA,gBAAgB;CAChB,wBAAwB,CACpB,SACA;EACI,qBAAqB;EACrB,cAAc;CAClB,CACJ;CACA,6BAA6B;AACjC;AAEA,MAAM,0BAA0B;CAC5B,gCAAgC;CAChC,8BAA8B;CAC9B,yBAAyB;AAC7B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
1
|
+
{"version":3,"file":"import.mjs","names":[],"sources":["../../../../src/presets/common/rules/import.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_IMPORT_CORRECTNESS = {\n \"import/default\": \"error\",\n \"import/namespace\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_NURSERY = {\n \"import/export\": \"error\",\n \"import/named\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_RESTRICTION = {\n \"import/extensions\": [\n \"error\",\n \"always\",\n {\n // source\n js: \"never\",\n ts: \"never\",\n mjs: \"never\",\n mts: \"never\",\n cjs: \"never\",\n cts: \"never\",\n jsx: \"never\",\n tsx: \"never\",\n // configurations\n checkTypeImports: true,\n ignorePackages: true,\n },\n ],\n \"import/no-cycle\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_STYLE = {\n \"import/consistent-type-specifier-style\": [\n \"error\",\n \"prefer-top-level\",\n ],\n \"import/first\": \"error\",\n \"import/newline-after-import\": [\n \"error\",\n {\n considerComments: true,\n count: 1,\n exactCount: true,\n },\n ],\n \"import/no-duplicates\": [\n \"error\",\n {\n considerQueryString: true,\n preferInline: false,\n },\n ],\n \"import/no-mutable-exports\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_SUSPICIOUS = {\n \"import/no-empty-named-blocks\": \"error\",\n \"import/no-named-as-default\": \"error\",\n \"import/no-self-import\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT = {\n ...RULES_IMPORT_CORRECTNESS,\n ...RULES_IMPORT_NURSERY,\n ...RULES_IMPORT_RESTRICTION,\n ...RULES_IMPORT_STYLE,\n ...RULES_IMPORT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_IMPORT,\n RULES_IMPORT_CORRECTNESS,\n RULES_IMPORT_NURSERY,\n RULES_IMPORT_RESTRICTION,\n RULES_IMPORT_STYLE,\n RULES_IMPORT_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,2BAA2B;CAC7B,kBAAkB;CAClB,oBAAoB;AACxB;AAEA,MAAM,uBAAuB;CACzB,iBAAiB;CACjB,gBAAgB;AACpB;AAEA,MAAM,2BAA2B;CAC7B,qBAAqB;EACjB;EACA;EACA;GAEI,IAAI;GACJ,IAAI;GACJ,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GAEL,kBAAkB;GAClB,gBAAgB;EACpB;CACJ;CACA,mBAAmB;AACvB;AAEA,MAAM,qBAAqB;CACvB,0CAA0C,CACtC,SACA,kBACJ;CACA,gBAAgB;CAChB,+BAA+B,CAC3B,SACA;EACI,kBAAkB;EAClB,OAAO;EACP,YAAY;CAChB,CACJ;CACA,wBAAwB,CACpB,SACA;EACI,qBAAqB;EACrB,cAAc;CAClB,CACJ;CACA,6BAA6B;AACjC;AAEA,MAAM,0BAA0B;CAC5B,gCAAgC;CAChC,8BAA8B;CAC9B,yBAAyB;AAC7B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
declare const RULES_TYPESCRIPT_NURSERY: {
|
|
2
|
-
readonly "typescript/
|
|
3
|
-
readonly
|
|
4
|
-
|
|
5
|
-
readonly "typescript/consistent-type-exports": ["error", {
|
|
6
|
-
readonly fixMixedExportsWithInlineTypeSpecifier: false;
|
|
7
|
-
}];
|
|
8
|
-
readonly "typescript/dot-notation": ["error", {
|
|
9
|
-
readonly allowIndexSignaturePropertyAccess: false;
|
|
10
|
-
readonly allowKeywords: true;
|
|
11
|
-
readonly allowPrivateClassPropertyAccess: false;
|
|
12
|
-
readonly allowProtectedClassPropertyAccess: false;
|
|
2
|
+
readonly "typescript/no-unnecessary-condition": ["error", {
|
|
3
|
+
readonly allowConstantLoopConditions: true;
|
|
4
|
+
readonly checkTypePredicates: true;
|
|
13
5
|
}];
|
|
14
|
-
readonly "typescript/no-unnecessary-type-conversion": "error";
|
|
15
|
-
readonly "typescript/no-unnecessary-type-parameters": "error";
|
|
16
|
-
readonly "typescript/no-useless-default-assignment": "error";
|
|
17
6
|
readonly "typescript/prefer-optional-chain": ["error", {
|
|
18
7
|
readonly allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false;
|
|
19
8
|
readonly checkAny: true;
|
|
@@ -24,13 +13,6 @@ declare const RULES_TYPESCRIPT_NURSERY: {
|
|
|
24
13
|
readonly checkUnknown: true;
|
|
25
14
|
readonly requireNullish: false;
|
|
26
15
|
}];
|
|
27
|
-
readonly "typescript/prefer-readonly": ["error", {
|
|
28
|
-
readonly onlyInlineLambdas: false;
|
|
29
|
-
}];
|
|
30
|
-
readonly "typescript/prefer-regexp-exec": "error";
|
|
31
|
-
readonly "typescript/strict-void-return": ["error", {
|
|
32
|
-
readonly allowReturnAny: false;
|
|
33
|
-
}];
|
|
34
16
|
};
|
|
35
17
|
declare const RULES_TYPESCRIPT_PEDANTIC: {
|
|
36
18
|
readonly "typescript/no-misused-promises": ["error", {
|
|
@@ -92,6 +74,9 @@ declare const RULES_TYPESCRIPT_PEDANTIC: {
|
|
|
92
74
|
readonly allowNumber: true;
|
|
93
75
|
readonly allowString: true;
|
|
94
76
|
}];
|
|
77
|
+
readonly "typescript/strict-void-return": ["error", {
|
|
78
|
+
readonly allowReturnAny: false;
|
|
79
|
+
}];
|
|
95
80
|
readonly "typescript/switch-exhaustiveness-check": ["error", {
|
|
96
81
|
readonly allowDefaultCaseForExhaustiveSwitch: true;
|
|
97
82
|
readonly considerDefaultExhaustiveForUnions: true;
|
|
@@ -99,6 +84,9 @@ declare const RULES_TYPESCRIPT_PEDANTIC: {
|
|
|
99
84
|
}];
|
|
100
85
|
};
|
|
101
86
|
declare const RULES_TYPESCRIPT_RESTRICTION: {
|
|
87
|
+
readonly "typescript/explicit-member-accessibility": ["error", {
|
|
88
|
+
readonly accessibility: "explicit";
|
|
89
|
+
}];
|
|
102
90
|
readonly "typescript/no-empty-object-type": ["error", {
|
|
103
91
|
readonly allowInterfaces: "with-single-extends";
|
|
104
92
|
readonly allowObjectTypes: "never";
|
|
@@ -124,11 +112,21 @@ declare const RULES_TYPESCRIPT_STYLE: {
|
|
|
124
112
|
readonly assertionStyle: "as";
|
|
125
113
|
}];
|
|
126
114
|
readonly "typescript/consistent-type-definitions": ["error", "type"];
|
|
115
|
+
readonly "typescript/consistent-type-exports": ["error", {
|
|
116
|
+
readonly fixMixedExportsWithInlineTypeSpecifier: false;
|
|
117
|
+
}];
|
|
127
118
|
readonly "typescript/consistent-type-imports": ["error", {
|
|
128
119
|
readonly disallowTypeAnnotations: true;
|
|
129
120
|
readonly fixStyle: "separate-type-imports";
|
|
130
121
|
readonly prefer: "type-imports";
|
|
131
122
|
}];
|
|
123
|
+
readonly "typescript/dot-notation": ["error", {
|
|
124
|
+
readonly allowIndexSignaturePropertyAccess: false;
|
|
125
|
+
readonly allowKeywords: true;
|
|
126
|
+
readonly allowPrivateClassPropertyAccess: false;
|
|
127
|
+
readonly allowProtectedClassPropertyAccess: false;
|
|
128
|
+
}];
|
|
129
|
+
readonly "typescript/method-signature-style": ["error", "property"];
|
|
132
130
|
readonly "typescript/no-empty-interface": ["error", {
|
|
133
131
|
readonly allowSingleExtends: true;
|
|
134
132
|
}];
|
|
@@ -137,28 +135,52 @@ declare const RULES_TYPESCRIPT_STYLE: {
|
|
|
137
135
|
}];
|
|
138
136
|
readonly "typescript/prefer-function-type": "error";
|
|
139
137
|
readonly "typescript/prefer-reduce-type-parameter": "error";
|
|
138
|
+
readonly "typescript/prefer-readonly": ["error", {
|
|
139
|
+
readonly onlyInlineLambdas: false;
|
|
140
|
+
}];
|
|
141
|
+
readonly "typescript/prefer-regexp-exec": "error";
|
|
140
142
|
readonly "typescript/prefer-return-this-type": "error";
|
|
141
143
|
};
|
|
142
144
|
declare const RULES_TYPESCRIPT_SUSPICIOUS: {
|
|
145
|
+
readonly "typescript/consistent-return": ["error", {
|
|
146
|
+
readonly treatUndefinedAsUnspecified: false;
|
|
147
|
+
}];
|
|
143
148
|
readonly "typescript/no-confusing-non-null-assertion": "error";
|
|
144
149
|
readonly "typescript/no-unnecessary-template-expression": "error";
|
|
145
150
|
readonly "typescript/no-unnecessary-type-constraint": "error";
|
|
151
|
+
readonly "typescript/no-unnecessary-type-conversion": "error";
|
|
152
|
+
readonly "typescript/no-unnecessary-type-parameters": "error";
|
|
146
153
|
readonly "typescript/no-unsafe-enum-comparison": "error";
|
|
147
154
|
};
|
|
148
155
|
declare const RULES_TYPESCRIPT: {
|
|
156
|
+
readonly "typescript/consistent-return": ["error", {
|
|
157
|
+
readonly treatUndefinedAsUnspecified: false;
|
|
158
|
+
}];
|
|
149
159
|
readonly "typescript/no-confusing-non-null-assertion": "error";
|
|
150
160
|
readonly "typescript/no-unnecessary-template-expression": "error";
|
|
151
161
|
readonly "typescript/no-unnecessary-type-constraint": "error";
|
|
162
|
+
readonly "typescript/no-unnecessary-type-conversion": "error";
|
|
163
|
+
readonly "typescript/no-unnecessary-type-parameters": "error";
|
|
152
164
|
readonly "typescript/no-unsafe-enum-comparison": "error";
|
|
153
165
|
readonly "typescript/consistent-type-assertions": ["error", {
|
|
154
166
|
readonly assertionStyle: "as";
|
|
155
167
|
}];
|
|
156
168
|
readonly "typescript/consistent-type-definitions": ["error", "type"];
|
|
169
|
+
readonly "typescript/consistent-type-exports": ["error", {
|
|
170
|
+
readonly fixMixedExportsWithInlineTypeSpecifier: false;
|
|
171
|
+
}];
|
|
157
172
|
readonly "typescript/consistent-type-imports": ["error", {
|
|
158
173
|
readonly disallowTypeAnnotations: true;
|
|
159
174
|
readonly fixStyle: "separate-type-imports";
|
|
160
175
|
readonly prefer: "type-imports";
|
|
161
176
|
}];
|
|
177
|
+
readonly "typescript/dot-notation": ["error", {
|
|
178
|
+
readonly allowIndexSignaturePropertyAccess: false;
|
|
179
|
+
readonly allowKeywords: true;
|
|
180
|
+
readonly allowPrivateClassPropertyAccess: false;
|
|
181
|
+
readonly allowProtectedClassPropertyAccess: false;
|
|
182
|
+
}];
|
|
183
|
+
readonly "typescript/method-signature-style": ["error", "property"];
|
|
162
184
|
readonly "typescript/no-empty-interface": ["error", {
|
|
163
185
|
readonly allowSingleExtends: true;
|
|
164
186
|
}];
|
|
@@ -167,7 +189,14 @@ declare const RULES_TYPESCRIPT: {
|
|
|
167
189
|
}];
|
|
168
190
|
readonly "typescript/prefer-function-type": "error";
|
|
169
191
|
readonly "typescript/prefer-reduce-type-parameter": "error";
|
|
192
|
+
readonly "typescript/prefer-readonly": ["error", {
|
|
193
|
+
readonly onlyInlineLambdas: false;
|
|
194
|
+
}];
|
|
195
|
+
readonly "typescript/prefer-regexp-exec": "error";
|
|
170
196
|
readonly "typescript/prefer-return-this-type": "error";
|
|
197
|
+
readonly "typescript/explicit-member-accessibility": ["error", {
|
|
198
|
+
readonly accessibility: "explicit";
|
|
199
|
+
}];
|
|
171
200
|
readonly "typescript/no-empty-object-type": ["error", {
|
|
172
201
|
readonly allowInterfaces: "with-single-extends";
|
|
173
202
|
readonly allowObjectTypes: "never";
|
|
@@ -246,26 +275,18 @@ declare const RULES_TYPESCRIPT: {
|
|
|
246
275
|
readonly allowNumber: true;
|
|
247
276
|
readonly allowString: true;
|
|
248
277
|
}];
|
|
278
|
+
readonly "typescript/strict-void-return": ["error", {
|
|
279
|
+
readonly allowReturnAny: false;
|
|
280
|
+
}];
|
|
249
281
|
readonly "typescript/switch-exhaustiveness-check": ["error", {
|
|
250
282
|
readonly allowDefaultCaseForExhaustiveSwitch: true;
|
|
251
283
|
readonly considerDefaultExhaustiveForUnions: true;
|
|
252
284
|
readonly requireDefaultForNonUnion: false;
|
|
253
285
|
}];
|
|
254
|
-
readonly "typescript/
|
|
255
|
-
readonly
|
|
256
|
-
|
|
257
|
-
readonly "typescript/consistent-type-exports": ["error", {
|
|
258
|
-
readonly fixMixedExportsWithInlineTypeSpecifier: false;
|
|
286
|
+
readonly "typescript/no-unnecessary-condition": ["error", {
|
|
287
|
+
readonly allowConstantLoopConditions: true;
|
|
288
|
+
readonly checkTypePredicates: true;
|
|
259
289
|
}];
|
|
260
|
-
readonly "typescript/dot-notation": ["error", {
|
|
261
|
-
readonly allowIndexSignaturePropertyAccess: false;
|
|
262
|
-
readonly allowKeywords: true;
|
|
263
|
-
readonly allowPrivateClassPropertyAccess: false;
|
|
264
|
-
readonly allowProtectedClassPropertyAccess: false;
|
|
265
|
-
}];
|
|
266
|
-
readonly "typescript/no-unnecessary-type-conversion": "error";
|
|
267
|
-
readonly "typescript/no-unnecessary-type-parameters": "error";
|
|
268
|
-
readonly "typescript/no-useless-default-assignment": "error";
|
|
269
290
|
readonly "typescript/prefer-optional-chain": ["error", {
|
|
270
291
|
readonly allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false;
|
|
271
292
|
readonly checkAny: true;
|
|
@@ -276,13 +297,6 @@ declare const RULES_TYPESCRIPT: {
|
|
|
276
297
|
readonly checkUnknown: true;
|
|
277
298
|
readonly requireNullish: false;
|
|
278
299
|
}];
|
|
279
|
-
readonly "typescript/prefer-readonly": ["error", {
|
|
280
|
-
readonly onlyInlineLambdas: false;
|
|
281
|
-
}];
|
|
282
|
-
readonly "typescript/prefer-regexp-exec": "error";
|
|
283
|
-
readonly "typescript/strict-void-return": ["error", {
|
|
284
|
-
readonly allowReturnAny: false;
|
|
285
|
-
}];
|
|
286
300
|
};
|
|
287
301
|
export { RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS };
|
|
288
302
|
//# sourceMappingURL=typescript.d.ts.map
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
const RULES_TYPESCRIPT_NURSERY = {
|
|
3
|
-
"typescript/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
allowIndexSignaturePropertyAccess: false,
|
|
7
|
-
allowKeywords: true,
|
|
8
|
-
allowPrivateClassPropertyAccess: false,
|
|
9
|
-
allowProtectedClassPropertyAccess: false
|
|
3
|
+
"typescript/no-unnecessary-condition": ["error", {
|
|
4
|
+
allowConstantLoopConditions: true,
|
|
5
|
+
checkTypePredicates: true
|
|
10
6
|
}],
|
|
11
|
-
"typescript/no-unnecessary-type-conversion": "error",
|
|
12
|
-
"typescript/no-unnecessary-type-parameters": "error",
|
|
13
|
-
"typescript/no-useless-default-assignment": "error",
|
|
14
7
|
"typescript/prefer-optional-chain": ["error", {
|
|
15
8
|
allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,
|
|
16
9
|
checkAny: true,
|
|
@@ -20,10 +13,7 @@ const RULES_TYPESCRIPT_NURSERY = {
|
|
|
20
13
|
checkString: true,
|
|
21
14
|
checkUnknown: true,
|
|
22
15
|
requireNullish: false
|
|
23
|
-
}]
|
|
24
|
-
"typescript/prefer-readonly": ["error", { onlyInlineLambdas: false }],
|
|
25
|
-
"typescript/prefer-regexp-exec": "error",
|
|
26
|
-
"typescript/strict-void-return": ["error", { allowReturnAny: false }]
|
|
16
|
+
}]
|
|
27
17
|
};
|
|
28
18
|
const RULES_TYPESCRIPT_PEDANTIC = {
|
|
29
19
|
"typescript/no-misused-promises": ["error", {
|
|
@@ -85,6 +75,7 @@ const RULES_TYPESCRIPT_PEDANTIC = {
|
|
|
85
75
|
allowNumber: true,
|
|
86
76
|
allowString: true
|
|
87
77
|
}],
|
|
78
|
+
"typescript/strict-void-return": ["error", { allowReturnAny: false }],
|
|
88
79
|
"typescript/switch-exhaustiveness-check": ["error", {
|
|
89
80
|
allowDefaultCaseForExhaustiveSwitch: true,
|
|
90
81
|
considerDefaultExhaustiveForUnions: true,
|
|
@@ -92,6 +83,7 @@ const RULES_TYPESCRIPT_PEDANTIC = {
|
|
|
92
83
|
}]
|
|
93
84
|
};
|
|
94
85
|
const RULES_TYPESCRIPT_RESTRICTION = {
|
|
86
|
+
"typescript/explicit-member-accessibility": ["error", { accessibility: "explicit" }],
|
|
95
87
|
"typescript/no-empty-object-type": ["error", {
|
|
96
88
|
allowInterfaces: "with-single-extends",
|
|
97
89
|
allowObjectTypes: "never"
|
|
@@ -115,21 +107,34 @@ const RULES_TYPESCRIPT_RESTRICTION = {
|
|
|
115
107
|
const RULES_TYPESCRIPT_STYLE = {
|
|
116
108
|
"typescript/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
117
109
|
"typescript/consistent-type-definitions": ["error", "type"],
|
|
110
|
+
"typescript/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: false }],
|
|
118
111
|
"typescript/consistent-type-imports": ["error", {
|
|
119
112
|
disallowTypeAnnotations: true,
|
|
120
113
|
fixStyle: "separate-type-imports",
|
|
121
114
|
prefer: "type-imports"
|
|
122
115
|
}],
|
|
116
|
+
"typescript/dot-notation": ["error", {
|
|
117
|
+
allowIndexSignaturePropertyAccess: false,
|
|
118
|
+
allowKeywords: true,
|
|
119
|
+
allowPrivateClassPropertyAccess: false,
|
|
120
|
+
allowProtectedClassPropertyAccess: false
|
|
121
|
+
}],
|
|
122
|
+
"typescript/method-signature-style": ["error", "property"],
|
|
123
123
|
"typescript/no-empty-interface": ["error", { allowSingleExtends: true }],
|
|
124
124
|
"typescript/parameter-properties": ["error", { prefer: "class-property" }],
|
|
125
125
|
"typescript/prefer-function-type": "error",
|
|
126
126
|
"typescript/prefer-reduce-type-parameter": "error",
|
|
127
|
+
"typescript/prefer-readonly": ["error", { onlyInlineLambdas: false }],
|
|
128
|
+
"typescript/prefer-regexp-exec": "error",
|
|
127
129
|
"typescript/prefer-return-this-type": "error"
|
|
128
130
|
};
|
|
129
131
|
const RULES_TYPESCRIPT_SUSPICIOUS = {
|
|
132
|
+
"typescript/consistent-return": ["error", { treatUndefinedAsUnspecified: false }],
|
|
130
133
|
"typescript/no-confusing-non-null-assertion": "error",
|
|
131
134
|
"typescript/no-unnecessary-template-expression": "error",
|
|
132
135
|
"typescript/no-unnecessary-type-constraint": "error",
|
|
136
|
+
"typescript/no-unnecessary-type-conversion": "error",
|
|
137
|
+
"typescript/no-unnecessary-type-parameters": "error",
|
|
133
138
|
"typescript/no-unsafe-enum-comparison": "error"
|
|
134
139
|
};
|
|
135
140
|
const RULES_TYPESCRIPT = {
|