@mouse_484/eslint-config 3.1.0 → 3.2.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/package.json +1 -1
- package/src/index.js +19 -11
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -25,6 +25,11 @@ import antfu, {
|
|
|
25
25
|
* The merged ESLint configurations.
|
|
26
26
|
*/
|
|
27
27
|
export async function mouse(options, ...userConfigs) {
|
|
28
|
+
options = {
|
|
29
|
+
lessOpinionated: true,
|
|
30
|
+
...options,
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
/** @type {TypedFlatConfigItem[]} */
|
|
29
34
|
const configs = []
|
|
30
35
|
|
|
@@ -32,11 +37,14 @@ export async function mouse(options, ...userConfigs) {
|
|
|
32
37
|
name: 'mouse/source-files',
|
|
33
38
|
files: [GLOB_SRC],
|
|
34
39
|
rules: {
|
|
35
|
-
'style/max-len': [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
'style/max-len': [
|
|
41
|
+
'error',
|
|
42
|
+
{
|
|
43
|
+
code: 80,
|
|
44
|
+
tabWidth: 2,
|
|
45
|
+
comments: 120,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
40
48
|
},
|
|
41
49
|
})
|
|
42
50
|
|
|
@@ -52,14 +60,14 @@ export async function mouse(options, ...userConfigs) {
|
|
|
52
60
|
*/
|
|
53
61
|
const getRules = (key) => {
|
|
54
62
|
const typescriptOptions = resolveSubOptions(options, 'typescript')
|
|
55
|
-
const tsconfigPath
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
const tsconfigPath
|
|
64
|
+
= 'tsconfigPath' in typescriptOptions
|
|
65
|
+
? typescriptOptions.tsconfigPath
|
|
66
|
+
: undefined
|
|
58
67
|
|
|
59
68
|
return renameRules(
|
|
60
|
-
pluginTs.configs[
|
|
61
|
-
|
|
62
|
-
]?.rules ?? {},
|
|
69
|
+
pluginTs.configs[tsconfigPath ? `${key}-type-checked` : key]?.rules
|
|
70
|
+
?? {},
|
|
63
71
|
{ '@typescript-eslint': 'ts' },
|
|
64
72
|
)
|
|
65
73
|
}
|