Skip to content

Commit 2d0b942

Browse files
committed
refactor(project): use prettier format
1 parent 5c0a48c commit 2d0b942

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2247
-1606
lines changed

.vscode/settings.json

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,30 @@
11
{
2-
"cSpell.words": [
3-
"antfu",
4-
"Astro",
5-
"attributify",
6-
"bumpp",
7-
"coderwyd",
8-
"picocolors",
9-
"taze",
10-
"tsup",
11-
"unocss"
12-
],
13-
// Enable the ESlint flat config support
14-
"eslint.experimental.useFlatConfig": true,
15-
16-
// Disable the default formatter, use eslint instead
17-
"prettier.enable": false,
18-
"editor.formatOnSave": false,
19-
20-
// Auto fix
212
"editor.codeActionsOnSave": {
22-
"source.fixAll": "explicit",
3+
"source.fixAll.eslint": "explicit",
234
"source.organizeImports": "never"
245
},
25-
26-
// Silent the stylistic rules in you IDE, but still auto fix them
27-
"eslint.rules.customizations": [
28-
{ "rule": "style/*", "severity": "off" },
29-
{ "rule": "*-indent", "severity": "off" },
30-
{ "rule": "*-spacing", "severity": "off" },
31-
{ "rule": "*-spaces", "severity": "off" },
32-
{ "rule": "*-order", "severity": "off" },
33-
{ "rule": "*-dangle", "severity": "off" },
34-
{ "rule": "*-newline", "severity": "off" },
35-
{ "rule": "*quotes", "severity": "off" },
36-
{ "rule": "*semi", "severity": "off" }
37-
],
38-
39-
// Enable eslint for all supported languages
6+
"eslint.experimental.useFlatConfig": true,
7+
"editor.formatOnSave": false,
408
"eslint.validate": [
41-
"javascript",
42-
"javascriptreact",
43-
"typescript",
44-
"typescriptreact",
45-
"vue",
9+
"svelte",
10+
"astro",
4611
"html",
47-
"markdown",
12+
"css",
13+
"less",
14+
"scss",
4815
"json",
4916
"jsonc",
50-
"yaml"
17+
"yaml",
18+
"yml",
19+
"markdown",
20+
"toml"
21+
],
22+
"prettier.enable": false,
23+
"cSpell.words": [
24+
"antfu",
25+
"coderwyd",
26+
"rspack",
27+
"unocss"
5128
]
5229
}
30+

eslint.config.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,17 @@
1-
// import { createRequire } from 'node:module'
2-
import styleMigrate from '@stylistic/eslint-plugin-migrate'
3-
import coderwyd from './dist/index.js'
1+
// eslint-disable-next-line antfu/no-import-dist
2+
import { defineConfig } from './dist/index.js'
43

5-
// const require = createRequire(import.meta.url)
6-
// require('sucrase/register')
7-
// const { coderwyd } = require('./src/index.ts')
8-
9-
export default coderwyd(
4+
export default defineConfig(
105
{
116
vue: true,
127
// react: true,
138
typescript: true,
14-
ignores: [
15-
'fixtures',
16-
'_fixtures',
17-
],
9+
ignores: ['fixtures', '_fixtures'],
1810
},
1911
{
2012
files: ['src/**/*.ts'],
2113
rules: {
2214
'perfectionist/sort-objects': 'error',
2315
},
2416
},
25-
{
26-
files: ['src/configs/*.ts'],
27-
plugins: {
28-
'style-migrate': styleMigrate,
29-
},
30-
rules: {
31-
'style-migrate/migrate': ['error', { namespaceTo: 'style' }],
32-
},
33-
},
3417
)

package.json

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@coderwyd/eslint-config",
33
"type": "module",
44
"version": "1.1.1",
5-
"packageManager": "pnpm@8.11.0",
5+
"packageManager": "pnpm@8.13.1",
66
"description": "Donny's ESLint config",
77
"author": "Donny Wang <[email protected]> (https://github.com/coderwyd/)",
88
"license": "MIT",
@@ -12,6 +12,7 @@
1212
],
1313
"exports": {
1414
".": {
15+
"types": "./dist/index.d.ts",
1516
"import": "./dist/index.js",
1617
"require": "./dist/index.cjs"
1718
}
@@ -31,15 +32,14 @@
3132
"node": ">=16.14.0"
3233
},
3334
"scripts": {
34-
"build": "tsup --format esm,cjs --clean --dts",
35-
"stub": "tsup --format esm",
35+
"build": "tsup",
3636
"dev": "tsup --format esm,cjs --watch & eslint-flat-config-viewer",
37-
"lint": "pnpm run stub && eslint .",
37+
"lint": "eslint .",
3838
"prepack": "nr build",
3939
"release": "bumpp && pnpm publish",
40-
"test": "vitest",
4140
"typecheck": "tsc --noEmit",
42-
"prepare": "simple-git-hooks"
41+
"prepare": "simple-git-hooks",
42+
"up": "taze major -r -I"
4343
},
4444
"peerDependencies": {
4545
"@unocss/eslint-plugin": ">=0.50.0",
@@ -60,67 +60,73 @@
6060
},
6161
"eslint-plugin-react-refresh": {
6262
"optional": true
63+
},
64+
"eslint-plugin-svelte": {
65+
"optional": true
66+
},
67+
"svelte-eslint-parser": {
68+
"optional": true
6369
}
6470
},
6571
"dependencies": {
66-
"@antfu/eslint-define-config": "^1.23.0-2",
72+
"@antfu/eslint-define-config": "1.23.0-2",
6773
"@antfu/install-pkg": "^0.3.1",
6874
"@eslint-types/jsdoc": "46.9.0",
69-
"@eslint-types/typescript-eslint": "^6.12.0",
70-
"@eslint-types/unicorn": "^49.0.0",
75+
"@eslint-types/typescript-eslint": "^6.16.0",
76+
"@eslint-types/unicorn": "^50.0.1",
7177
"@stylistic/eslint-plugin": "^1.5.1",
72-
"@typescript-eslint/eslint-plugin": "^6.12.0",
73-
"@typescript-eslint/parser": "^6.12.0",
78+
"@toml-tools/parser": "^1.0.0",
79+
"@typescript-eslint/eslint-plugin": "^6.16.0",
80+
"@typescript-eslint/parser": "^6.16.0",
7481
"eslint-config-flat-gitignore": "^0.1.2",
75-
"eslint-plugin-antfu": "^1.0.13",
82+
"eslint-config-prettier": "^9.1.0",
83+
"eslint-plugin-antfu": "^2.1.1",
7684
"eslint-plugin-eslint-comments": "^3.2.0",
7785
"eslint-plugin-i": "^2.29.1",
7886
"eslint-plugin-jsdoc": "^46.9.1",
7987
"eslint-plugin-jsonc": "^2.11.2",
80-
"eslint-plugin-markdown": "^3.0.1",
8188
"eslint-plugin-n": "^16.5.0",
8289
"eslint-plugin-no-only-tests": "^3.1.0",
8390
"eslint-plugin-perfectionist": "^2.5.0",
91+
"eslint-plugin-prettier": "^5.1.2",
8492
"eslint-plugin-unicorn": "^50.0.1",
8593
"eslint-plugin-unused-imports": "^3.0.0",
8694
"eslint-plugin-vitest": "^0.3.20",
8795
"eslint-plugin-vue": "^9.19.2",
88-
"eslint-plugin-yml": "^1.11.0",
89-
"globals": "^13.23.0",
96+
"globals": "^13.24.0",
9097
"jsonc-eslint-parser": "^2.4.0",
9198
"local-pkg": "^0.5.0",
9299
"parse-gitignore": "^2.0.0",
93100
"picocolors": "^1.0.0",
101+
"prettier-plugin-toml": "^2.0.1",
94102
"prompts": "^2.4.2",
95103
"vue-eslint-parser": "^9.3.2",
96-
"yaml-eslint-parser": "^1.2.2",
97104
"yargs": "^17.7.2"
98105
},
99106
"devDependencies": {
100107
"@antfu/ni": "^0.21.12",
101-
"@stylistic/eslint-plugin-migrate": "^1.5.1",
102-
"@types/eslint": "^8.44.9",
108+
"@types/eslint": "^8.56.0",
103109
"@types/fs-extra": "^11.0.4",
104110
"@types/node": "^20.10.5",
105111
"@types/prompts": "^2.4.9",
106112
"@types/yargs": "^17.0.32",
107-
"@unocss/eslint-plugin": "^0.58.0",
113+
"@unocss/eslint-plugin": "^0.58.2",
108114
"bumpp": "^9.2.1",
109115
"eslint": "^8.56.0",
110-
"eslint-flat-config-viewer": "^0.1.3",
116+
"eslint-flat-config-viewer": "^0.1.4",
111117
"eslint-plugin-react": "^7.33.2",
112118
"eslint-plugin-react-hooks": "^4.6.0",
113119
"eslint-plugin-react-refresh": "^0.4.5",
114120
"esno": "^4.0.0",
115121
"execa": "^8.0.1",
116122
"fast-glob": "^3.3.2",
117123
"fs-extra": "^11.2.0",
118-
"lint-staged": "^15.1.0",
124+
"lint-staged": "^15.2.0",
119125
"rimraf": "^5.0.5",
120126
"simple-git-hooks": "^2.9.0",
127+
"taze": "^0.13.1",
121128
"tsup": "^8.0.1",
122-
"typescript": "^5.3.3",
123-
"vitest": "^1.1.0"
129+
"typescript": "^5.3.3"
124130
},
125131
"simple-git-hooks": {
126132
"pre-commit": "pnpx nano-staged"

0 commit comments

Comments
 (0)