@tofrankie/eslint 0.0.9 → 0.0.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## eslint@0.0.10 (2026-02-26)
4
+
5
+ - Update `@antfu/eslint-config` to v7.6.1 and its related dependencies
6
+ - Disable `react-hooks-extra/no-direct-set-state-in-use-effect` rule
7
+ - Disable `jsdoc/reject-any-type` rule
8
+
3
9
  ## eslint@0.0.9 (2026-02-22)
4
10
 
5
11
  - Disable `vue/singleline-html-element-content-newline`, `vue/html-closing-bracket-newline`, `vue/html-indent` to avoid conflicts with Prettier
package/README.md CHANGED
@@ -18,3 +18,33 @@ import { defineConfig } from '@tofrankie/eslint'
18
18
 
19
19
  export default defineConfig()
20
20
  ```
21
+
22
+ ## Configuration Examples
23
+
24
+ ### Miniapp
25
+
26
+ ```js
27
+ import { defineConfig } from '@tofrankie/eslint'
28
+
29
+ export default defineConfig(
30
+ {
31
+ ignores: ['project.config.json', 'project.private.config.json'],
32
+ // other antfu options...
33
+ },
34
+ {
35
+ languageOptions: {
36
+ globals: {
37
+ wx: true,
38
+ App: true,
39
+ getApp: true,
40
+ getCurrentPages: true,
41
+ Page: true,
42
+ Component: true,
43
+ Behavior: true,
44
+ requireMiniProgram: true,
45
+ requirePlugin: true,
46
+ },
47
+ },
48
+ }
49
+ )
50
+ ```
package/dist/index.cjs CHANGED
@@ -41,7 +41,8 @@ const SHARED_RULES = {
41
41
  "jsdoc/require-returns": "off",
42
42
  "jsdoc/require-returns-type": "off",
43
43
  "jsdoc/require-returns-description": "off",
44
- "jsdoc/newline-after-description": "off"
44
+ "jsdoc/newline-after-description": "off",
45
+ "jsdoc/reject-any-type": "off"
45
46
  };
46
47
  const SHARED_SETTINGS = { tagNamePreference: {
47
48
  description: "desc",
@@ -160,6 +161,15 @@ const NODE_PRESET_RULES = { "node/prefer-global/process": "off" };
160
161
  */
161
162
  const PNPM_PRESET_RULES = { "pnpm/yaml-enforce-settings": "off" };
162
163
 
164
+ //#endregion
165
+ //#region src/preset-rules/react.ts
166
+ /**
167
+ * - rule: `react/*`、`react-hooks-extra/*`
168
+ * - plugin: `eslint-plugin-react-hooks-extra`
169
+ * @see https://www.npmjs.com/package/eslint-plugin-react-hooks-extra
170
+ */
171
+ const REACT_PRESET_RULES = { "react-hooks-extra/no-direct-set-state-in-use-effect": "off" };
172
+
163
173
  //#endregion
164
174
  //#region src/preset-rules/style.ts
165
175
  /**
@@ -268,6 +278,10 @@ const PRESET_PREDICATES = [
268
278
  {
269
279
  rules: VUE_PRESET_RULES,
270
280
  predicate: (options) => options.vue === true
281
+ },
282
+ {
283
+ rules: REACT_PRESET_RULES,
284
+ predicate: (options) => options.react === true
271
285
  }
272
286
  ];
273
287
  function buildPresetRules(resolvedOptions) {
package/dist/index.mjs CHANGED
@@ -12,7 +12,8 @@ const SHARED_RULES = {
12
12
  "jsdoc/require-returns": "off",
13
13
  "jsdoc/require-returns-type": "off",
14
14
  "jsdoc/require-returns-description": "off",
15
- "jsdoc/newline-after-description": "off"
15
+ "jsdoc/newline-after-description": "off",
16
+ "jsdoc/reject-any-type": "off"
16
17
  };
17
18
  const SHARED_SETTINGS = { tagNamePreference: {
18
19
  description: "desc",
@@ -131,6 +132,15 @@ const NODE_PRESET_RULES = { "node/prefer-global/process": "off" };
131
132
  */
132
133
  const PNPM_PRESET_RULES = { "pnpm/yaml-enforce-settings": "off" };
133
134
 
135
+ //#endregion
136
+ //#region src/preset-rules/react.ts
137
+ /**
138
+ * - rule: `react/*`、`react-hooks-extra/*`
139
+ * - plugin: `eslint-plugin-react-hooks-extra`
140
+ * @see https://www.npmjs.com/package/eslint-plugin-react-hooks-extra
141
+ */
142
+ const REACT_PRESET_RULES = { "react-hooks-extra/no-direct-set-state-in-use-effect": "off" };
143
+
134
144
  //#endregion
135
145
  //#region src/preset-rules/style.ts
136
146
  /**
@@ -239,6 +249,10 @@ const PRESET_PREDICATES = [
239
249
  {
240
250
  rules: VUE_PRESET_RULES,
241
251
  predicate: (options) => options.vue === true
252
+ },
253
+ {
254
+ rules: REACT_PRESET_RULES,
255
+ predicate: (options) => options.react === true
242
256
  }
243
257
  ];
244
258
  function buildPresetRules(resolvedOptions) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tofrankie/eslint",
3
3
  "type": "module",
4
- "version": "0.0.9",
4
+ "version": "0.0.10",
5
5
  "description": "Shared ESLint configuration",
6
6
  "author": "Frankie <1426203851@qq.com>",
7
7
  "license": "MIT",
@@ -41,19 +41,19 @@
41
41
  "node": ">=18"
42
42
  },
43
43
  "peerDependencies": {
44
- "@antfu/eslint-config": ">=7.0.0",
45
- "eslint": ">=9.0.0"
44
+ "@antfu/eslint-config": ">=7.6.1",
45
+ "eslint": ">=9.10.0"
46
46
  },
47
47
  "dependencies": {
48
- "@eslint-react/eslint-plugin": "^2.12.4",
49
- "eslint-plugin-format": "^1.4.0",
50
- "eslint-plugin-jsdoc": "^62.5.4",
48
+ "@eslint-react/eslint-plugin": "^2.13.0",
49
+ "eslint-plugin-format": "^2.0.1",
50
+ "eslint-plugin-jsdoc": "^62.7.1",
51
51
  "eslint-plugin-react-hooks": "^7.0.1",
52
- "eslint-plugin-react-refresh": "^0.5.0",
52
+ "eslint-plugin-react-refresh": "^0.5.2",
53
53
  "lodash.merge": "^4.6.2"
54
54
  },
55
55
  "devDependencies": {
56
- "@antfu/eslint-config": "^7.3.0",
56
+ "@antfu/eslint-config": "^7.6.1",
57
57
  "@types/lodash.merge": "^4.6.9",
58
58
  "eslint": "^9.39.2"
59
59
  },