DEV Community

Discussion on: Using ESLint and Prettier in a TypeScript Project

Collapse
 
piavgh profile image
Hoang Trinh

Although I had configured Prettier and ESLint, I still need to add this rule in .eslintrc to have single quotes and no semicolon.

'prettier/prettier': ['error', { singleQuote: true, semi: false }],

If I remove this part { singleQuote: true, semi: false }, the editor will yell when I use single quotes or no semicolon.

This is my .prettierrc:

module.exports = {
  semi: false,
  trailingComma: 'es5',
  singleQuote: true,
  printWidth: 100,
  tabWidth: 2,
}

This is my .eslintrc extends:

extends: [
    'airbnb',
    'plugin:react/recommended',
    'plugin:@typescript-eslint/recommended',
    'prettier/@typescript-eslint',
    'plugin:prettier/recommended',
  ],

According to this article prettier.io/docs/en/integrating-wi..., those 2 above should be enough.

Do you know why?