@mouse_484/eslint-config 5.10.38 → 5.10.40
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/bin/cli.js +8 -6
- package/package.json +3 -3
- package/src/configs/unicorn.js +4 -2
- package/src/index.js +1 -2
- package/src/lib/factory.js +3 -3
- package/src/lib/rules.gen.d.ts +2388 -14
package/bin/cli.js
CHANGED
|
@@ -120,15 +120,17 @@ async function main() {
|
|
|
120
120
|
)
|
|
121
121
|
|
|
122
122
|
logger('Linting the project to verify setup')
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
try {
|
|
124
|
+
await runAgentCommand(
|
|
125
|
+
packageManager.agent,
|
|
126
|
+
'run',
|
|
127
|
+
['lint:fix'],
|
|
128
|
+
)
|
|
129
|
+
} catch (error) {
|
|
128
130
|
if (error instanceof Error) {
|
|
129
131
|
logger(`Linting failed: ${error.message}`)
|
|
130
132
|
}
|
|
131
|
-
}
|
|
133
|
+
}
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
await main()
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mouse_484/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.10.
|
|
4
|
+
"version": "5.10.40",
|
|
5
5
|
"author": "mouse_484",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/mouse484/config/tree/main/packages/eslint",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"typegen": "node scripts/typegen.js"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@antfu/eslint-config": "^9.
|
|
27
|
+
"@antfu/eslint-config": "^9.1.0",
|
|
28
28
|
"baseline-browser-mapping": "^2.10.40",
|
|
29
29
|
"eslint-plugin-better-tailwindcss": "^4.6.0",
|
|
30
|
-
"package-manager-detector": "^1.
|
|
30
|
+
"package-manager-detector": "^1.7.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"eslint-typegen": "2.3.1"
|
package/src/configs/unicorn.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GLOB_SRC } from '@antfu/eslint-config'
|
|
1
2
|
import { CASES } from '../const/cases.js'
|
|
2
3
|
import { GLOB_D_TS, GLOB_MARKDOWN_CODE_BLOCK, GLOB_README } from '../const/glob.js'
|
|
3
4
|
import { createConfigs } from '../lib/factory.js'
|
|
@@ -8,8 +9,9 @@ export default createConfigs({
|
|
|
8
9
|
configs: [
|
|
9
10
|
{
|
|
10
11
|
name: 'general',
|
|
12
|
+
files: [GLOB_SRC],
|
|
11
13
|
rules: {
|
|
12
|
-
'unicorn/
|
|
14
|
+
'unicorn/name-replacements': [
|
|
13
15
|
'error',
|
|
14
16
|
{
|
|
15
17
|
allowList: {
|
|
@@ -48,7 +50,7 @@ export default createConfigs({
|
|
|
48
50
|
'**/*env.d.ts',
|
|
49
51
|
],
|
|
50
52
|
rules: {
|
|
51
|
-
'unicorn/
|
|
53
|
+
'unicorn/name-replacements': 'off',
|
|
52
54
|
},
|
|
53
55
|
},
|
|
54
56
|
{
|
package/src/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import typescript from './configs/typescript.js'
|
|
|
9
9
|
import unicorn from './configs/unicorn.js'
|
|
10
10
|
|
|
11
11
|
/** @type {import('.').mouse} */
|
|
12
|
-
async function mouse(options, ...userConfigs) {
|
|
12
|
+
export default async function mouse(options, ...userConfigs) {
|
|
13
13
|
options = {
|
|
14
14
|
unicorn: {
|
|
15
15
|
allRecommended: true,
|
|
@@ -62,7 +62,6 @@ async function mouse(options, ...userConfigs) {
|
|
|
62
62
|
return composer
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
export default mouse
|
|
66
65
|
export { mouse }
|
|
67
66
|
export * from './const/glob.js'
|
|
68
67
|
export * from '@antfu/eslint-config'
|
package/src/lib/factory.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
function createConfig(name, withOptions, config) {
|
|
9
9
|
return (options) => {
|
|
10
|
-
const
|
|
11
|
-
? withOptions.every(key => key
|
|
10
|
+
const canApply = withOptions
|
|
11
|
+
? withOptions.every(key => Object.hasOwn(options, key))
|
|
12
12
|
: true
|
|
13
|
-
if (!
|
|
13
|
+
if (!canApply) {
|
|
14
14
|
return []
|
|
15
15
|
}
|
|
16
16
|
return {
|