Skip to content

Commit 85d4461

Browse files
committed
feat(mutoe): add mutoe preferred rules
(cherry picked from commit e1785c8) (cherry picked from commit 06b8766)
1 parent d9c6634 commit 85d4461

File tree

11 files changed

+683
-55
lines changed

11 files changed

+683
-55
lines changed

.vscode/settings.json

+17
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,22 @@
5050
"source": "./fixtures/output/**/*.*",
5151
"target": "./fixtures/input/<base>"
5252
}
53+
],
54+
"cSpell.words": [
55+
"antfu",
56+
"astro",
57+
"ependencies",
58+
"esno",
59+
"execa",
60+
"jiti",
61+
"linebreak",
62+
"lockb",
63+
"nonwords",
64+
"picocolors",
65+
"slidev",
66+
"stroustrup",
67+
"typecheck",
68+
"typegen",
69+
"vuejs"
5370
]
5471
}

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,22 @@ Based on the version of @Antfu, the following sections have been modified:
1111

1212
- Update default package name to `defineConfig`
1313
- Supplement more `package.json` properties ordering rules
14-
- (Plan) Reduce the number of default dependencies
15-
- (Plan) Some of my favorite styles
14+
- By default, all recommendation rules from unicorn are enabled
15+
- Grouped `perfectionist/sort-imports` `perfectionist/sort-vue-attributes` rule
16+
- Only allow camelCase in variable names
17+
- JavaScript: allow named function as callback (for error stack trace readability)
18+
- TypeScript: consistent type assertions (use `xxx as T` instead of `<T>xxx`)
19+
- TypeScript: always need to add await before async function call
20+
- Vue: block order change to ['template', 'script', 'style']
21+
- Vue: don't allow attribute more than 3 in one line
22+
- Vue: Allow singleline html element
23+
- JSX: allow multiple element in one line
24+
- YAML: always add space inner brackets (`[]` `{}`)
25+
- Test: ignore some type wares rules for tests
26+
- Test: support optional cypress recommended rules
27+
- Style: turned off [`antfu/if-newline`](https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/if-newline.md), [`antfu/consistent-chaining`](https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-chaining.md) rules
28+
- Style: set linebreak-style to `unix`
29+
- Style: avoid escape quotes in statement
1630

1731
---
1832

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"@clack/prompts": "^0.7.0",
107107
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
108108
"@eslint/markdown": "^6.2.0",
109+
"@mutoe/eslint-plugin-perfectionist-vue": "^1.0.0",
109110
"@stylistic/eslint-plugin": "^2.9.0",
110111
"@typescript-eslint/eslint-plugin": "^8.9.0",
111112
"@typescript-eslint/parser": "^8.9.0",
@@ -120,7 +121,7 @@
120121
"eslint-plugin-jsonc": "^2.16.0",
121122
"eslint-plugin-n": "^17.11.1",
122123
"eslint-plugin-no-only-tests": "^3.3.0",
123-
"eslint-plugin-perfectionist": "^3.9.0",
124+
"eslint-plugin-perfectionist": "^3.9.1",
124125
"eslint-plugin-regexp": "^2.6.0",
125126
"eslint-plugin-toml": "^0.11.1",
126127
"eslint-plugin-unicorn": "^56.0.0",
@@ -140,7 +141,7 @@
140141
"yargs": "^17.7.2"
141142
},
142143
"devDependencies": {
143-
"@antfu/eslint-config": "3.6.0",
144+
"@antfu/eslint-config": "3.8.0",
144145
"@antfu/ni": "^0.23.0",
145146
"@eslint-react/eslint-plugin": "^1.15.0",
146147
"@eslint/config-inspector": "^0.5.4",

pnpm-lock.yaml

+106-48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/typegen.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises'
33
import { builtinRules } from 'eslint/use-at-your-own-risk'
44
import { flatConfigsToRulesDTS } from 'eslint-typegen/core'
55

6-
import { astro, combine, comments, formatters, imports, javascript, jsdoc, jsonc, jsx, markdown, node, perfectionist, react, regexp, solid, sortPackageJson, stylistic, svelte, test, toml, typescript, unicorn, unocss, vue, yaml } from '../src'
6+
import { astro, combine, comments, formatters, imports, javascript, jsdoc, jsonc, jsx, markdown, mutoe, node, perfectionist, react, regexp, solid, sortPackageJson, stylistic, svelte, test, toml, typescript, unicorn, unocss, vue, yaml } from '../src'
77

88
const configs = await combine(
99
{
@@ -37,6 +37,8 @@ const configs = await combine(
3737
unocss(),
3838
vue(),
3939
yaml(),
40+
41+
mutoe(),
4042
)
4143

4244
const configNames = configs.map(i => i.name).filter(Boolean) as string[]

src/configs/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export * from './jsdoc'
1010
export * from './jsonc'
1111
export * from './jsx'
1212
export * from './markdown'
13+
export * from './mutoe'
1314
export * from './node'
1415
export * from './perfectionist'
1516
export * from './react'

0 commit comments

Comments
 (0)