diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9f68e8c --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +vite.config.ts +uno.config.ts +pages.config.ts +manifest.config.ts diff --git a/.oxlintrc.json b/.oxlintrc.json index 5d34bc4..be6932b 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -12,7 +12,7 @@ "globals": { "foo": "readonly" }, - "ignorePatterns": ["src/static/**", "src/uni_modules/**"], + "ignorePatterns": ["node_modules", "dist", "src/static/**", "src/uni_modules/**"], "settings": {}, "overrides": [ { diff --git a/.vscode/settings.json b/.vscode/settings.json index 0c91bbd..c34fadb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -60,6 +60,6 @@ "README.md": "index.html,favicon.ico,robots.txt,CHANGELOG.md", "pages.config.ts": "manifest.config.ts,openapi-ts-request.config.ts", "package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,.npmrc,.browserslistrc", - "tsconfig.json": ".commitlintrc.*,.prettier*,.editorconfig,.commitlint.cjs" + ".oxlintrc.json": "tsconfig.json,.commitlintrc.*,.prettier*,.editorconfig,.commitlint.cjs,.eslint*" } } diff --git a/package.json b/package.json index 3fd81cb..e7f9714 100644 --- a/package.json +++ b/package.json @@ -71,8 +71,8 @@ "type-check": "vue-tsc --noEmit", "openapi-ts-request": "openapi-ts", "prepare": "git init && husky", - "lint:oxlint": "oxlint src/**/*.{ts,js,vue}", - "lint:oxlint-fix": "oxlint --fix src/**/*.{ts,js,vue}" + "lint": "oxlint", + "lint-fix": "oxlint --fix" }, "lint-staged": { "**/*.{html,cjs,json,md,scss,css,txt}": [ diff --git a/src/pages/about/about.vue b/src/pages/about/about.vue index 351623d..30e39e4 100644 --- a/src/pages/about/about.vue +++ b/src/pages/about/about.vue @@ -37,6 +37,12 @@ const toSubPage = () => { url: '/pages-sub/demo/index', }) } + +// 奇怪:同样的代码放在 vue 里面不会校验到错误,放在 .ts 文件里面会校验到错误 +// const testOxlint = (name: string) => { +// console.log('oxlint') +// } +// testOxlint('oxlint')