@mouse_484/eslint-config 5.4.1 → 5.4.2
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/README.md +41 -0
- package/package.json +1 -1
- package/src/index.js +6 -2
package/README.md
CHANGED
|
@@ -2,7 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
ESLint Config based on [@antfu/eslint-config](https://github.com/antfu/eslint-config)
|
|
4
4
|
|
|
5
|
+
## Requirements
|
|
6
|
+
- ESLint: v9 or higher (Flat Config supported)
|
|
7
|
+
|
|
5
8
|
## Usage
|
|
9
|
+
Run the setup command:
|
|
6
10
|
```
|
|
7
11
|
npx @mouse_484/eslint-config@latest
|
|
8
12
|
```
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- More flexible adjustments for opinionated rules than [`lessOpinionated`](https://github.com/antfu/eslint-config?tab=readme-ov-file#top-level-function-style-etc).
|
|
17
|
+
- Disables `antfu/no-top-level-await` and `antfu/if-newline`.
|
|
18
|
+
- Includes additional configurations by default:
|
|
19
|
+
- Recommended rules from [unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn).
|
|
20
|
+
- Rules from [stylistic](https://eslint.style/).
|
|
21
|
+
- Customized rules:
|
|
22
|
+
- Stylistic rules adjustments.
|
|
23
|
+
- JSX properties sort order.
|
|
24
|
+
- File naming convention rules.
|
|
25
|
+
- Additional plugins:
|
|
26
|
+
- [`eslint-plugin-better-tailwindcss`](https://github.com/schoero/eslint-plugin-better-tailwindcss) for Tailwind CSS.
|
|
27
|
+
|
|
28
|
+
## Advanced Configuration
|
|
29
|
+
|
|
30
|
+
#### TypeScript
|
|
31
|
+
|
|
32
|
+
for type-aware linting
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
export default mouse({
|
|
36
|
+
typescript: {
|
|
37
|
+
tsconfigPath: './tsconfig.json',
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Tailwind CSS
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
export default mouse({
|
|
46
|
+
tailwind: {
|
|
47
|
+
entryPoint: './src/index.css',
|
|
48
|
+
},
|
|
49
|
+
})
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -15,7 +15,6 @@ async function mouse(options, ...userConfigs) {
|
|
|
15
15
|
allRecommended: true,
|
|
16
16
|
},
|
|
17
17
|
stylistic: true,
|
|
18
|
-
typescript: true,
|
|
19
18
|
...options,
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -33,7 +32,12 @@ async function mouse(options, ...userConfigs) {
|
|
|
33
32
|
...tailwind(options),
|
|
34
33
|
]
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
const normalizedOptions = {
|
|
36
|
+
...options,
|
|
37
|
+
ignores: typeof options?.ignores === 'function' ? options.ignores([]) : options?.ignores,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return antfu(normalizedOptions, ...configs, ...userConfigs)
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
export default mouse
|