I have react-native code. I install ESLint. I use it but its show error.
While I use single quotes it show me error
Replace
'react-native'
with"react-native"
eslint(prettier/prettier)
And when I use double qoutes it show me another error
String must use singlequote. eslint(quotes)
here is the screenshot:
What i want is, how to remove error messages about using single quotes? I prefer using single quotes instead double quotes.
To completely disable the quotes rule, set it to either 0 or off in your eslint configuration file (see the different configuration formats here). Example for disabling in json configuration file: { "rules": { "quotes": "off", ... } }
Turns off all rules that are unnecessary or might conflict with [Prettier]. This lets you use your favorite shareable config without letting its stylistic choices get in the way when using Prettier.
1) Disabling "All rules" Two ways you can do this: Put /* eslint-disable-line */ at the end of the line(s), or /* eslint-disable-next-line */ right before the line.
In addition to @Barmar answer, you could also use prettier configuration on a .eslintrc.js
file using the following, property:
rules: {
// ...
'prettier/prettier': ['error', { singleQuote: true }]
}
In your ESLint configuration you want:
quotes: [2, "single"]
In you Pretty configuration you want:
single-quote: true
You should also be consistent in your use of quotes, so you should use single quotes in the second import
line:
import App from './App';
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