Skip to content

Commit

Permalink
fix: custom commands (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <[email protected]>
  • Loading branch information
ddosakura and antfu authored Sep 13, 2024
1 parent 853e996 commit 142e793
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import type { ESLint } from 'eslint'
import { version } from '../package.json'
import command from './rule'
import type { ESLintPluginCommandOptions } from './types'
import { version } from '../package.json'

Check failure on line 3 in src/plugin.ts

View workflow job for this annotation

GitHub Actions / lint

Expected "../package.json" to come before "./types"
import BuiltinRules, { createRuleWithCommands } from './rule'

export function createPluginWithCommands(options: ESLintPluginCommandOptions = {}) {
const {
name = 'command',
} = options
const plugin = options.commands
? createRuleWithCommands(options.commands)
: BuiltinRules
return {
meta: {
name,
version,
},
rules: {
command,
command: plugin,
},
} satisfies ESLint.Plugin
}

0 comments on commit 142e793

Please sign in to comment.