@notcodev/eslint 1.4.2 → 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.
Files changed (3) hide show
  1. package/index.d.ts +16 -2
  2. package/index.js +20 -0
  3. package/package.json +4 -3
package/index.d.ts CHANGED
@@ -1,10 +1,16 @@
1
- import type { OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config'
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<OptionsConfig, 'lessOpinionated' | 'react' | 'stylistic'> &
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
  /**
@@ -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.2",
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.81.2",
45
- "@tanstack/eslint-plugin-router": "^1.121.21",
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",