rhine-lint 1.4.2 → 1.4.3

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.
@@ -6,14 +6,6 @@ import reactPlugin from 'eslint-plugin-react';
6
6
  import reactHooksPlugin from 'eslint-plugin-react-hooks';
7
7
 
8
8
  import css from '@eslint/css'
9
-
10
- // ... skipped standard imports ...
11
-
12
- // Removed Patch Mock - No longer needed as we don't use eslint-config-next
13
-
14
- // ...
15
-
16
-
17
9
  import js from '@eslint/js'
18
10
  import json from '@eslint/json'
19
11
  import markdown from '@eslint/markdown'
@@ -325,13 +325,15 @@ prefixConfig.push({ ignores: ${JSON.stringify(ignoredPatterns)} });
325
325
  ` : ''}
326
326
 
327
327
  if (${isEslintOverlay} || userEslint.overlay) {
328
- if (Array.isArray(userEslint.config)) {
329
- finalConfig = [...prefixConfig, ...defaultEslint, ...userEslint.config];
328
+ // overlay=true: 用户配置完全覆盖内置配置
329
+ const userConf = userEslint.config || [];
330
+ if (Array.isArray(userConf)) {
331
+ finalConfig = [...prefixConfig, ...userConf];
330
332
  } else {
331
- finalConfig = defu(userEslint, defaultEslint);
332
- if (!Array.isArray(finalConfig)) finalConfig = [...prefixConfig, finalConfig];
333
+ finalConfig = [...prefixConfig, userConf];
333
334
  }
334
335
  } else {
336
+ // overlay=false: 内置配置 + 用户配置追加
335
337
  const userConf = userEslint.config || [];
336
338
  const defaultConf = Array.isArray(defaultEslint) ? defaultEslint : [defaultEslint];
337
339
  finalConfig = [...prefixConfig, ...defaultConf, ...userConf];
@@ -356,8 +358,10 @@ const defaultPrettier = defaultOne;
356
358
 
357
359
  let finalConfig;
358
360
  if (${isPrettierOverlay} || userPrettier.overlay) {
359
- finalConfig = defu(userPrettier.config || {}, defaultPrettier);
361
+ // overlay=true: 用户配置完全覆盖内置配置
362
+ finalConfig = userPrettier.config || {};
360
363
  } else {
364
+ // overlay=false: 内置配置为基础,用户配置补充
361
365
  finalConfig = defu(userPrettier.config || {}, defaultPrettier);
362
366
  }
363
367
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhine-lint",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "module": "./dist/index.js",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",