DEV Community

Discussion on: Linting Your React+Typescript Project with ESLint and Prettier!

Collapse
 
michalpuskel profile image
Michal Puškel • Edited

Thank you, great tutorial!,
finally my ESlint works for TS almost properly.

Though, for me there is some rule conflict between eslint and prettier
and it either always inserts once 2 spaces on next file save 4 spaces. Or some weird tab is inserted.

Anyone same problem? How to fix, please?

I tried literally every possible combination of settings for
vscode workspace:
codepile.net/pile/83MNXYDz
prettier:
codepile.net/pile/ZwNz6vwE
eslint:
codepile.net/pile/4Q7Y0BxM

I have macOS Sierra 10.12.6
VSCode v. 1.35.1.

screenshot:
ibb.co/9Y7xSVp

Collapse
 
michalpuskel profile image
Michal Puškel

SOLVED:
youtube.com/watch?v=mg_pDqszL3g

add rule "@typescript-eslint/indent": "off" to .eslintrc

{
  "parser": "@typescript-eslint/parser",
  "extends": [
    "plugin:@typescript-eslint/recommended",
    "react-app",
    "plugin:prettier/recommended"
  ],
  "plugins": ["@typescript-eslint", "react"],
  "rules": {
    "no-console": "warn",
    "no-debugger": "warn",
    "@typescript-eslint/indent": "off"
  }
}

Collapse
 
dorshinar profile image
Dor Shinar

I'm sorry I didn't get a chance to look into your problem, but I'm glad you figured it out. I've faced the same issue and solved it this way too.

Thread Thread
 
michalpuskel profile image
Michal Puškel

No problem, I'm glad it works! Thanks!