@apst/oxlint 0.1.0 → 0.2.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/dist/presets/common/index.d.ts +2 -3
- package/dist/presets/common/index.js +0 -3
- package/dist/presets/common/index.mjs +2 -3
- 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/typescript.d.ts +2 -2
- package/dist/presets/common/rules/typescript.js +1 -1
- package/dist/presets/common/rules/typescript.js.map +1 -1
- package/dist/presets/common/rules/typescript.mjs +1 -1
- package/dist/presets/common/rules/typescript.mjs.map +1 -1
- package/package.json +2 -4
- 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
|
@@ -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
8
|
import { RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS } from "./rules/unicorn.js";
|
|
10
|
-
export { PLUGIN_COMMON,
|
|
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 };
|
|
@@ -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;
|
|
@@ -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
7
|
import { RULES_UNICORN, 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_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"}
|
|
@@ -125,7 +125,7 @@ declare const RULES_TYPESCRIPT_STYLE: {
|
|
|
125
125
|
}];
|
|
126
126
|
readonly "typescript/consistent-type-definitions": ["error", "type"];
|
|
127
127
|
readonly "typescript/consistent-type-imports": ["error", {
|
|
128
|
-
readonly
|
|
128
|
+
readonly disallowTypeAnnotations: true;
|
|
129
129
|
readonly fixStyle: "separate-type-imports";
|
|
130
130
|
readonly prefer: "type-imports";
|
|
131
131
|
}];
|
|
@@ -155,7 +155,7 @@ declare const RULES_TYPESCRIPT: {
|
|
|
155
155
|
}];
|
|
156
156
|
readonly "typescript/consistent-type-definitions": ["error", "type"];
|
|
157
157
|
readonly "typescript/consistent-type-imports": ["error", {
|
|
158
|
-
readonly
|
|
158
|
+
readonly disallowTypeAnnotations: true;
|
|
159
159
|
readonly fixStyle: "separate-type-imports";
|
|
160
160
|
readonly prefer: "type-imports";
|
|
161
161
|
}];
|
|
@@ -116,7 +116,7 @@ const RULES_TYPESCRIPT_STYLE = {
|
|
|
116
116
|
"typescript/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
117
117
|
"typescript/consistent-type-definitions": ["error", "type"],
|
|
118
118
|
"typescript/consistent-type-imports": ["error", {
|
|
119
|
-
|
|
119
|
+
disallowTypeAnnotations: true,
|
|
120
120
|
fixStyle: "separate-type-imports",
|
|
121
121
|
prefer: "type-imports"
|
|
122
122
|
}],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.js","names":[],"sources":["../../../../src/presets/common/rules/typescript.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_TYPESCRIPT_NURSERY = {\n \"typescript/consistent-return\": [\n \"error\",\n {\n treatUndefinedAsUnspecified: false,\n },\n ],\n \"typescript/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: false,\n },\n ],\n \"typescript/dot-notation\": [\n \"error\",\n {\n allowIndexSignaturePropertyAccess: false,\n allowKeywords: true,\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n },\n ],\n \"typescript/no-unnecessary-type-conversion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/prefer-optional-chain\": [\n \"error\",\n {\n allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,\n checkAny: true,\n checkBigInt: true,\n checkBoolean: true,\n checkNumber: true,\n checkString: true,\n checkUnknown: true,\n requireNullish: false,\n },\n ],\n \"typescript/prefer-readonly\": [\n \"error\",\n {\n onlyInlineLambdas: false,\n },\n ],\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/strict-void-return\": [\n \"error\",\n {\n allowReturnAny: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_PEDANTIC = {\n \"typescript/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n arguments: true,\n attributes: true,\n inheritedMethods: true,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: false,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n \"typescript/prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n allowThrowingAny: false,\n allowThrowingUnknown: false,\n },\n ],\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/restrict-plus-operands\": [\n \"error\",\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumberAndString: true,\n allowRegExp: true,\n skipCompoundAssignments: false,\n },\n ],\n \"typescript/return-await\": [\n \"error\",\n \"always\",\n ],\n \"typescript/strict-boolean-expressions\": [\n \"error\",\n {\n allowAny: true,\n allowNullableBoolean: false,\n allowNullableEnum: false,\n allowNullableNumber: false,\n allowNullableObject: true,\n allowNullableString: false,\n allowNumber: true,\n allowString: true,\n },\n ],\n \"typescript/switch-exhaustiveness-check\": [\n \"error\",\n {\n allowDefaultCaseForExhaustiveSwitch: true,\n considerDefaultExhaustiveForUnions: true,\n requireDefaultForNonUnion: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_RESTRICTION = {\n \"typescript/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\",\n },\n ],\n \"typescript/no-import-type-side-effects\": \"error\",\n \"typescript/no-namespace\": [\n \"error\",\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n \"typescript/no-non-null-asserted-nullish-coalescing\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/promise-function-async\": [\n \"error\",\n {\n allowAny: true,\n checkArrowFunctions: true,\n checkFunctionDeclarations: true,\n checkFunctionExpressions: true,\n checkMethodDeclarations: true,\n },\n ],\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_STYLE = {\n \"typescript/consistent-type-assertions\": [\n \"error\",\n {\n assertionStyle: \"as\",\n },\n ],\n \"typescript/consistent-type-definitions\": [\n \"error\",\n \"type\",\n ],\n \"typescript/consistent-type-imports\": [\n \"error\",\n {\n
|
|
1
|
+
{"version":3,"file":"typescript.js","names":[],"sources":["../../../../src/presets/common/rules/typescript.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_TYPESCRIPT_NURSERY = {\n \"typescript/consistent-return\": [\n \"error\",\n {\n treatUndefinedAsUnspecified: false,\n },\n ],\n \"typescript/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: false,\n },\n ],\n \"typescript/dot-notation\": [\n \"error\",\n {\n allowIndexSignaturePropertyAccess: false,\n allowKeywords: true,\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n },\n ],\n \"typescript/no-unnecessary-type-conversion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/prefer-optional-chain\": [\n \"error\",\n {\n allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,\n checkAny: true,\n checkBigInt: true,\n checkBoolean: true,\n checkNumber: true,\n checkString: true,\n checkUnknown: true,\n requireNullish: false,\n },\n ],\n \"typescript/prefer-readonly\": [\n \"error\",\n {\n onlyInlineLambdas: false,\n },\n ],\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/strict-void-return\": [\n \"error\",\n {\n allowReturnAny: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_PEDANTIC = {\n \"typescript/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n arguments: true,\n attributes: true,\n inheritedMethods: true,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: false,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n \"typescript/prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n allowThrowingAny: false,\n allowThrowingUnknown: false,\n },\n ],\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/restrict-plus-operands\": [\n \"error\",\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumberAndString: true,\n allowRegExp: true,\n skipCompoundAssignments: false,\n },\n ],\n \"typescript/return-await\": [\n \"error\",\n \"always\",\n ],\n \"typescript/strict-boolean-expressions\": [\n \"error\",\n {\n allowAny: true,\n allowNullableBoolean: false,\n allowNullableEnum: false,\n allowNullableNumber: false,\n allowNullableObject: true,\n allowNullableString: false,\n allowNumber: true,\n allowString: true,\n },\n ],\n \"typescript/switch-exhaustiveness-check\": [\n \"error\",\n {\n allowDefaultCaseForExhaustiveSwitch: true,\n considerDefaultExhaustiveForUnions: true,\n requireDefaultForNonUnion: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_RESTRICTION = {\n \"typescript/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\",\n },\n ],\n \"typescript/no-import-type-side-effects\": \"error\",\n \"typescript/no-namespace\": [\n \"error\",\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n \"typescript/no-non-null-asserted-nullish-coalescing\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/promise-function-async\": [\n \"error\",\n {\n allowAny: true,\n checkArrowFunctions: true,\n checkFunctionDeclarations: true,\n checkFunctionExpressions: true,\n checkMethodDeclarations: true,\n },\n ],\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_STYLE = {\n \"typescript/consistent-type-assertions\": [\n \"error\",\n {\n assertionStyle: \"as\",\n },\n ],\n \"typescript/consistent-type-definitions\": [\n \"error\",\n \"type\",\n ],\n \"typescript/consistent-type-imports\": [\n \"error\",\n {\n disallowTypeAnnotations: true,\n fixStyle: \"separate-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"typescript/no-empty-interface\": [\n \"error\",\n {\n allowSingleExtends: true,\n },\n ],\n \"typescript/parameter-properties\": [\n \"error\",\n {\n prefer: \"class-property\",\n },\n ],\n \"typescript/prefer-function-type\": \"error\",\n \"typescript/prefer-reduce-type-parameter\": \"error\",\n \"typescript/prefer-return-this-type\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_SUSPICIOUS = {\n \"typescript/no-confusing-non-null-assertion\": \"error\",\n \"typescript/no-unnecessary-template-expression\": \"error\",\n \"typescript/no-unnecessary-type-constraint\": \"error\",\n \"typescript/no-unsafe-enum-comparison\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT = {\n ...RULES_TYPESCRIPT_NURSERY,\n ...RULES_TYPESCRIPT_PEDANTIC,\n ...RULES_TYPESCRIPT_RESTRICTION,\n ...RULES_TYPESCRIPT_STYLE,\n ...RULES_TYPESCRIPT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_TYPESCRIPT,\n RULES_TYPESCRIPT_NURSERY,\n RULES_TYPESCRIPT_PEDANTIC,\n RULES_TYPESCRIPT_RESTRICTION,\n RULES_TYPESCRIPT_STYLE,\n RULES_TYPESCRIPT_SUSPICIOUS,\n};\n"],"mappings":"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"}
|
|
@@ -115,7 +115,7 @@ const RULES_TYPESCRIPT_STYLE = {
|
|
|
115
115
|
"typescript/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
116
116
|
"typescript/consistent-type-definitions": ["error", "type"],
|
|
117
117
|
"typescript/consistent-type-imports": ["error", {
|
|
118
|
-
|
|
118
|
+
disallowTypeAnnotations: true,
|
|
119
119
|
fixStyle: "separate-type-imports",
|
|
120
120
|
prefer: "type-imports"
|
|
121
121
|
}],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.mjs","names":[],"sources":["../../../../src/presets/common/rules/typescript.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_TYPESCRIPT_NURSERY = {\n \"typescript/consistent-return\": [\n \"error\",\n {\n treatUndefinedAsUnspecified: false,\n },\n ],\n \"typescript/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: false,\n },\n ],\n \"typescript/dot-notation\": [\n \"error\",\n {\n allowIndexSignaturePropertyAccess: false,\n allowKeywords: true,\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n },\n ],\n \"typescript/no-unnecessary-type-conversion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/prefer-optional-chain\": [\n \"error\",\n {\n allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,\n checkAny: true,\n checkBigInt: true,\n checkBoolean: true,\n checkNumber: true,\n checkString: true,\n checkUnknown: true,\n requireNullish: false,\n },\n ],\n \"typescript/prefer-readonly\": [\n \"error\",\n {\n onlyInlineLambdas: false,\n },\n ],\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/strict-void-return\": [\n \"error\",\n {\n allowReturnAny: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_PEDANTIC = {\n \"typescript/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n arguments: true,\n attributes: true,\n inheritedMethods: true,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: false,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n \"typescript/prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n allowThrowingAny: false,\n allowThrowingUnknown: false,\n },\n ],\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/restrict-plus-operands\": [\n \"error\",\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumberAndString: true,\n allowRegExp: true,\n skipCompoundAssignments: false,\n },\n ],\n \"typescript/return-await\": [\n \"error\",\n \"always\",\n ],\n \"typescript/strict-boolean-expressions\": [\n \"error\",\n {\n allowAny: true,\n allowNullableBoolean: false,\n allowNullableEnum: false,\n allowNullableNumber: false,\n allowNullableObject: true,\n allowNullableString: false,\n allowNumber: true,\n allowString: true,\n },\n ],\n \"typescript/switch-exhaustiveness-check\": [\n \"error\",\n {\n allowDefaultCaseForExhaustiveSwitch: true,\n considerDefaultExhaustiveForUnions: true,\n requireDefaultForNonUnion: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_RESTRICTION = {\n \"typescript/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\",\n },\n ],\n \"typescript/no-import-type-side-effects\": \"error\",\n \"typescript/no-namespace\": [\n \"error\",\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n \"typescript/no-non-null-asserted-nullish-coalescing\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/promise-function-async\": [\n \"error\",\n {\n allowAny: true,\n checkArrowFunctions: true,\n checkFunctionDeclarations: true,\n checkFunctionExpressions: true,\n checkMethodDeclarations: true,\n },\n ],\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_STYLE = {\n \"typescript/consistent-type-assertions\": [\n \"error\",\n {\n assertionStyle: \"as\",\n },\n ],\n \"typescript/consistent-type-definitions\": [\n \"error\",\n \"type\",\n ],\n \"typescript/consistent-type-imports\": [\n \"error\",\n {\n
|
|
1
|
+
{"version":3,"file":"typescript.mjs","names":[],"sources":["../../../../src/presets/common/rules/typescript.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_TYPESCRIPT_NURSERY = {\n \"typescript/consistent-return\": [\n \"error\",\n {\n treatUndefinedAsUnspecified: false,\n },\n ],\n \"typescript/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: false,\n },\n ],\n \"typescript/dot-notation\": [\n \"error\",\n {\n allowIndexSignaturePropertyAccess: false,\n allowKeywords: true,\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n },\n ],\n \"typescript/no-unnecessary-type-conversion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/prefer-optional-chain\": [\n \"error\",\n {\n allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,\n checkAny: true,\n checkBigInt: true,\n checkBoolean: true,\n checkNumber: true,\n checkString: true,\n checkUnknown: true,\n requireNullish: false,\n },\n ],\n \"typescript/prefer-readonly\": [\n \"error\",\n {\n onlyInlineLambdas: false,\n },\n ],\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/strict-void-return\": [\n \"error\",\n {\n allowReturnAny: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_PEDANTIC = {\n \"typescript/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n arguments: true,\n attributes: true,\n inheritedMethods: true,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: false,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n \"typescript/prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n allowThrowingAny: false,\n allowThrowingUnknown: false,\n },\n ],\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/restrict-plus-operands\": [\n \"error\",\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumberAndString: true,\n allowRegExp: true,\n skipCompoundAssignments: false,\n },\n ],\n \"typescript/return-await\": [\n \"error\",\n \"always\",\n ],\n \"typescript/strict-boolean-expressions\": [\n \"error\",\n {\n allowAny: true,\n allowNullableBoolean: false,\n allowNullableEnum: false,\n allowNullableNumber: false,\n allowNullableObject: true,\n allowNullableString: false,\n allowNumber: true,\n allowString: true,\n },\n ],\n \"typescript/switch-exhaustiveness-check\": [\n \"error\",\n {\n allowDefaultCaseForExhaustiveSwitch: true,\n considerDefaultExhaustiveForUnions: true,\n requireDefaultForNonUnion: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_RESTRICTION = {\n \"typescript/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\",\n },\n ],\n \"typescript/no-import-type-side-effects\": \"error\",\n \"typescript/no-namespace\": [\n \"error\",\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n \"typescript/no-non-null-asserted-nullish-coalescing\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/promise-function-async\": [\n \"error\",\n {\n allowAny: true,\n checkArrowFunctions: true,\n checkFunctionDeclarations: true,\n checkFunctionExpressions: true,\n checkMethodDeclarations: true,\n },\n ],\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_STYLE = {\n \"typescript/consistent-type-assertions\": [\n \"error\",\n {\n assertionStyle: \"as\",\n },\n ],\n \"typescript/consistent-type-definitions\": [\n \"error\",\n \"type\",\n ],\n \"typescript/consistent-type-imports\": [\n \"error\",\n {\n disallowTypeAnnotations: true,\n fixStyle: \"separate-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"typescript/no-empty-interface\": [\n \"error\",\n {\n allowSingleExtends: true,\n },\n ],\n \"typescript/parameter-properties\": [\n \"error\",\n {\n prefer: \"class-property\",\n },\n ],\n \"typescript/prefer-function-type\": \"error\",\n \"typescript/prefer-reduce-type-parameter\": \"error\",\n \"typescript/prefer-return-this-type\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_SUSPICIOUS = {\n \"typescript/no-confusing-non-null-assertion\": \"error\",\n \"typescript/no-unnecessary-template-expression\": \"error\",\n \"typescript/no-unnecessary-type-constraint\": \"error\",\n \"typescript/no-unsafe-enum-comparison\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT = {\n ...RULES_TYPESCRIPT_NURSERY,\n ...RULES_TYPESCRIPT_PEDANTIC,\n ...RULES_TYPESCRIPT_RESTRICTION,\n ...RULES_TYPESCRIPT_STYLE,\n ...RULES_TYPESCRIPT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_TYPESCRIPT,\n RULES_TYPESCRIPT_NURSERY,\n RULES_TYPESCRIPT_PEDANTIC,\n RULES_TYPESCRIPT_RESTRICTION,\n RULES_TYPESCRIPT_STYLE,\n RULES_TYPESCRIPT_SUSPICIOUS,\n};\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apst/oxlint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A shareable Oxlint configuration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oxlint",
|
|
@@ -79,9 +79,7 @@
|
|
|
79
79
|
"dist"
|
|
80
80
|
],
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"
|
|
83
|
-
"es-toolkit": "^1.40.0",
|
|
84
|
-
"ts-vista": "~0.2.3"
|
|
82
|
+
"es-toolkit": "^1.40.0"
|
|
85
83
|
},
|
|
86
84
|
"devDependencies": {
|
|
87
85
|
"oxlint": "1.45.0"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `@stylistic/eslint-plugin` is used to enforce
|
|
3
|
-
* some stylistic rules that are currently missing in `oxfmt`.
|
|
4
|
-
*/
|
|
5
|
-
declare const RULES_STYLISTIC: {
|
|
6
|
-
readonly "@stylistic/eslint-plugin/array-bracket-newline": ["error", {
|
|
7
|
-
readonly multiline: true;
|
|
8
|
-
readonly minItems: 1;
|
|
9
|
-
}];
|
|
10
|
-
readonly "@stylistic/eslint-plugin/array-element-newline": ["error", {
|
|
11
|
-
readonly multiline: true;
|
|
12
|
-
readonly minItems: 1;
|
|
13
|
-
}];
|
|
14
|
-
readonly "@stylistic/eslint-plugin/comma-dangle": ["error", "always-multiline"];
|
|
15
|
-
readonly "@stylistic/eslint-plugin/indent": ["error", 4];
|
|
16
|
-
};
|
|
17
|
-
export { RULES_STYLISTIC };
|
|
18
|
-
//# sourceMappingURL=stylistic.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const RULES_STYLISTIC = {
|
|
3
|
-
"@stylistic/eslint-plugin/array-bracket-newline": ["error", {
|
|
4
|
-
multiline: true,
|
|
5
|
-
minItems: 1
|
|
6
|
-
}],
|
|
7
|
-
"@stylistic/eslint-plugin/array-element-newline": ["error", {
|
|
8
|
-
multiline: true,
|
|
9
|
-
minItems: 1
|
|
10
|
-
}],
|
|
11
|
-
"@stylistic/eslint-plugin/comma-dangle": ["error", "always-multiline"],
|
|
12
|
-
"@stylistic/eslint-plugin/indent": ["error", 4]
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
exports.RULES_STYLISTIC = RULES_STYLISTIC;
|
|
16
|
-
//# sourceMappingURL=stylistic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stylistic.js","names":[],"sources":["../../../../src/presets/common/rules/stylistic.ts"],"sourcesContent":["/**\n * `@stylistic/eslint-plugin` is used to enforce\n * some stylistic rules that are currently missing in `oxfmt`.\n */\n\nimport type { UnprefixedRuleOptions as RawRules } from \"@stylistic/eslint-plugin\";\n\ntype FirstElement<T> = T extends readonly [\n infer U,\n ...unknown[],\n]\n ? U\n : T extends readonly (infer U)[]\n ? U\n : never;\n\ntype Rules<T extends RawRules = RawRules> = {\n [K in keyof T as `@stylistic/eslint-plugin/${K & string}`]?: [\n (\"allow\" | \"off\" | \"warn\" | \"error\" | \"deny\") | number,\n FirstElement<T[K]>,\n ];\n};\n\nconst RULES_STYLISTIC = {\n \"@stylistic/eslint-plugin/array-bracket-newline\": [\n \"error\",\n {\n multiline: true,\n minItems: 1,\n },\n ],\n \"@stylistic/eslint-plugin/array-element-newline\": [\n \"error\",\n {\n multiline: true,\n minItems: 1,\n },\n ],\n // make every array element come with a trailing comma\n \"@stylistic/eslint-plugin/comma-dangle\": [\n \"error\",\n \"always-multiline\",\n ],\n // make every newline rules consistent with 4 spaces indent\n \"@stylistic/eslint-plugin/indent\": [\n \"error\",\n 4,\n ],\n} as const satisfies Rules;\n\nexport { RULES_STYLISTIC };\n"],"mappings":";AAuBA,MAAM,kBAAkB;CACpB,kDAAkD,CAC9C,SACA;EACI,WAAW;EACX,UAAU;CACd,CACJ;CACA,kDAAkD,CAC9C,SACA;EACI,WAAW;EACX,UAAU;CACd,CACJ;CAEA,yCAAyC,CACrC,SACA,kBACJ;CAEA,mCAAmC,CAC/B,SACA,CACJ;AACJ"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const RULES_STYLISTIC = {
|
|
2
|
-
"@stylistic/eslint-plugin/array-bracket-newline": ["error", {
|
|
3
|
-
multiline: true,
|
|
4
|
-
minItems: 1
|
|
5
|
-
}],
|
|
6
|
-
"@stylistic/eslint-plugin/array-element-newline": ["error", {
|
|
7
|
-
multiline: true,
|
|
8
|
-
minItems: 1
|
|
9
|
-
}],
|
|
10
|
-
"@stylistic/eslint-plugin/comma-dangle": ["error", "always-multiline"],
|
|
11
|
-
"@stylistic/eslint-plugin/indent": ["error", 4]
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { RULES_STYLISTIC };
|
|
15
|
-
//# sourceMappingURL=stylistic.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stylistic.mjs","names":[],"sources":["../../../../src/presets/common/rules/stylistic.ts"],"sourcesContent":["/**\n * `@stylistic/eslint-plugin` is used to enforce\n * some stylistic rules that are currently missing in `oxfmt`.\n */\n\nimport type { UnprefixedRuleOptions as RawRules } from \"@stylistic/eslint-plugin\";\n\ntype FirstElement<T> = T extends readonly [\n infer U,\n ...unknown[],\n]\n ? U\n : T extends readonly (infer U)[]\n ? U\n : never;\n\ntype Rules<T extends RawRules = RawRules> = {\n [K in keyof T as `@stylistic/eslint-plugin/${K & string}`]?: [\n (\"allow\" | \"off\" | \"warn\" | \"error\" | \"deny\") | number,\n FirstElement<T[K]>,\n ];\n};\n\nconst RULES_STYLISTIC = {\n \"@stylistic/eslint-plugin/array-bracket-newline\": [\n \"error\",\n {\n multiline: true,\n minItems: 1,\n },\n ],\n \"@stylistic/eslint-plugin/array-element-newline\": [\n \"error\",\n {\n multiline: true,\n minItems: 1,\n },\n ],\n // make every array element come with a trailing comma\n \"@stylistic/eslint-plugin/comma-dangle\": [\n \"error\",\n \"always-multiline\",\n ],\n // make every newline rules consistent with 4 spaces indent\n \"@stylistic/eslint-plugin/indent\": [\n \"error\",\n 4,\n ],\n} as const satisfies Rules;\n\nexport { RULES_STYLISTIC };\n"],"mappings":"AAuBA,MAAM,kBAAkB;CACpB,kDAAkD,CAC9C,SACA;EACI,WAAW;EACX,UAAU;CACd,CACJ;CACA,kDAAkD,CAC9C,SACA;EACI,WAAW;EACX,UAAU;CACd,CACJ;CAEA,yCAAyC,CACrC,SACA,kBACJ;CAEA,mCAAmC,CAC/B,SACA,CACJ;AACJ"}
|