I'm having trouble using the ESLint CLI with the --rule
option.
# This is what I tried
eslint --rule "{no-console: error}" --fix-dry-run .
Resulting in the following error:
Invalid value for option 'rule' - expected type Object, received value: {no-console:.
What is the right way of using the --rule
option? I have ESLint installed locally and use npx
to run it.
- Node.js version 14.15.0
- ESLint version 7.14.0
- OS Windows 10
.eslintrc.js
module.exports = {
env: {
browser: true,
es2021: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'prettier',
'prettier/vue'
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 12,
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
};