We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// webpack.base.config.js module: { loaders: [ { test: /\.(js|vue)$/, // 只有src文件用eslint-loader include: [resolve('../src')], // *一定要加这个 否则检测不到* enforce: 'pre', use: [{ loader: 'eslint-loader', options: { // 不符合Eslint规则时只console warning(默认false 直接console error) // emitWarning: true } }] }, .... ] },
react需要安装 "babel-eslint": "^8.2.6", "eslint-config-standard": "~11.0.0", "eslint-plugin-import": "~2.8.0", "eslint-plugin-jsx-a11y": "~6.0.3", "eslint-plugin-node": "^5.2.0", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-react": "~7.5.1", "eslint-plugin-standard": "^3.0.1", vue需要安装 "babel-eslint": "^7.1.1", "eslint-config-standard": "^10.2.1", "eslint-plugin-html": "^3.0.0", "eslint-plugin-import": "^2.7.0", "eslint-plugin-node": "^5.2.0", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^3.0.1",
// .eslintrc.js module.exports = { // eslint找当前配置文件不再往父级查找 "root": true, "extends": "standard", "parser": "babel-eslint", "plugins": [ "react" // 如果是vue 这里是html ], "rules": { // 关闭统一换行符,"\n" unix(for LF) and "\r\n" for windows(CRLF),默认unix "linebreak-style": "off", // 某些变量未引用不报错 "no-unused-vars": "off" } }
/dist/ /node_modules/ /notes/
/*eslint-disable*/ import * as types from '../constants/ActionTypes'; /*eslint-disable*/
{ // 保存自动修正 "eslint.autoFixOnSave": true, "eslint.validate": [ "javascript", "javascriptreact", { "language": "html", "autoFix": true }, { "language": "vue", "autoFix": true } ] ...... }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
eslint 应用
The text was updated successfully, but these errors were encountered: