Skip to content

Commit

Permalink
feat: use new eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 21, 2023
1 parent 5eb4864 commit 725e47a
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 446 deletions.
45 changes: 39 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
{
"cSpell.words": ["Vitesse"],
"prettier.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"files.associations": {
"*.css": "postcss"
},
"editor.formatOnSave": false

// Enable the flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "@stylistic/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" }
],

// The following is optional.
// It's better to put under project setting `.vscode/settings.json`
// to avoid conflicts with working with different eslint configs
// that does not support all formats.
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import antfu, { combine } from '@antfu/eslint-config'
import plugin from '@unocss/eslint-plugin'

export default combine(
antfu,
{
plugins: {
'@unocss': plugin,
},
rules: plugin.configs.recommended.rules,
},
)
23 changes: 10 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"type": "module",
"private": true,
"packageManager": "[email protected]",
"scripts": {
Expand All @@ -17,40 +18,36 @@
"vue-router": "^4.2.4"
},
"devDependencies": {
"@antfu/eslint-config": "^0.43.0",
"@antfu/eslint-config": "^1.0.0-beta.1",
"@iconify-json/carbon": "^1.1.21",
"@types/node": "^20.6.2",
"@unocss/eslint-config": "^0.55.7",
"@unocss/reset": "^0.56.0",
"@types/node": "^20.6.3",
"@unocss/eslint-config": "^0.56.1",
"@unocss/eslint-plugin": "^0.56.1",
"@unocss/reset": "^0.56.1",
"@vitejs/plugin-vue": "^4.3.4",
"@vue-macros/volar": "^0.14.3",
"@vue/test-utils": "^2.4.1",
"eslint": "^8.49.0",
"eslint-define-config": "^1.23.0",
"jsdom": "^22.1.0",
"lint-staged": "^14.0.1",
"pnpm": "^8.7.6",
"simple-git-hooks": "^2.9.0",
"taze": "^0.11.2",
"typescript": "^5.2.2",
"unocss": "^0.55.7",
"unocss": "^0.56.1",
"unplugin-auto-import": "^0.16.6",
"unplugin-vue-components": "^0.25.2",
"unplugin-vue-macros": "^2.5.1",
"vite": "^4.4.9",
"vite-plugin-pages": "^0.31.0",
"vitest": "^0.34.4",
"vue-tsc": "^1.8.11"
"vitest": "^0.34.5",
"vue-tsc": "^1.8.13"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
},
"eslintConfig": {
"extends": [
"@antfu",
"@unocss"
]
}
}
Loading

0 comments on commit 725e47a

Please sign in to comment.