Skip to content

Commit

Permalink
fix(eslint-plugin): provide correct docs link, close #3461
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 27, 2023
1 parent 4c9a23c commit f55cd6f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions packages/eslint-plugin/src/rules/_.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { join } from 'node:path'
import { createSyncFn } from 'synckit'
import { ESLintUtils } from '@typescript-eslint/utils'
import { distDir } from '../dirs'
import type { run } from '../worker'

export const syncAction = createSyncFn(join(distDir, 'worker.cjs')) as typeof run

export const createRule = ESLintUtils.RuleCreator(
() => 'https://unocss.dev/integrations/eslint#rules',
)
6 changes: 3 additions & 3 deletions packages/eslint-plugin/src/rules/blocklist.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ESLintUtils } from '@typescript-eslint/utils'
import type { ESLintUtils } from '@typescript-eslint/utils'
import type { RuleListener } from '@typescript-eslint/utils/ts-eslint'
import type { TSESTree } from '@typescript-eslint/types'
import { CLASS_FIELDS } from '../constants'
import { syncAction } from './_'
import { createRule, syncAction } from './_'
import { IGNORE_ATTRIBUTES } from './order-attributify'

export default ESLintUtils.RuleCreator(name => name)({
export default createRule({
name: 'blocklist',
meta: {
type: 'problem',
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin/src/rules/order-attributify.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ESLintUtils } from '@typescript-eslint/utils'
import type { ESLintUtils } from '@typescript-eslint/utils'
import type { RuleListener } from '@typescript-eslint/utils/ts-eslint'
import type { TSESTree } from '@typescript-eslint/types'
import MagicString from 'magic-string'
import { syncAction } from './_'
import { createRule, syncAction } from './_'

export const IGNORE_ATTRIBUTES = ['style', 'class', 'classname', 'value']

export default ESLintUtils.RuleCreator(name => name)({
export default createRule({
name: 'order-attributify',
meta: {
type: 'layout',
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin/src/rules/order.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ESLintUtils } from '@typescript-eslint/utils'
import type { ESLintUtils } from '@typescript-eslint/utils'
import type { RuleListener } from '@typescript-eslint/utils/ts-eslint'
import type { TSESTree } from '@typescript-eslint/types'
import { AST_NODES_WITH_QUOTES, CLASS_FIELDS } from '../constants'
import { syncAction } from './_'
import { createRule, syncAction } from './_'

export default ESLintUtils.RuleCreator(name => name)({
export default createRule({
name: 'order',
meta: {
type: 'layout',
Expand Down

0 comments on commit f55cd6f

Please sign in to comment.