@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +19 -11
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mouse_484/eslint-config",
3
3
  "type": "module",
4
- "version": "3.1.0",
4
+ "version": "3.2.0",
5
5
  "author": "mouse_484",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/mouse484/config/tree/main/packages/eslint",
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': ['error', {
36
- code: 80,
37
- tabWidth: 2,
38
- comments: 120,
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 = 'tsconfigPath' in typescriptOptions
56
- ? typescriptOptions.tsconfigPath
57
- : undefined
63
+ const tsconfigPath
64
+ = 'tsconfigPath' in typescriptOptions
65
+ ? typescriptOptions.tsconfigPath
66
+ : undefined
58
67
 
59
68
  return renameRules(
60
- pluginTs.configs[
61
- tsconfigPath ? `${key}-type-checked` : key
62
- ]?.rules ?? {},
69
+ pluginTs.configs[tsconfigPath ? `${key}-type-checked` : key]?.rules
70
+ ?? {},
63
71
  { '@typescript-eslint': 'ts' },
64
72
  )
65
73
  }