refactor: migrate command lint to oxlint
parent
46b4ce81e4
commit
55b54e24fe
|
|
@ -28,8 +28,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vben/oxlint-config": "workspace:*",
|
"@vben/oxlint-config": "workspace:*",
|
||||||
"eslint-config-turbo": "catalog:",
|
"eslint-config-turbo": "catalog:"
|
||||||
"eslint-plugin-command": "catalog:"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "catalog:",
|
"@eslint/js": "catalog:",
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import createCommand from 'eslint-plugin-command/config';
|
|
||||||
|
|
||||||
export async function command() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
...createCommand(),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
export * from './command';
|
|
||||||
export * from './ignores';
|
export * from './ignores';
|
||||||
export * from './javascript';
|
export * from './javascript';
|
||||||
export * from './jsonc';
|
export * from './jsonc';
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import type { Linter } from 'eslint';
|
import type { Linter } from 'eslint';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
command,
|
|
||||||
ignores,
|
ignores,
|
||||||
javascript,
|
javascript,
|
||||||
jsonc,
|
jsonc,
|
||||||
|
|
@ -34,7 +33,6 @@ async function defineConfig(config: FlatConfig[] = []) {
|
||||||
node(),
|
node(),
|
||||||
perfectionist(),
|
perfectionist(),
|
||||||
unicorn(),
|
unicorn(),
|
||||||
command(),
|
|
||||||
turbo(),
|
turbo(),
|
||||||
yaml(),
|
yaml(),
|
||||||
pnpm(),
|
pnpm(),
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-plugin-eslint-comments": "catalog:",
|
"@eslint-community/eslint-plugin-eslint-comments": "catalog:",
|
||||||
"eslint-plugin-better-tailwindcss": "catalog:",
|
"eslint-plugin-better-tailwindcss": "catalog:",
|
||||||
|
"eslint-plugin-command": "catalog:",
|
||||||
"oxlint": "catalog:"
|
"oxlint": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
import type { OxlintConfig } from 'oxlint';
|
||||||
|
|
||||||
|
const command: OxlintConfig = {
|
||||||
|
jsPlugins: [
|
||||||
|
{
|
||||||
|
name: 'command',
|
||||||
|
specifier: 'eslint-plugin-command',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
'command/command': 'error',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export { command };
|
||||||
|
|
@ -2,6 +2,7 @@ import type { OxlintConfig } from 'oxlint';
|
||||||
|
|
||||||
import { defineConfig as defineOxlintConfig } from 'oxlint';
|
import { defineConfig as defineOxlintConfig } from 'oxlint';
|
||||||
|
|
||||||
|
import { command } from './command';
|
||||||
import { comments } from './comments';
|
import { comments } from './comments';
|
||||||
import { ignores } from './ignores';
|
import { ignores } from './ignores';
|
||||||
import { importPluginConfig } from './import';
|
import { importPluginConfig } from './import';
|
||||||
|
|
@ -61,6 +62,7 @@ function mergeOxlintConfigs(...configs: OxlintConfig[]): OxlintConfig {
|
||||||
const oxlintConfig = defineOxlintConfig(
|
const oxlintConfig = defineOxlintConfig(
|
||||||
mergeOxlintConfigs(
|
mergeOxlintConfigs(
|
||||||
javascript,
|
javascript,
|
||||||
|
command,
|
||||||
comments,
|
comments,
|
||||||
ignores,
|
ignores,
|
||||||
plugins,
|
plugins,
|
||||||
|
|
@ -76,6 +78,7 @@ const oxlintConfig = defineOxlintConfig(
|
||||||
);
|
);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
command,
|
||||||
comments,
|
comments,
|
||||||
ignores,
|
ignores,
|
||||||
importPluginConfig,
|
importPluginConfig,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue