@mouse_484/eslint-config 5.4.1 → 5.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.
- package/README.md +41 -0
- package/bin/cli.js +3 -1
- 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/bin/cli.js
CHANGED
|
@@ -24,6 +24,7 @@ function logger(message) {
|
|
|
24
24
|
*/
|
|
25
25
|
function runAgentCommand(agent, command_, args_) {
|
|
26
26
|
const { command, args } = resolveCommand(agent, command_, args_)
|
|
27
|
+
console.info(`Running command: ${command} ${args.join(' ')}`)
|
|
27
28
|
return new Promise((resolve, reject) => {
|
|
28
29
|
const child = spawn(
|
|
29
30
|
command,
|
|
@@ -62,7 +63,7 @@ async function main() {
|
|
|
62
63
|
await runAgentCommand(
|
|
63
64
|
packageManager.agent,
|
|
64
65
|
'execute',
|
|
65
|
-
[PACKAGE_NAME.BASE],
|
|
66
|
+
['-y', `${PACKAGE_NAME.BASE}@latest`],
|
|
66
67
|
)
|
|
67
68
|
logger('Modifying base config to custom config')
|
|
68
69
|
|
|
@@ -110,5 +111,6 @@ export default mouse()
|
|
|
110
111
|
})
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
console.info('---------------- Setting up @mouse_484/eslint-config ----------------')
|
|
113
115
|
await main()
|
|
114
116
|
console.info('---------------- Setup Complete ----------------')
|
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
|