We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 853e996 commit 142e793Copy full SHA for 142e793
src/plugin.ts
@@ -1,19 +1,22 @@
1
import type { ESLint } from 'eslint'
2
-import { version } from '../package.json'
3
-import command from './rule'
4
import type { ESLintPluginCommandOptions } from './types'
+import { version } from '../package.json'
+import BuiltinRules, { createRuleWithCommands } from './rule'
5
6
export function createPluginWithCommands(options: ESLintPluginCommandOptions = {}) {
7
const {
8
name = 'command',
9
} = options
10
+ const plugin = options.commands
11
+ ? createRuleWithCommands(options.commands)
12
+ : BuiltinRules
13
return {
14
meta: {
15
name,
16
version,
17
},
18
rules: {
- command,
19
+ command: plugin,
20
21
} satisfies ESLint.Plugin
22
}
0 commit comments