@apst/oxlint 0.1.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 +3 -4
- package/dist/presets/common/index.js +1 -3
- package/dist/presets/common/index.mjs +3 -4
- package/dist/presets/common/plugin/index.d.ts +1 -2
- package/dist/presets/common/plugin/index.js +0 -2
- package/dist/presets/common/plugin/index.js.map +1 -1
- package/dist/presets/common/plugin/index.mjs +1 -2
- package/dist/presets/common/plugin/index.mjs.map +1 -1
- package/dist/presets/common/preset/index.js +1 -4
- package/dist/presets/common/preset/index.js.map +1 -1
- package/dist/presets/common/preset/index.mjs +2 -5
- package/dist/presets/common/preset/index.mjs.map +1 -1
- 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 +58 -44
- package/dist/presets/common/rules/typescript.js +20 -15
- package/dist/presets/common/rules/typescript.js.map +1 -1
- package/dist/presets/common/rules/typescript.mjs +20 -15
- 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 +12 -44
- package/dist/presets/common/rules/stylistic.d.ts +0 -18
- package/dist/presets/common/rules/stylistic.js +0 -16
- package/dist/presets/common/rules/stylistic.js.map +0 -1
- package/dist/presets/common/rules/stylistic.mjs +0 -15
- package/dist/presets/common/rules/stylistic.mjs.map +0 -1
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.
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { PLUGIN_COMMON
|
|
1
|
+
import { PLUGIN_COMMON } from "./plugin/index.js";
|
|
2
2
|
import { commonPreset } from "./preset/index.js";
|
|
3
3
|
import { RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS } from "./rules/eslint.js";
|
|
4
4
|
import { RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS } from "./rules/import.js";
|
|
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
|
-
import { RULES_STYLISTIC } from "./rules/stylistic.js";
|
|
8
7
|
import { RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS } from "./rules/typescript.js";
|
|
9
|
-
import { RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS } from "./rules/unicorn.js";
|
|
10
|
-
export { PLUGIN_COMMON,
|
|
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 };
|
|
@@ -4,13 +4,11 @@ const require_eslint = require('./rules/eslint.js');
|
|
|
4
4
|
const require_import = require('./rules/import.js');
|
|
5
5
|
const require_oxc = require('./rules/oxc.js');
|
|
6
6
|
const require_promise = require('./rules/promise.js');
|
|
7
|
-
const require_stylistic = require('./rules/stylistic.js');
|
|
8
7
|
const require_typescript = require('./rules/typescript.js');
|
|
9
8
|
const require_unicorn = require('./rules/unicorn.js');
|
|
10
9
|
const require_index$1 = require('./preset/index.js');
|
|
11
10
|
|
|
12
11
|
exports.PLUGIN_COMMON = require_index.PLUGIN_COMMON;
|
|
13
|
-
exports.PLUGIN_JS_COMMON = require_index.PLUGIN_JS_COMMON;
|
|
14
12
|
exports.RULES_ESLINT = require_eslint.RULES_ESLINT;
|
|
15
13
|
exports.RULES_ESLINT_NURSERY = require_eslint.RULES_ESLINT_NURSERY;
|
|
16
14
|
exports.RULES_ESLINT_PEDANTIC = require_eslint.RULES_ESLINT_PEDANTIC;
|
|
@@ -33,7 +31,6 @@ exports.RULES_PROMISE_NURSERY = require_promise.RULES_PROMISE_NURSERY;
|
|
|
33
31
|
exports.RULES_PROMISE_RESTRICTION = require_promise.RULES_PROMISE_RESTRICTION;
|
|
34
32
|
exports.RULES_PROMISE_STYLE = require_promise.RULES_PROMISE_STYLE;
|
|
35
33
|
exports.RULES_PROMISE_SUSPICIOUS = require_promise.RULES_PROMISE_SUSPICIOUS;
|
|
36
|
-
exports.RULES_STYLISTIC = require_stylistic.RULES_STYLISTIC;
|
|
37
34
|
exports.RULES_TYPESCRIPT = require_typescript.RULES_TYPESCRIPT;
|
|
38
35
|
exports.RULES_TYPESCRIPT_NURSERY = require_typescript.RULES_TYPESCRIPT_NURSERY;
|
|
39
36
|
exports.RULES_TYPESCRIPT_PEDANTIC = require_typescript.RULES_TYPESCRIPT_PEDANTIC;
|
|
@@ -41,6 +38,7 @@ exports.RULES_TYPESCRIPT_RESTRICTION = require_typescript.RULES_TYPESCRIPT_RESTR
|
|
|
41
38
|
exports.RULES_TYPESCRIPT_STYLE = require_typescript.RULES_TYPESCRIPT_STYLE;
|
|
42
39
|
exports.RULES_TYPESCRIPT_SUSPICIOUS = require_typescript.RULES_TYPESCRIPT_SUSPICIOUS;
|
|
43
40
|
exports.RULES_UNICORN = require_unicorn.RULES_UNICORN;
|
|
41
|
+
exports.RULES_UNICORN_NURSERY = require_unicorn.RULES_UNICORN_NURSERY;
|
|
44
42
|
exports.RULES_UNICORN_PEDANTIC = require_unicorn.RULES_UNICORN_PEDANTIC;
|
|
45
43
|
exports.RULES_UNICORN_RESTRICTION = require_unicorn.RULES_UNICORN_RESTRICTION;
|
|
46
44
|
exports.RULES_UNICORN_STYLE = require_unicorn.RULES_UNICORN_STYLE;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { PLUGIN_COMMON
|
|
1
|
+
import { PLUGIN_COMMON } from "./plugin/index.mjs";
|
|
2
2
|
import { RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS } from "./rules/eslint.mjs";
|
|
3
3
|
import { RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS } from "./rules/import.mjs";
|
|
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
|
-
import { RULES_STYLISTIC } from "./rules/stylistic.mjs";
|
|
7
6
|
import { RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS } from "./rules/typescript.mjs";
|
|
8
|
-
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";
|
|
9
8
|
import { commonPreset } from "./preset/index.mjs";
|
|
10
9
|
|
|
11
|
-
export { PLUGIN_COMMON,
|
|
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,4 +1,3 @@
|
|
|
1
1
|
declare const PLUGIN_COMMON: ["eslint", "typescript", "unicorn", "oxc", "import", "promise"];
|
|
2
|
-
|
|
3
|
-
export { PLUGIN_COMMON, PLUGIN_JS_COMMON };
|
|
2
|
+
export { PLUGIN_COMMON };
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\nexport { PLUGIN_COMMON };\n"],"mappings":";AAEA,MAAM,gBAAgB;CAClB;CACA;CACA;CACA;CACA;CACA;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\nexport { PLUGIN_COMMON };\n"],"mappings":"AAEA,MAAM,gBAAgB;CAClB;CACA;CACA;CACA;CACA;CACA;AACJ"}
|
|
@@ -3,7 +3,6 @@ const require_eslint = require('../rules/eslint.js');
|
|
|
3
3
|
const require_import = require('../rules/import.js');
|
|
4
4
|
const require_oxc = require('../rules/oxc.js');
|
|
5
5
|
const require_promise = require('../rules/promise.js');
|
|
6
|
-
const require_stylistic = require('../rules/stylistic.js');
|
|
7
6
|
const require_typescript = require('../rules/typescript.js');
|
|
8
7
|
const require_unicorn = require('../rules/unicorn.js');
|
|
9
8
|
let es_toolkit = require("es-toolkit");
|
|
@@ -12,15 +11,13 @@ const commonPreset = () => {
|
|
|
12
11
|
return ({ config: internalConfig }) => {
|
|
13
12
|
return { config: (0, es_toolkit.toMerged)(internalConfig, {
|
|
14
13
|
plugins: [...require_index.PLUGIN_COMMON],
|
|
15
|
-
jsPlugins: [...require_index.PLUGIN_JS_COMMON],
|
|
16
14
|
rules: {
|
|
17
15
|
...require_eslint.RULES_ESLINT,
|
|
18
16
|
...require_typescript.RULES_TYPESCRIPT,
|
|
19
17
|
...require_unicorn.RULES_UNICORN,
|
|
20
18
|
...require_oxc.RULES_OXC,
|
|
21
19
|
...require_import.RULES_IMPORT,
|
|
22
|
-
...require_promise.RULES_PROMISE
|
|
23
|
-
...require_stylistic.RULES_STYLISTIC
|
|
20
|
+
...require_promise.RULES_PROMISE
|
|
24
21
|
}
|
|
25
22
|
}) };
|
|
26
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PLUGIN_COMMON","
|
|
1
|
+
{"version":3,"file":"index.js","names":["PLUGIN_COMMON","RULES_ESLINT","RULES_TYPESCRIPT","RULES_UNICORN","RULES_OXC","RULES_IMPORT","RULES_PROMISE"],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON } from \"#/presets/common/plugin\";\nimport { RULES_ESLINT } from \"#/presets/common/rules/eslint\";\nimport { RULES_IMPORT } from \"#/presets/common/rules/import\";\nimport { RULES_OXC } from \"#/presets/common/rules/oxc\";\nimport { RULES_PROMISE } from \"#/presets/common/rules/promise\";\nimport { RULES_TYPESCRIPT } from \"#/presets/common/rules/typescript\";\nimport { RULES_UNICORN } from \"#/presets/common/rules/unicorn\";\n\nconst commonPreset = (): Preset => {\n return ({ config: internalConfig }): PresetResult => {\n const config: OxlintConfig = toMerged(internalConfig, {\n plugins: [\n ...PLUGIN_COMMON,\n ],\n rules: {\n ...RULES_ESLINT,\n ...RULES_TYPESCRIPT,\n ...RULES_UNICORN,\n ...RULES_OXC,\n ...RULES_IMPORT,\n ...RULES_PROMISE,\n },\n } satisfies OxlintConfig);\n\n return {\n config,\n };\n };\n};\n\nexport { commonPreset };\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAA6B;CAC/B,QAAQ,EAAE,QAAQ,qBAAmC;EAejD,OAAO,EACH,iCAfkC,gBAAgB;GAClD,SAAS,CACL,GAAGA,2BACP;GACA,OAAO;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;GACP;EACJ,CAGS,EACT;CACJ;AACJ"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { PLUGIN_COMMON
|
|
1
|
+
import { PLUGIN_COMMON } from "../plugin/index.mjs";
|
|
2
2
|
import { RULES_ESLINT } from "../rules/eslint.mjs";
|
|
3
3
|
import { RULES_IMPORT } from "../rules/import.mjs";
|
|
4
4
|
import { RULES_OXC } from "../rules/oxc.mjs";
|
|
5
5
|
import { RULES_PROMISE } from "../rules/promise.mjs";
|
|
6
|
-
import { RULES_STYLISTIC } from "../rules/stylistic.mjs";
|
|
7
6
|
import { RULES_TYPESCRIPT } from "../rules/typescript.mjs";
|
|
8
7
|
import { RULES_UNICORN } from "../rules/unicorn.mjs";
|
|
9
8
|
import { toMerged } from "es-toolkit";
|
|
@@ -12,15 +11,13 @@ const commonPreset = () => {
|
|
|
12
11
|
return ({ config: internalConfig }) => {
|
|
13
12
|
return { config: toMerged(internalConfig, {
|
|
14
13
|
plugins: [...PLUGIN_COMMON],
|
|
15
|
-
jsPlugins: [...PLUGIN_JS_COMMON],
|
|
16
14
|
rules: {
|
|
17
15
|
...RULES_ESLINT,
|
|
18
16
|
...RULES_TYPESCRIPT,
|
|
19
17
|
...RULES_UNICORN,
|
|
20
18
|
...RULES_OXC,
|
|
21
19
|
...RULES_IMPORT,
|
|
22
|
-
...RULES_PROMISE
|
|
23
|
-
...RULES_STYLISTIC
|
|
20
|
+
...RULES_PROMISE
|
|
24
21
|
}
|
|
25
22
|
}) };
|
|
26
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON } from \"#/presets/common/plugin\";\nimport { RULES_ESLINT } from \"#/presets/common/rules/eslint\";\nimport { RULES_IMPORT } from \"#/presets/common/rules/import\";\nimport { RULES_OXC } from \"#/presets/common/rules/oxc\";\nimport { RULES_PROMISE } from \"#/presets/common/rules/promise\";\nimport { RULES_TYPESCRIPT } from \"#/presets/common/rules/typescript\";\nimport { RULES_UNICORN } from \"#/presets/common/rules/unicorn\";\n\nconst commonPreset = (): Preset => {\n return ({ config: internalConfig }): PresetResult => {\n const config: OxlintConfig = toMerged(internalConfig, {\n plugins: [\n ...PLUGIN_COMMON,\n ],\n rules: {\n ...RULES_ESLINT,\n ...RULES_TYPESCRIPT,\n ...RULES_UNICORN,\n ...RULES_OXC,\n ...RULES_IMPORT,\n ...RULES_PROMISE,\n },\n } satisfies OxlintConfig);\n\n return {\n config,\n };\n };\n};\n\nexport { commonPreset };\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAA6B;CAC/B,QAAQ,EAAE,QAAQ,qBAAmC;EAejD,OAAO,EACH,QAfyB,SAAS,gBAAgB;GAClD,SAAS,CACL,GAAG,aACP;GACA,OAAO;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;GACP;EACJ,CAGS,EACT;CACJ;AACJ"}
|
|
@@ -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"}
|