Closed huoher closed 1 year ago
感谢您的项目
我希望在浏览器中输出这些报错信息,请问我应该如何配置。
我阅读了文档,我现在的项目可以实现在开发的控制台中输出eslint的相关警告和报错信息,但是开发人员仍然可以忽略这些信息。
目前浏览器渲染正常,没有阻止开发人员。如果希望在浏览器可以阻止或者输出一些报错信息,请问应该如何配置,烦请不吝赐教
以下是我的一些配置,烦请不吝赐教。
我的package.json的devdependecy部分
package.json
"devDependencies": { "@vitejs/plugin-vue": "^4.1.0", "@vue/eslint-config-prettier": "^7.1.0", "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.11.0", "prettier": "^2.8.7", "vite": "^4.3.0", "vite-plugin-eslint": "^1.8.1" }
我的.eslintrc.cjs
.eslintrc.cjs
module.exports = { root: true, env: { node: true, browser: true, es6: true, }, extends: [ 'plugin:vue/vue3-recommended', "plugin:vue/vue3-essential", "prettier", ], plugins: [ "vue", 'prettier' ], rules: {} }
我的vite.config.js
vite.config.js
import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; import eslintPlugin from 'vite-plugin-eslint'; export default defineConfig({ plugins: [ eslintPlugin({ exclude: ['./node_modules/**'], include: ['src/**/*.js', 'src/**/*.vue', 'src/**/*.jsx'], cache: false, }), vue() ], });
抱歉,是我的错误没有认真阅读文档,已经解决
感谢您的项目
我希望在浏览器中输出这些报错信息,请问我应该如何配置。
我阅读了文档,我现在的项目可以实现在开发的控制台中输出eslint的相关警告和报错信息,但是开发人员仍然可以忽略这些信息。
目前浏览器渲染正常,没有阻止开发人员。如果希望在浏览器可以阻止或者输出一些报错信息,请问应该如何配置,烦请不吝赐教
以下是我的一些配置,烦请不吝赐教。
我的
package.json
的devdependecy部分我的
.eslintrc.cjs
我的
vite.config.js