I'm using airbnb's eslint with webpack like this:
.eslintrc
:
{
"extends": "airbnb"
}
webpack.config.js
:
...
module: {
rules: [
{
test: /\.js$/,
use: ['babel-loader', 'eslint-loader'],
include: path.join(__dirname, 'src')
},
...
]
}
...
This works, but all the eslint rules show up as errors, eg:
1:28 error Missing semicolon semi
2:45 error Missing semicolon semi
5:7 error Unexpected space before function parentheses space-before-function-paren
How can I set it up so that all the rules from airbnb's eslint are warnings instead of errors?
To show warnings instead of errors on all ESLint rules with React, we set each rule to 'warm' in . eslintrc. to set "prettier/prettier" to "warn' in "rules' to make ESLint return a warning instead of an error when the rule is violated.
There are two primary ways to configure ESLint: Configuration Comments - use JavaScript comments to embed configuration information directly into a file. Configuration Files - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories.
Yes, with eslint-config-airbnb-typescript. It doesn't have TypeScript-specific rules, it is simply compatible.
Approach #1 adjust specific rules in .eslintrc
:
{
"extends": "airbnb"
"rules": {
"camelcase": "warn",
...
}
}
see Configuring Rules
Approach #2 adjust eslint-loader
to emit warnings instead of errors for all rules:
{
...
loader: "eslint-loader",
options: {
emitWarning: true,
}
}
see Errors and Warning
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With