How to disable eslint(prettier/prettier) single quotes error

alfian5229 picture alfian5229 · Aug 4, 2019 · Viewed 9.3k times · Source

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:

screenshot

What i want is, how to remove error messages about using single quotes? I prefer using single quotes instead double quotes.

Answer

albertTaberner picture albertTaberner · Dec 5, 2020

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 }]
  }