Skip to content

Commit 43efef0

Browse files
committedMay 3, 2024
feat: add eslint-plugin-command
1 parent 451f28c commit 43efef0

File tree

6 files changed

+26
-0
lines changed

6 files changed

+26
-0
lines changed
 

Diff for: ‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"eslint-config-prettier": "^9.1.0",
4040
"eslint-define-config": "^1.24.1",
4141
"eslint-plugin-antfu": "^2.1.2",
42+
"eslint-plugin-command": "^0.1.5",
4243
"eslint-plugin-eslint-comments": "^3.2.0",
4344
"eslint-plugin-import-x": "^0.5.0",
4445
"eslint-plugin-jsonc": "^2.15.1",

Diff for: ‎pnpm-lock.yaml

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

Diff for: ‎src/configs/command.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { configCommand } from '../plugins'
2+
import type { FlatESLintConfigItem } from 'eslint-define-config'
3+
4+
export const command: FlatESLintConfigItem[] = [configCommand()]

Diff for: ‎src/configs/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export * from './command'
12
export * from './comments'
23
export * from './ignores'
34
export * from './imports'

Diff for: ‎src/plugins.ts

+2
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@ export * as pluginYml from 'eslint-plugin-yml'
5252
export * as parserVue from 'vue-eslint-parser'
5353
export * as parserYml from 'yaml-eslint-parser'
5454
export * as parserJsonc from 'jsonc-eslint-parser'
55+
56+
export { default as configCommand } from 'eslint-plugin-command/config'

Diff for: ‎src/presets.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { hasUnocss, hasVue } from './env'
22
import {
3+
command,
34
comments,
45
ignores,
56
imports,
@@ -60,6 +61,7 @@ export { presetBasic as basic, presetAll as all }
6061
export function sxzz(
6162
config: FlatESLintConfigItem | FlatESLintConfigItem[] = [],
6263
{
64+
command: enableCommand = true,
6365
markdown: enableMarkdown = true,
6466
prettier: enablePrettier = true,
6567
unocss: enableUnocss = hasUnocss,
@@ -74,6 +76,7 @@ export function sxzz(
7476
/** UnoCSS support. Auto-enable. */
7577
unocss: boolean
7678
sortKeys: boolean
79+
command: boolean
7780
}> = {},
7881
): FlatESLintConfigItem[] {
7982
const configs = [...presetBasic, ...yml, ...presetJsonc]
@@ -89,6 +92,9 @@ export function sxzz(
8992
if (enablePrettier) {
9093
configs.push(...prettier)
9194
}
95+
if (enableCommand) {
96+
configs.push(...command)
97+
}
9298
if (Object.keys(config).length > 0) {
9399
configs.push(...(Array.isArray(config) ? config : [config]))
94100
}

0 commit comments

Comments
 (0)
Please sign in to comment.