Skip to content

Commit 2509e5e

Browse files
committed
feat: add plugin eslint-plugin-de-morgan
1 parent a5264ab commit 2509e5e

File tree

7 files changed

+38
-1
lines changed

7 files changed

+38
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"eslint-config-prettier": "^10.0.1",
9090
"eslint-plugin-antfu": "^3.1.0",
9191
"eslint-plugin-command": "^3.1.0",
92+
"eslint-plugin-de-morgan": "^1.2.0",
9293
"eslint-plugin-eslint-comments": "^3.2.0",
9394
"eslint-plugin-import-x": "^4.6.1",
9495
"eslint-plugin-jsdoc": "^50.6.3",

pnpm-lock.yaml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/typegen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import picocolors from 'picocolors'
55
import {
66
command,
77
comments,
8+
deMorgan,
89
imports,
910
javascript,
1011
jsdoc,
@@ -52,6 +53,7 @@ const configs = await combine(
5253
command(),
5354
regexp(),
5455
tailwindcss(),
56+
deMorgan(),
5557
)
5658

5759
const configNames = configs.map((i) => i.name).filter(Boolean) as string[]

src/configs/de-morgan.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { pluginDeMorgan } from '../plugins'
2+
import type { TypedFlatConfigItem } from '../types'
3+
4+
export function deMorgan(): TypedFlatConfigItem[] {
5+
return [
6+
{
7+
name: 'coderwyd/de-morgan/rules',
8+
plugins: {
9+
'de-morgan': pluginDeMorgan,
10+
},
11+
rules: {
12+
'de-morgan/no-negated-conjunction': 'error',
13+
'de-morgan/no-negated-disjunction': 'error',
14+
},
15+
},
16+
]
17+
}

src/configs/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from './command'
22
export * from './comments'
3+
export * from './de-morgan'
34
export * from './ignores'
45
export * from './imports'
56
export * from './javascript'

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Linter } from 'eslint'
22
import {
33
command,
44
comments,
5+
deMorgan,
56
ignores,
67
imports,
78
javascript,
@@ -136,9 +137,10 @@ export async function defineConfig(
136137
imports(),
137138
unicorn(),
138139
command(),
140+
deMorgan(),
141+
perfectionist(),
139142

140143
// Optional plugins (installed but not enabled by default)
141-
perfectionist(),
142144
)
143145

144146
if (enableVue) componentExts.push('vue')

src/plugins/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments'
55
export { default as pluginAntfu } from 'eslint-plugin-antfu'
6+
export { default as pluginDeMorgan } from 'eslint-plugin-de-morgan'
67
export * as pluginImport from 'eslint-plugin-import-x'
78
export { default as pluginNode } from 'eslint-plugin-n'
89
export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist'

0 commit comments

Comments
 (0)