how to report eslint warning and errors and exit
suconghou opened this issue · 2 comments
suconghou commented
I found this lib only format code but do nothing with eslintConfig
eslint app.js --fix
will report error and exit
but this lib never report warning or errors such as
no-unused-vars
no-console
no-undef
what should I do lint the code with eslint and then format with prettier
const config = {
eslintConfig: {
env: {
browser: true,
es6: true,
node: true,
},
parserOptions: {
ecmaVersion: 7,
parser: 'babel-eslint',
sourceType: 'module',
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
parser: 'vue-eslint-parser',
rules: {
'no-console': 2,
'no-unused-vars': 2,
'no-mixed-spaces-and-tabs': 2,
'no-useless-escape': 2,
indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
},
useEslintrc: true,
reportUnusedDisableDirectives: true,
},
prettierOptions: {
printWidth: 120,
tabWidth: 4,
singleQuote: true,
useTabs: true,
semi: true,
trailingComma: 'es5',
bracketSpacing: true,
arrowParens: 'always',
endOfLine: 'lf',
parser: 'babel',
jsxBracketSameLine: false,
},
fallbackPrettierOptions: {
printWidth: 120,
tabWidth: 4,
singleQuote: true,
useTabs: true,
semi: true,
trailingComma: 'es5',
bracketSpacing: true,
arrowParens: 'always',
endOfLine: 'lf',
parser: 'babel',
jsxBracketSameLine: false,
},
prettierLast: true,
};
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: ['vue'],
globals: {
require: false,
module: false,
process: true
},
rules: {
'vue/no-use-v-if-with-v-for': 'error',
'no-unused-vars': 1,
'no-console': 1,
'no-mixed-spaces-and-tabs': 2,
'no-useless-escape': 2,
indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'vue/html-indent': ['error', 'tab']
}
};
"dependencies": {
"@types/node": "^14.0.11",
"art-template": "^4.13.2",
"core-js": "^3.6.5",
"less": "^3.11.2",
"less-plugin-autoprefix": "^2.0.0",
"prettier-eslint": "^10.1.1",
"terser": "^4.7.0"
},
github-actions commented
Stale issue
JackieLs commented
I've got same problem, is there any solution ?