Skip to content

Commit b66e3c2

Browse files
authored
fix!: do not include no-unused-vars for vue and svelte files (#332)
**BREAKING CHANGE**: If you want use the `oxlint.configs['flat/*]` configuration, you need to spread the result. Old: ``` export default [ oxlint.configs['flat/recommended'] ]; ``` New: ``` export default [ ...oxlint.configs['flat/recommended'] ]; ``` closes #316
1 parent d763d33 commit b66e3c2

13 files changed

+336
-142
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Example:
2828
import oxlint from 'eslint-plugin-oxlint';
2929
export default [
3030
...// other plugins
31-
oxlint.configs['flat/recommended'], // oxlint should be the last one
31+
...oxlint.configs['flat/recommended'], // oxlint should be the last one
3232
];
3333
```
3434

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"eslint-config-prettier": "^10.0.0",
6565
"eslint-plugin-unicorn": "^57.0.0",
6666
"husky": "^9.1.6",
67+
"jiti": "^2.4.2",
6768
"lint-staged": "^15.2.10",
6869
"memfs": "^4.14.0",
6970
"oxlint": "^0.15.11",

pnpm-lock.yaml

+56-54
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/__snapshots__/rules-generator.test.ts.snap

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
exports[`RulesGenerator > RulesGenerator generates rules correctly > byCategory 1`] = `
44
"// These rules are automatically generated by scripts/generate-rules.ts
55
6-
const styleRules = {
6+
const styleRules: Record<string, "off"> = {
77
'rulename-with-mod': "off"
8-
} as const;
8+
};
99
10-
const correctnessRules = {
10+
const correctnessRules: Record<string, "off"> = {
1111
'@typescript-eslint/rulename-without-mod': "off"
12-
} as const;
12+
};
1313
1414
export {
1515
styleRules,
@@ -20,13 +20,13 @@ export {
2020
exports[`RulesGenerator > RulesGenerator generates rules correctly > byScope 1`] = `
2121
"// These rules are automatically generated by scripts/generate-rules.ts
2222
23-
const eslintRules = {
23+
const eslintRules: Record<string, "off"> = {
2424
'rulename-with-mod': "off"
25-
} as const;
25+
};
2626
27-
const typescriptRules = {
27+
const typescriptRules: Record<string, "off"> = {
2828
'@typescript-eslint/rulename-without-mod': "off"
29-
} as const;
29+
};
3030
3131
export {
3232
eslintRules,

scripts/rules-generator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ export class RulesGenerator {
5656
exportGrouping.push(grouping);
5757
const rules = rulesMap.get(grouping);
5858

59-
code += `const ${camelCase(grouping)}Rules = {\n`;
59+
code += `const ${camelCase(grouping)}Rules: Record<string, "off"> = {\n`;
6060

6161
code += rules
6262
?.map((rule) => {
6363
return ` '${rule.replaceAll('_', '-')}': "off"`;
6464
})
6565
.join(',\n');
66-
code += '\n} as const;\n\n';
66+
code += '\n};\n\n';
6767
}
6868

6969
code += 'export {\n';

0 commit comments

Comments
 (0)