@notcodev/eslint 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +16 -2
- package/index.js +21 -1
- package/package.json +4 -3
package/index.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
OptionsConfig,
|
|
3
|
+
TypedFlatConfigItem,
|
|
4
|
+
} from '@antfu/eslint-config'
|
|
2
5
|
import type { ConfigNames } from '@antfu/eslint-config'
|
|
3
6
|
import type { OptionsOverrides } from '@antfu/eslint-config'
|
|
4
7
|
import type { FlatConfigComposer } from 'eslint-flat-config-utils'
|
|
5
8
|
|
|
6
9
|
declare module '@notcodev/eslint' {
|
|
7
|
-
export type EslintOptions = Omit<
|
|
10
|
+
export type EslintOptions = Omit<
|
|
11
|
+
OptionsConfig,
|
|
12
|
+
'lessOpinionated' | 'react' | 'stylistic'
|
|
13
|
+
> &
|
|
8
14
|
TypedFlatConfigItem & {
|
|
9
15
|
/**
|
|
10
16
|
* Enable react rules.
|
|
@@ -59,6 +65,14 @@ declare module '@notcodev/eslint' {
|
|
|
59
65
|
* @default false
|
|
60
66
|
*/
|
|
61
67
|
tanstackRouter?: boolean
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Enable rules for Effector.
|
|
71
|
+
*
|
|
72
|
+
* @see https://eslint.effector.dev
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
effector?: boolean
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
export type Eslint = (
|
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import antfu from '@antfu/eslint-config'
|
|
|
2
2
|
import pluginNext from '@next/eslint-plugin-next'
|
|
3
3
|
import pluginTanstackQuery from '@tanstack/eslint-plugin-query'
|
|
4
4
|
import pluginTanstackRouter from '@tanstack/eslint-plugin-router'
|
|
5
|
+
import pluginEffector from 'eslint-plugin-effector'
|
|
5
6
|
import pluginJsxA11y from 'eslint-plugin-jsx-a11y'
|
|
6
7
|
import pluginPrettier from 'eslint-plugin-prettier'
|
|
7
8
|
|
|
@@ -13,6 +14,7 @@ export function eslint({
|
|
|
13
14
|
prettier = true,
|
|
14
15
|
tanstackRouter,
|
|
15
16
|
tanstackQuery,
|
|
17
|
+
effector,
|
|
16
18
|
...options
|
|
17
19
|
} = {}) {
|
|
18
20
|
/**
|
|
@@ -175,7 +177,7 @@ export function eslint({
|
|
|
175
177
|
'react/prefer-destructuring-assignment': 'warn',
|
|
176
178
|
'react/no-useless-fragment': 'warn',
|
|
177
179
|
'react/prefer-shorthand-boolean': 'warn',
|
|
178
|
-
'react-hooks/no-direct-set-state-in-use-effect': next
|
|
180
|
+
'react-hooks-extra/no-direct-set-state-in-use-effect': next
|
|
179
181
|
? 'off'
|
|
180
182
|
: 'warn',
|
|
181
183
|
},
|
|
@@ -230,6 +232,24 @@ export function eslint({
|
|
|
230
232
|
})
|
|
231
233
|
}
|
|
232
234
|
|
|
235
|
+
if (effector) {
|
|
236
|
+
configs.push({
|
|
237
|
+
name: 'notcodev/effector/setup',
|
|
238
|
+
plugins: { effector: pluginEffector },
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
configs.push({
|
|
242
|
+
name: 'notcodev/effector/rules',
|
|
243
|
+
rules: {
|
|
244
|
+
...pluginEffector.configs.recommended.rules,
|
|
245
|
+
...pluginEffector.configs.patronum.rules,
|
|
246
|
+
...pluginEffector.configs.future.rules,
|
|
247
|
+
...pluginEffector.configs.scope.rules,
|
|
248
|
+
...(options.react ? pluginEffector.configs.react.rules : {}),
|
|
249
|
+
},
|
|
250
|
+
})
|
|
251
|
+
}
|
|
252
|
+
|
|
233
253
|
return antfu(
|
|
234
254
|
{ ...options, stylistic, lessOpinionated: true },
|
|
235
255
|
configs,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notcodev/eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "ESLint Configs",
|
|
7
7
|
"author": {
|
|
@@ -41,11 +41,12 @@
|
|
|
41
41
|
"@antfu/eslint-config": "~4.13.2",
|
|
42
42
|
"@eslint-react/eslint-plugin": "~1.38.4",
|
|
43
43
|
"@next/eslint-plugin-next": "~15.3.3",
|
|
44
|
-
"@tanstack/eslint-plugin-query": "^5.
|
|
45
|
-
"@tanstack/eslint-plugin-router": "^1.
|
|
44
|
+
"@tanstack/eslint-plugin-query": "^5.90.1",
|
|
45
|
+
"@tanstack/eslint-plugin-router": "^1.132.0",
|
|
46
46
|
"eslint": "~9.22.0",
|
|
47
47
|
"eslint-config-prettier": "~10.1.5",
|
|
48
48
|
"eslint-flat-config-utils": "~2.1.0",
|
|
49
|
+
"eslint-plugin-effector": "~0.16.0",
|
|
49
50
|
"eslint-plugin-jsx-a11y": "~6.10.2",
|
|
50
51
|
"eslint-plugin-prettier": "~5.4.1",
|
|
51
52
|
"eslint-plugin-react-hooks": "~5.2.0",
|