chore: use new eslint

pull/38/head
xingyu 2023-10-18 15:22:29 +08:00
parent dbbc2e1939
commit 8076d0e54c
6 changed files with 475 additions and 348 deletions

View File

@ -1,11 +0,0 @@
const process = require('node:process')
process.env.ESLINT_TSCONFIG = 'tsconfig.json'
module.exports = {
extends: ['@xingyuv', '@unocss'],
rules: {
'no-console': 'off',
'vue/custom-event-name-casing': 'off',
},
}

20
.vscode/settings.json vendored
View File

@ -60,17 +60,23 @@
"path-intellisense.mappings": { "path-intellisense.mappings": {
"@/": "${workspaceRoot}/src" "@/": "${workspaceRoot}/src"
}, },
"eslint.experimental.useFlatConfig": true,
"prettier.enable": false, "prettier.enable": false,
"editor.formatOnSave": false, "editor.formatOnSave": false,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true, "source.fixAll": "explicit",
"source.organizeImports": false "source.organizeImports": "never"
}, },
"eslint.rules.customizations": [ "eslint.rules.customizations": [
{ { "rule": "style/*", "severity": "off" },
"rule": "@stylistic/*", { "rule": "*-indent", "severity": "off" },
"severity": "off" { "rule": "*-spacing", "severity": "off" },
} { "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
], ],
"eslint.validate": [ "eslint.validate": [
"javascript", "javascript",
@ -173,7 +179,7 @@
"*.ts": "$(capture).test.ts, $(capture).test.tsx", "*.ts": "$(capture).test.ts, $(capture).test.tsx",
"*.tsx": "$(capture).test.ts, $(capture).test.tsx", "*.tsx": "$(capture).test.ts, $(capture).test.tsx",
"*.env": "$(capture).env.*", "*.env": "$(capture).env.*",
"package.json": ".hintrc,pnpm-lock.yaml,yarn.lock,LICENSE,README*,CHANGELOG*,CNAME,.gitattributes,.gitignore,stylelint.config.js,commitlint.config.js,.stylelintignore,.prettierignore,.gitpod.yml,.eslintrc.js,.eslintignore" "package.json": ".hintrc,pnpm-lock.yaml,yarn.lock,LICENSE,README*,CHANGELOG*,CNAME,.gitattributes,.gitignore,stylelint.config.js,eslint.config.js,commitlint.config.js,.stylelintignore,.prettierignore,.gitpod.yml,.eslintrc.js,.eslintignore"
}, },
"eslint.codeAction.showDocumentation": { "eslint.codeAction.showDocumentation": {
"enable": true "enable": true

7
eslint.config.js Normal file
View File

@ -0,0 +1,7 @@
const antfu = require('@antfu/eslint-config').default
const unocss = require('@unocss/eslint-plugin')
module.exports = antfu(
{},
unocss.configs.flat,
)

View File

@ -82,6 +82,7 @@
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^1.0.0-beta.27",
"@commitlint/cli": "^17.8.0", "@commitlint/cli": "^17.8.0",
"@commitlint/config-conventional": "^17.8.0", "@commitlint/config-conventional": "^17.8.0",
"@iconify/json": "^2.2.129", "@iconify/json": "^2.2.129",
@ -99,7 +100,6 @@
"@vitejs/plugin-vue": "4.4.0", "@vitejs/plugin-vue": "4.4.0",
"@vitejs/plugin-vue-jsx": "^3.0.2", "@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/compiler-sfc": "^3.3.4", "@vue/compiler-sfc": "^3.3.4",
"@xingyuv/eslint-config": "^0.2.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cz-git": "^1.7.1", "cz-git": "^1.7.1",
"czg": "^1.7.1", "czg": "^1.7.1",

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "esnext", "target": "ESNext",
"lib": ["dom", "esnext"], "lib": ["DOM", "ESNext"],
"jsx": "preserve", "jsx": "preserve",
"experimentalDecorators": true, "experimentalDecorators": true,
"noLib": false, "noLib": false,
"module": "esnext", "module": "ESNext",
"moduleResolution": "node", "moduleResolution": "node",
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
@ -37,5 +37,5 @@
"build/**/*.d.ts", "build/**/*.d.ts",
"vite.config.ts" "vite.config.ts"
], ],
"exclude": ["node_modules", "dist", "**/*.js"] "exclude": ["node_modules", "dist"]
} }