'How to disable eslint(prettier/prettier) single quotes error
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.
Solution 1:[1]
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 }]
}
Solution 2:[2]
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';
Solution 3:[3]
The two answers here helped me get to the solution that worked for me. In my .eslintrc file, I added the following:
"rules": {
"prettier/prettier": ["error", { "singleQuote": true }]
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | albertTaberner |
| Solution 2 | |
| Solution 3 | ConcernedHobbit |
