Browse Source

dev: 移除eslint相关模块.

prettiter已经足够格式化代码, eslint作用不太了.
peter 1 month ago
parent
commit
6fdd90ae13
5 changed files with 3 additions and 49 deletions
  1. 0 32
      .eslintrc.cjs
  2. 0 1
      README.md
  3. 1 10
      package.json
  4. 1 1
      src/pages/indent-manage/product/components/examine.vue
  5. 1 5
      vite.config.ts

+ 0 - 32
.eslintrc.cjs

@@ -1,32 +0,0 @@
-// eslint-disable-next-line no-undef
-module.exports = {
-  env: {
-    browser: true,
-    es2021: true, // 添加所有 ECMAScript 2021 全局变量并自动将 ecmaVersion 解析器选项设置为 12
-    node: true,
-    'vue/setup-compiler-macros': true,
-  },
-  plugins: ['@typescript-eslint'],
-  parser: 'vue-eslint-parser',
-  parserOptions: {
-    ecmaVersion: 'lasted',
-    parser: '@typescript-eslint/parser',
-    sourceType: 'module',
-    ecmaFeatures: {
-      jsx: true,
-    },
-  },
-  extends: ['prettier', 'eslint:recommended', 'plugin:vue/vue3-recommended'],
-  rules: {
-    // override/add rules settings here, such as:
-    // 'vue/no-unused-vars': 'error'
-    // Enable vue/script-setup-uses-vars rule
-    'vue/script-setup-uses-vars': 'error',
-    'vue/no-lone-template': 0,
-    'vue/singleline-html-element-content-newline': 0,
-    'vue/valid-attribute-name': 0,
-    'vue/html-self-closing': 0,
-    'vue/html-indent': 0,
-    'vue/no-v-html': 0,
-  },
-}

+ 0 - 1
README.md

@@ -9,7 +9,6 @@ Vue3 + Element Plus + tailwindcss.
 
 Element Plus升级尽量频繁, 或者锁死直接不升级, 不要隔几个小版本升一次, 不然可能会炸, 开发团队依赖于开源社区支持, API各种改动...
 vue官方的依赖无脑升级都行.
-eslint 锁死当前大版本, 往上会改配置文件, 格式跟智障一样. 当然那天看不爽了直接去掉就行, 反正都上typescript了, eslint其实不是很重要, 就格式化一下代码而已
 其他依赖项自测.
 
 ## Project setup

+ 1 - 10
package.json

@@ -5,9 +5,7 @@
   "scripts": {
     "build": "vue-tsc --noEmit && vite build",
     "build-test": "vue-tsc --noEmit && vite build --mode test",
-    "dev": "vite",
-    "lint": "eslint --ext .js,.vue src",
-    "lint-fix": "eslint --ext .js,.vue src --fix"
+    "dev": "vite"
   },
   "dependencies": {
     "@element-plus/icons-vue": "^2.1.0",
@@ -30,19 +28,12 @@
     "xlsx": "^0.18.5"
   },
   "devDependencies": {
-    "@nabla/vite-plugin-eslint": "^2.0.5",
     "@types/js-cookie": "^3.0.6",
     "@types/lodash.clonedeep": "^4.5.9",
     "@types/lodash.debounce": "^4.0.9",
     "@types/qrcode": "^1.5.5",
-    "@typescript-eslint/eslint-plugin": "^7.18.0",
-    "@typescript-eslint/parser": "^7.18.0",
     "@vitejs/plugin-vue": "^5.2.4",
-    "@vue/eslint-config-prettier": "^9.0.0",
     "autoprefixer": "^10.4.20",
-    "eslint": "^8.57.1",
-    "eslint-config-prettier": "^9.1.0",
-    "eslint-plugin-vue": "^9.32.0",
     "postcss": "^8.5.3",
     "prettier": "^3.5.3",
     "sass": "^1.85.1",

+ 1 - 1
src/pages/indent-manage/product/components/examine.vue

@@ -297,7 +297,7 @@ watch(
         temp.category_id = getCategory(dataForExamine.category_id)
       }
       form.value = Object.assign({}, cloneDeep(dataForExamine), temp)
-      // eslint-disable-next-line
+
       if (form.value.status == 0) {
         //  未审核状态直接选 审核通过, 其他两种情况不管
         form.value.status = 1

+ 1 - 5
vite.config.ts

@@ -1,6 +1,5 @@
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
-import eslintPlugin from '@nabla/vite-plugin-eslint'
 
 // https://vitejs.dev/config/
 export default defineConfig(({ mode }) => {
@@ -37,10 +36,7 @@ export default defineConfig(({ mode }) => {
         },
       },
     },
-    plugins: [
-      vue({ template: { compilerOptions: { hoistStatic: false } } }),
-      eslintPlugin(),
-    ],
+    plugins: [vue({ template: { compilerOptions: { hoistStatic: false } } })],
     build: {
       // 设置最终构建的浏览器兼容目标
       target: 'es2020',