@tofrankie/eslint 0.0.9 → 0.0.11

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## eslint@0.0.11 (2026-03-13)
4
+
5
+ - Add `style/member-delimiter-style` rule
6
+ - Update `style/operator-linebreak` rule
7
+ - Disable `style/indent-binary-ops` rule to avoid conflicts with Prettier
8
+ - Update `@antfu/eslint-config` to v7.7.2 and its related dependencies
9
+
10
+ ## eslint@0.0.10 (2026-02-26)
11
+
12
+ - Update `@antfu/eslint-config` to v7.6.1 and its related dependencies
13
+ - Disable `react-hooks-extra/no-direct-set-state-in-use-effect` rule
14
+ - Disable `jsdoc/reject-any-type` rule
15
+
3
16
  ## eslint@0.0.9 (2026-02-22)
4
17
 
5
18
  - Disable `vue/singleline-html-element-content-newline`, `vue/html-closing-bracket-newline`, `vue/html-indent` to avoid conflicts with Prettier
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @tofrankie/eslint
2
2
 
3
+ ![npm version](https://img.shields.io/npm/v/@tofrankie/eslint) ![node version](https://img.shields.io/node/v/@tofrankie/eslint) ![npm package license](https://img.shields.io/npm/l/@tofrankie/eslint) ![npm last update](https://img.shields.io/npm/last-update/@tofrankie/eslint)
4
+
3
5
  A shared ESLint configuration based on [@antfu/eslint-config](https://github.com/antfu/eslint-config), with preset rules tailored to personal preferences.
4
6
 
5
7
  > [!IMPORTANT]
@@ -18,3 +20,33 @@ import { defineConfig } from '@tofrankie/eslint'
18
20
 
19
21
  export default defineConfig()
20
22
  ```
23
+
24
+ ## Configuration Examples
25
+
26
+ ### Miniapp
27
+
28
+ ```js
29
+ import { defineConfig } from '@tofrankie/eslint'
30
+
31
+ export default defineConfig(
32
+ {
33
+ ignores: ['project.config.json', 'project.private.config.json'],
34
+ // other antfu options...
35
+ },
36
+ {
37
+ languageOptions: {
38
+ globals: {
39
+ wx: true,
40
+ App: true,
41
+ getApp: true,
42
+ getCurrentPages: true,
43
+ Page: true,
44
+ Component: true,
45
+ Behavior: true,
46
+ requireMiniProgram: true,
47
+ requirePlugin: true,
48
+ },
49
+ },
50
+ }
51
+ )
52
+ ```
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
  /**
@@ -191,10 +201,29 @@ const STYLE_PRESET_RULES = {
191
201
  { overrides: {
192
202
  "&&": "after",
193
203
  "||": "after",
194
- "=": "after"
204
+ "??": "after",
205
+ "=": "after",
206
+ "+": "after",
207
+ "-": "after"
195
208
  } }
196
209
  ],
197
- "style/comma-dangle": "off"
210
+ "style/comma-dangle": "off",
211
+ "style/indent-binary-ops": "off",
212
+ "style/member-delimiter-style": ["error", {
213
+ multiline: {
214
+ delimiter: "none",
215
+ requireLast: false
216
+ },
217
+ singleline: {
218
+ delimiter: "semi",
219
+ requireLast: false
220
+ },
221
+ multilineDetection: "brackets",
222
+ overrides: { interface: { multiline: {
223
+ delimiter: "none",
224
+ requireLast: false
225
+ } } }
226
+ }]
198
227
  };
199
228
 
200
229
  //#endregion
@@ -268,6 +297,10 @@ const PRESET_PREDICATES = [
268
297
  {
269
298
  rules: VUE_PRESET_RULES,
270
299
  predicate: (options) => options.vue === true
300
+ },
301
+ {
302
+ rules: REACT_PRESET_RULES,
303
+ predicate: (options) => options.react === true
271
304
  }
272
305
  ];
273
306
  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
  /**
@@ -162,10 +172,29 @@ const STYLE_PRESET_RULES = {
162
172
  { overrides: {
163
173
  "&&": "after",
164
174
  "||": "after",
165
- "=": "after"
175
+ "??": "after",
176
+ "=": "after",
177
+ "+": "after",
178
+ "-": "after"
166
179
  } }
167
180
  ],
168
- "style/comma-dangle": "off"
181
+ "style/comma-dangle": "off",
182
+ "style/indent-binary-ops": "off",
183
+ "style/member-delimiter-style": ["error", {
184
+ multiline: {
185
+ delimiter: "none",
186
+ requireLast: false
187
+ },
188
+ singleline: {
189
+ delimiter: "semi",
190
+ requireLast: false
191
+ },
192
+ multilineDetection: "brackets",
193
+ overrides: { interface: { multiline: {
194
+ delimiter: "none",
195
+ requireLast: false
196
+ } } }
197
+ }]
169
198
  };
170
199
 
171
200
  //#endregion
@@ -239,6 +268,10 @@ const PRESET_PREDICATES = [
239
268
  {
240
269
  rules: VUE_PRESET_RULES,
241
270
  predicate: (options) => options.vue === true
271
+ },
272
+ {
273
+ rules: REACT_PRESET_RULES,
274
+ predicate: (options) => options.react === true
242
275
  }
243
276
  ];
244
277
  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.11",
5
5
  "description": "Shared ESLint configuration",
6
6
  "author": "Frankie <1426203851@qq.com>",
7
7
  "license": "MIT",
@@ -41,21 +41,21 @@
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 || ^10.0.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.8.0",
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.7.2",
57
57
  "@types/lodash.merge": "^4.6.9",
58
- "eslint": "^9.39.2"
58
+ "eslint": "^9.39.4"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsdown",