@pob/eslint-config 67.8.0 → 67.10.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/lib/_base.js +1 -0
- package/lib/index.js +78 -43
- package/lib/oxlint-fixtures.test.js +14 -5
- package/lib/oxlint-plugins/pob.js +2 -0
- package/lib/oxlint-plugins/regexp.js +5 -0
- package/lib/oxlint-rules.test.js +7 -1
- package/lib/oxlint.test.js +57 -1
- package/lib/test-utils/oxlint.js +15 -6
- package/lib/utils/oxlint.js +3 -0
- package/lib/utils/oxlint.test.js +7 -2
- package/oxlint/base.json +65 -0
- package/oxlint/module.json +6 -0
- package/oxlint/node.json +27 -0
- package/package.json +1 -1
package/lib/_base.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -60,20 +60,32 @@ const oxlintrc = fs.existsSync(oxlintrcPath)
|
|
|
60
60
|
? fs.readFileSync(oxlintrcPath, "utf8")
|
|
61
61
|
: undefined;
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Whether the project's .oxlintrc.json extends a shared oxlint config, like
|
|
65
|
+
* `@pob/eslint-config/oxlint/node.json`.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} configPath
|
|
68
|
+
*/
|
|
69
|
+
export const isOxlintConfigExtended = (configPath) =>
|
|
70
|
+
oxlintrc?.includes(configPath) ?? false;
|
|
71
|
+
|
|
63
72
|
// typescript.json is extended by TypeScript projects only, once regenerated by
|
|
64
73
|
// pob: until then its rules stay in eslint.
|
|
65
|
-
const oxlintTypescript =
|
|
66
|
-
|
|
74
|
+
const oxlintTypescript = isOxlintConfigExtended(
|
|
75
|
+
"@pob/eslint-config/oxlint/typescript.json",
|
|
76
|
+
);
|
|
67
77
|
|
|
68
78
|
// module.json is extended by ES module projects (not configs.nodeCommonjs),
|
|
69
79
|
// once regenerated by pob: until then its rules stay in eslint.
|
|
70
|
-
const oxlintModule =
|
|
71
|
-
|
|
80
|
+
const oxlintModule = isOxlintConfigExtended(
|
|
81
|
+
"@pob/eslint-config/oxlint/module.json",
|
|
82
|
+
);
|
|
72
83
|
|
|
73
84
|
// node.json is extended by projects using the node configs, once regenerated
|
|
74
85
|
// by pob: until then its rules stay in eslint.
|
|
75
|
-
const oxlintNode =
|
|
76
|
-
|
|
86
|
+
const oxlintNode = isOxlintConfigExtended(
|
|
87
|
+
"@pob/eslint-config/oxlint/node.json",
|
|
88
|
+
);
|
|
77
89
|
|
|
78
90
|
// the shared oxlint configs the project extends
|
|
79
91
|
const oxlintSharedConfigs = oxlintrc
|
|
@@ -85,44 +97,67 @@ const oxlintSharedConfigs = oxlintrc
|
|
|
85
97
|
]
|
|
86
98
|
: [];
|
|
87
99
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @param {Parameters<typeof getOxlintConfigRuleNames>[0][]} oxlintConfigs
|
|
102
|
+
*/
|
|
103
|
+
const getOxlintEslintRuleNames = (oxlintConfigs) =>
|
|
104
|
+
new Set(
|
|
105
|
+
oxlintConfigs
|
|
106
|
+
.flatMap((config) => getOxlintConfigRuleNames(config))
|
|
107
|
+
.flatMap((ruleName) => oxlintToEslintRuleNames(ruleName)),
|
|
108
|
+
);
|
|
93
109
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
110
|
+
const oxlintEslintRuleNames = getOxlintEslintRuleNames(oxlintSharedConfigs);
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Turns off the rules checked by oxlint: those of the shared configs of this
|
|
114
|
+
* package the project extends, and those of `additionalOxlintConfigs` (like
|
|
115
|
+
* `@pob/eslint-config-typescript-react/oxlint/react.json`). Must be applied
|
|
116
|
+
* last. Empty when the project does not run oxlint, so the rules are still
|
|
117
|
+
* checked by eslint.
|
|
118
|
+
*
|
|
119
|
+
* @param {Parameters<typeof getOxlintConfigRuleNames>[0][]} [additionalOxlintConfigs]
|
|
120
|
+
* @returns {import("eslint").Linter.Config[]}
|
|
121
|
+
*/
|
|
122
|
+
export const createOxlintConfigs = (additionalOxlintConfigs = []) => {
|
|
123
|
+
if (!oxlintrc) return [];
|
|
124
|
+
const ruleNames = getOxlintEslintRuleNames([
|
|
125
|
+
...oxlintSharedConfigs,
|
|
126
|
+
...additionalOxlintConfigs,
|
|
127
|
+
]);
|
|
128
|
+
return [
|
|
129
|
+
{
|
|
130
|
+
name: "@pob/eslint-config/oxlint",
|
|
131
|
+
rules: Object.fromEntries(
|
|
132
|
+
[...ruleNames].map((ruleName) => [ruleName, "off"]),
|
|
133
|
+
),
|
|
134
|
+
},
|
|
135
|
+
// replaces the processor of previous configs, so it must know every rule
|
|
136
|
+
// checked by oxlint
|
|
137
|
+
{
|
|
138
|
+
name: "@pob/eslint-config/oxlint-disable-directives",
|
|
139
|
+
files: ["**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}"],
|
|
140
|
+
processor: createOxlintDisableDirectivesProcessor(ruleNames),
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const oxlintConfigs = [
|
|
146
|
+
...createOxlintConfigs(),
|
|
147
|
+
// oxlint runs every type-aware rule: eslint no longer needs to build the
|
|
148
|
+
// TypeScript program, its most expensive part
|
|
149
|
+
...(oxlintTypescript
|
|
150
|
+
? [
|
|
151
|
+
{
|
|
152
|
+
name: "@pob/eslint-config/oxlint-typescript",
|
|
153
|
+
files: [`**/*.${tsExtensions}`],
|
|
154
|
+
languageOptions: {
|
|
155
|
+
parserOptions: { project: false, projectService: false },
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
]
|
|
159
|
+
: []),
|
|
160
|
+
];
|
|
126
161
|
|
|
127
162
|
/**
|
|
128
163
|
* Removes the rules checked by oxlint from configs applied after
|
|
@@ -6,7 +6,14 @@ import {
|
|
|
6
6
|
toCanonicalOxlintRuleName,
|
|
7
7
|
} from "./test-utils/oxlint.js";
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const testLintDirs = [
|
|
10
|
+
path.resolve(import.meta.dirname, "../test-lint"),
|
|
11
|
+
// rules of @pob/eslint-config-typescript-react/oxlint/*.json
|
|
12
|
+
path.resolve(
|
|
13
|
+
import.meta.dirname,
|
|
14
|
+
"../../eslint-config-typescript-react/test-lint",
|
|
15
|
+
),
|
|
16
|
+
];
|
|
10
17
|
|
|
11
18
|
/**
|
|
12
19
|
* Rules named by the oxlint-disable directives of `source`, as `plugin/rule`.
|
|
@@ -25,10 +32,12 @@ const getDirectiveRules = (source) =>
|
|
|
25
32
|
.map((rule) => toCanonicalOxlintRuleName(rule)),
|
|
26
33
|
);
|
|
27
34
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
const testLintDirsDirents = await Promise.all(
|
|
36
|
+
testLintDirs.map((testLintDir) =>
|
|
37
|
+
readdir(testLintDir, { recursive: true, withFileTypes: true }),
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
const testLintDirents = testLintDirsDirents.flat();
|
|
32
41
|
|
|
33
42
|
const fixturesDirectiveRules = await Promise.all(
|
|
34
43
|
testLintDirents
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// JS plugin of oxlint/*.json. oxlint resolves a package name from the
|
|
2
|
+
// directory of the config file, not from its real path: when this package is
|
|
3
|
+
// symlinked (pnpm or yarn isolated node_modules), its dependencies are not
|
|
4
|
+
// found. Node resolves the imports of this file from its real path.
|
|
5
|
+
export { default } from "eslint-plugin-regexp";
|
package/lib/oxlint-rules.test.js
CHANGED
|
@@ -76,6 +76,12 @@ describe("oxlint rules inventory", () => {
|
|
|
76
76
|
Object.keys(inventory)
|
|
77
77
|
.filter((name) => inventory[name] === "enabled")
|
|
78
78
|
.toSorted(),
|
|
79
|
-
).toEqual(
|
|
79
|
+
).toEqual(
|
|
80
|
+
// rules of JS plugins (regexp, @pob) are listed in
|
|
81
|
+
// inventory/eslint-rules.json
|
|
82
|
+
getEnabledOxlintConfigRules().filter((name) =>
|
|
83
|
+
plugins.has(name.slice(0, name.indexOf("/"))),
|
|
84
|
+
),
|
|
85
|
+
);
|
|
80
86
|
});
|
|
81
87
|
});
|
package/lib/oxlint.test.js
CHANGED
|
@@ -2,7 +2,11 @@ import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
lintWithOxlint,
|
|
7
|
+
oxlintConfigsDir,
|
|
8
|
+
reactOxlintConfigsDir,
|
|
9
|
+
} from "./test-utils/oxlint.js";
|
|
6
10
|
|
|
7
11
|
const baseConfigPath = path.join(oxlintConfigsDir, "base.json");
|
|
8
12
|
const moduleConfigPath = path.join(oxlintConfigsDir, "module.json");
|
|
@@ -119,6 +123,23 @@ describe("oxlint/node.json", () => {
|
|
|
119
123
|
await rm(path.join(project.cwd, "file.js"));
|
|
120
124
|
expect(await lint(project.cwd, commonjs, "file.cjs")).toEqual([]);
|
|
121
125
|
});
|
|
126
|
+
|
|
127
|
+
// plugins are merged through extends: node.json does not replace the import
|
|
128
|
+
// plugin of base.json
|
|
129
|
+
it("keeps the plugins of base.json", async () => {
|
|
130
|
+
expect(
|
|
131
|
+
summarize(
|
|
132
|
+
await lint(
|
|
133
|
+
project.cwd,
|
|
134
|
+
'"use strict";\n\nexports = require(process.env.NAME);\n',
|
|
135
|
+
"file.cjs",
|
|
136
|
+
),
|
|
137
|
+
),
|
|
138
|
+
).toEqual([
|
|
139
|
+
{ line: 3, rule: "node(no-exports-assign)" },
|
|
140
|
+
{ line: 3, rule: "import(no-dynamic-require)" },
|
|
141
|
+
]);
|
|
142
|
+
});
|
|
122
143
|
});
|
|
123
144
|
|
|
124
145
|
describe("oxlint/typescript.json", () => {
|
|
@@ -205,6 +226,41 @@ describe.each([
|
|
|
205
226
|
});
|
|
206
227
|
});
|
|
207
228
|
|
|
229
|
+
// React projects extend them after node.json: their import/extensions options
|
|
230
|
+
// win, and their plugins do not replace the import plugin of base.json
|
|
231
|
+
describe.each([
|
|
232
|
+
{ fileNames: [], expected: [2] },
|
|
233
|
+
{ fileNames: ["react.json"], expected: [1] },
|
|
234
|
+
{ fileNames: ["react.json", "react-native-web.json"], expected: [1, 3] },
|
|
235
|
+
])(
|
|
236
|
+
"@pob/eslint-config-typescript-react/oxlint/$fileNames",
|
|
237
|
+
({ fileNames, expected }) => {
|
|
238
|
+
const project = useProject({}, [
|
|
239
|
+
baseConfigPath,
|
|
240
|
+
moduleConfigPath,
|
|
241
|
+
nodeConfigPath,
|
|
242
|
+
...fileNames.map((fileName) =>
|
|
243
|
+
path.join(reactOxlintConfigsDir, fileName),
|
|
244
|
+
),
|
|
245
|
+
]);
|
|
246
|
+
|
|
247
|
+
it("overrides import/extensions options", async () => {
|
|
248
|
+
await writeFile(path.join(project.cwd, "t.ts"), "export const t = 1;\n");
|
|
249
|
+
await writeFile(path.join(project.cwd, "m.mts"), "export const m = 1;\n");
|
|
250
|
+
const diagnostics = await lint(
|
|
251
|
+
project.cwd,
|
|
252
|
+
'import { t } from "./t.ts";\nimport { t as t2 } from "./t";\nimport { m } from "./m.mts";\n\nexport const a = [t, t2, m];\n',
|
|
253
|
+
"file.ts",
|
|
254
|
+
);
|
|
255
|
+
expect(
|
|
256
|
+
summarize(diagnostics).filter(
|
|
257
|
+
({ rule }) => rule === "import(extensions)",
|
|
258
|
+
),
|
|
259
|
+
).toEqual(expected.map((line) => ({ line, rule: "import(extensions)" })));
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
);
|
|
263
|
+
|
|
208
264
|
describe("root .oxlintrc.json options", () => {
|
|
209
265
|
const project = useProject({ options: rootConfig.options });
|
|
210
266
|
|
package/lib/test-utils/oxlint.js
CHANGED
|
@@ -15,6 +15,11 @@ export const oxlintConfigsDir = fileURLToPath(
|
|
|
15
15
|
new URL("../../oxlint/", import.meta.url),
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
+
// @pob/eslint-config-typescript-react shares the inventory of this package
|
|
19
|
+
export const reactOxlintConfigsDir = fileURLToPath(
|
|
20
|
+
new URL("../../../eslint-config-typescript-react/oxlint/", import.meta.url),
|
|
21
|
+
);
|
|
22
|
+
|
|
18
23
|
/**
|
|
19
24
|
* Runs oxlint in `cwd` and parses its JSON output.
|
|
20
25
|
*
|
|
@@ -94,18 +99,22 @@ const isRuleEnabled = (ruleEntry) => {
|
|
|
94
99
|
};
|
|
95
100
|
|
|
96
101
|
/**
|
|
97
|
-
* Rules enabled in `oxlint/*.json`
|
|
102
|
+
* Rules enabled in `oxlint/*.json` of this package and of
|
|
103
|
+
* @pob/eslint-config-typescript-react (including `overrides`), as
|
|
104
|
+
* `plugin/rule`.
|
|
98
105
|
*
|
|
99
106
|
* @returns {string[]}
|
|
100
107
|
*/
|
|
101
108
|
export const getEnabledOxlintConfigRules = () => {
|
|
102
109
|
const ruleNames = new Set();
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
const configPaths = [oxlintConfigsDir, reactOxlintConfigsDir].flatMap((dir) =>
|
|
111
|
+
readdirSync(dir)
|
|
112
|
+
.filter((fileName) => fileName.endsWith(".json"))
|
|
113
|
+
.map((fileName) => path.join(dir, fileName)),
|
|
114
|
+
);
|
|
115
|
+
for (const configPath of configPaths) {
|
|
105
116
|
/** @type {{ rules?: Record<string, unknown>; overrides?: { rules?: Record<string, unknown> }[] }} */
|
|
106
|
-
const config = JSON.parse(
|
|
107
|
-
readFileSync(path.join(oxlintConfigsDir, fileName), "utf8"),
|
|
108
|
-
);
|
|
117
|
+
const config = JSON.parse(readFileSync(configPath, "utf8"));
|
|
109
118
|
for (const rules of [
|
|
110
119
|
config.rules,
|
|
111
120
|
...(config.overrides ?? []).map((override) => override.rules),
|
package/lib/utils/oxlint.js
CHANGED
|
@@ -9,6 +9,9 @@ const eslintRulePrefixes = new Map([
|
|
|
9
9
|
["node", "n/"],
|
|
10
10
|
["react", "react/"],
|
|
11
11
|
["jsx_a11y", "jsx-a11y/"],
|
|
12
|
+
// JS plugins: the eslint plugins themselves, loaded by oxlint
|
|
13
|
+
["regexp", "regexp/"],
|
|
14
|
+
["@pob", "@pob/"],
|
|
12
15
|
]);
|
|
13
16
|
|
|
14
17
|
/** oxlint plugins without eslint equivalent in @pob/eslint-config */
|
package/lib/utils/oxlint.test.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
+
import pobPlugin from "@pob/eslint-plugin";
|
|
2
3
|
import { Linter } from "eslint";
|
|
3
4
|
import { builtinRules } from "eslint/use-at-your-own-risk";
|
|
4
5
|
import importPlugin from "eslint-plugin-import-x";
|
|
5
6
|
import nodePlugin from "eslint-plugin-n";
|
|
7
|
+
import regexpPlugin from "eslint-plugin-regexp";
|
|
6
8
|
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
7
9
|
import tseslint from "typescript-eslint";
|
|
8
10
|
import oxlintBaseConfig from "../../oxlint/base.json" with { type: "json" };
|
|
11
|
+
import oxlintNodeConfig from "../../oxlint/node.json" with { type: "json" };
|
|
9
12
|
import oxlintTypescriptConfig from "../../oxlint/typescript.json" with { type: "json" };
|
|
10
13
|
import {
|
|
11
14
|
createOxlintDisableDirectivesProcessor,
|
|
@@ -163,6 +166,8 @@ describe("oxlint/*.json", () => {
|
|
|
163
166
|
["unicorn/", eslintPluginUnicorn],
|
|
164
167
|
["import-x/", importPlugin],
|
|
165
168
|
["n/", nodePlugin],
|
|
169
|
+
["regexp/", regexpPlugin],
|
|
170
|
+
["@pob/", pobPlugin],
|
|
166
171
|
];
|
|
167
172
|
const eslintRuleNames = new Set([
|
|
168
173
|
...builtinRules.keys(),
|
|
@@ -175,8 +180,8 @@ describe("oxlint/*.json", () => {
|
|
|
175
180
|
|
|
176
181
|
it.each([
|
|
177
182
|
...new Set(
|
|
178
|
-
[oxlintBaseConfig, oxlintTypescriptConfig].flatMap(
|
|
179
|
-
getOxlintConfigRuleNames(config),
|
|
183
|
+
[oxlintBaseConfig, oxlintNodeConfig, oxlintTypescriptConfig].flatMap(
|
|
184
|
+
(config) => getOxlintConfigRuleNames(config),
|
|
180
185
|
),
|
|
181
186
|
),
|
|
182
187
|
])("%s turns off existing eslint rules", (oxlintRuleName) => {
|
package/oxlint/base.json
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
"correctness": "off"
|
|
4
4
|
},
|
|
5
5
|
"plugins": ["import"],
|
|
6
|
+
"jsPlugins": [
|
|
7
|
+
{ "name": "@pob", "specifier": "../lib/oxlint-plugins/pob.js" },
|
|
8
|
+
{ "name": "regexp", "specifier": "../lib/oxlint-plugins/regexp.js" }
|
|
9
|
+
],
|
|
6
10
|
"rules": {
|
|
7
11
|
"array-callback-return": [
|
|
8
12
|
"error",
|
|
@@ -876,6 +880,67 @@
|
|
|
876
880
|
}
|
|
877
881
|
],
|
|
878
882
|
"unicorn/throw-new-error": "error",
|
|
883
|
+
"@pob/forbid-non-native-fetch-import": "error",
|
|
884
|
+
"regexp/confusing-quantifier": "warn",
|
|
885
|
+
"regexp/control-character-escape": "error",
|
|
886
|
+
"regexp/match-any": "error",
|
|
887
|
+
"regexp/negation": "error",
|
|
888
|
+
"regexp/no-contradiction-with-assertion": "error",
|
|
889
|
+
"regexp/no-dupe-characters-character-class": "error",
|
|
890
|
+
"regexp/no-dupe-disjunctions": "error",
|
|
891
|
+
"regexp/no-empty-alternative": "warn",
|
|
892
|
+
"regexp/no-empty-capturing-group": "error",
|
|
893
|
+
"regexp/no-empty-character-class": "error",
|
|
894
|
+
"regexp/no-empty-group": "error",
|
|
895
|
+
"regexp/no-empty-lookarounds-assertion": "error",
|
|
896
|
+
"regexp/no-empty-string-literal": "error",
|
|
897
|
+
"regexp/no-escape-backspace": "error",
|
|
898
|
+
"regexp/no-extra-lookaround-assertions": "error",
|
|
899
|
+
"regexp/no-invalid-regexp": "error",
|
|
900
|
+
"regexp/no-invisible-character": "error",
|
|
901
|
+
"regexp/no-lazy-ends": "warn",
|
|
902
|
+
"regexp/no-legacy-features": "error",
|
|
903
|
+
"regexp/no-misleading-capturing-group": "error",
|
|
904
|
+
"regexp/no-misleading-unicode-character": "error",
|
|
905
|
+
"regexp/no-missing-g-flag": "error",
|
|
906
|
+
"regexp/no-non-standard-flag": "error",
|
|
907
|
+
"regexp/no-obscure-range": "error",
|
|
908
|
+
"regexp/no-optional-assertion": "error",
|
|
909
|
+
"regexp/no-potentially-useless-backreference": "warn",
|
|
910
|
+
"regexp/no-super-linear-backtracking": "error",
|
|
911
|
+
"regexp/no-trivially-nested-assertion": "error",
|
|
912
|
+
"regexp/no-trivially-nested-quantifier": "error",
|
|
913
|
+
"regexp/no-unused-capturing-group": "error",
|
|
914
|
+
"regexp/no-useless-assertions": "error",
|
|
915
|
+
"regexp/no-useless-backreference": "error",
|
|
916
|
+
"regexp/no-useless-character-class": "error",
|
|
917
|
+
"regexp/no-useless-dollar-replacements": "error",
|
|
918
|
+
"regexp/no-useless-escape": "error",
|
|
919
|
+
"regexp/no-useless-flag": "warn",
|
|
920
|
+
"regexp/no-useless-lazy": "error",
|
|
921
|
+
"regexp/no-useless-non-capturing-group": "error",
|
|
922
|
+
"regexp/no-useless-quantifier": "error",
|
|
923
|
+
"regexp/no-useless-range": "error",
|
|
924
|
+
"regexp/no-useless-set-operand": "error",
|
|
925
|
+
"regexp/no-useless-string-literal": "error",
|
|
926
|
+
"regexp/no-useless-two-nums-quantifier": "error",
|
|
927
|
+
"regexp/no-zero-quantifier": "error",
|
|
928
|
+
"regexp/optimal-lookaround-quantifier": "warn",
|
|
929
|
+
"regexp/optimal-quantifier-concatenation": "error",
|
|
930
|
+
"regexp/prefer-character-class": "error",
|
|
931
|
+
"regexp/prefer-d": "error",
|
|
932
|
+
"regexp/prefer-plus-quantifier": "error",
|
|
933
|
+
"regexp/prefer-predefined-assertion": "error",
|
|
934
|
+
"regexp/prefer-question-quantifier": "error",
|
|
935
|
+
"regexp/prefer-range": "error",
|
|
936
|
+
"regexp/prefer-set-operation": "error",
|
|
937
|
+
"regexp/prefer-star-quantifier": "error",
|
|
938
|
+
"regexp/prefer-unicode-codepoint-escapes": "error",
|
|
939
|
+
"regexp/prefer-w": "error",
|
|
940
|
+
"regexp/simplify-set-operations": "error",
|
|
941
|
+
"regexp/sort-flags": "error",
|
|
942
|
+
"regexp/strict": "error",
|
|
943
|
+
"regexp/use-ignore-case": "error",
|
|
879
944
|
"use-isnan": [
|
|
880
945
|
"error",
|
|
881
946
|
{
|
package/oxlint/module.json
CHANGED
package/oxlint/node.json
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
+
"plugins": ["node"],
|
|
3
|
+
"jsPlugins": [
|
|
4
|
+
{ "name": "@pob", "specifier": "../lib/oxlint-plugins/pob.js" }
|
|
5
|
+
],
|
|
6
|
+
"rules": {
|
|
7
|
+
"@pob/forbid-non-native-node-imports": "error",
|
|
8
|
+
"node/no-exports-assign": "error"
|
|
9
|
+
},
|
|
2
10
|
"overrides": [
|
|
3
11
|
{
|
|
4
12
|
"files": ["**/*.{js,mjs,mts,ts,tsx}"],
|
|
5
13
|
"rules": {
|
|
6
14
|
"unicorn/prefer-module": "error"
|
|
7
15
|
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"files": ["**/*.{cjs,cts}"],
|
|
19
|
+
"rules": {
|
|
20
|
+
"node/no-new-require": "error",
|
|
21
|
+
"node/no-path-concat": "error"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"files": ["**/*.{js,mjs,cts,mts,ts,tsx}"],
|
|
26
|
+
"rules": {
|
|
27
|
+
"import/extensions": ["error", "ignorePackages"]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"files": ["**/scripts/**/*.cjs"],
|
|
32
|
+
"rules": {
|
|
33
|
+
"import/extensions": "off"
|
|
34
|
+
}
|
|
8
35
|
}
|
|
9
36
|
]
|
|
10
37
|
}
|