diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 68e9ab5c..00147355 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -3,7 +3,6 @@ module.exports = { parser: 'vue-eslint-parser', parserOptions: { parser: { - cjs: '@babel/eslint-parser', js: '@babel/eslint-parser', jsx: '@babel/eslint-parser', @@ -20,12 +19,6 @@ module.exports = { 'no-undef': 'off', // ts(2304) }, }, - { - files: ['*.cjs'], - rules: { - '@typescript-eslint/no-require-imports': 'off', - }, - }, ], env: { // Your environments (which contains several predefined global variables) diff --git a/.gitignore b/.gitignore index 60234b98..f0f3aacc 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ types/directives.d.ts stats.html vite.config.ts.timestamp* types/components.d.ts +.eslintcache diff --git a/package.json b/package.json index 76ebcac1..be538225 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "type-check": "vue-tsc --noEmit", "preview": "vite preview", "release": "release-it", - "eslint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts", + "eslint": "eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts", "eslint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", - "prettier": "prettier -l \"./**/*\"", - "prettier:fix": "prettier --write -l \"./**/*\"", + "prettier": "prettier --cache -l \"./**/*\"", + "prettier:fix": "prettier --write --cache -l \"./**/*\"", "i": "npm install --registry=https://registry.npm.taobao.org && npx husky install" }, "dependencies": { @@ -71,6 +71,7 @@ "xregexp": "^5.1.1" }, "lint-staged": { - "**/*": "prettier --write --ignore-unknown" + "**/*": "prettier --cache --write --ignore-unknown", + "*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --cache" } }