Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

ESLint / Prettier / Husky indent problems in React-Native app

$
0
0

I have a problem, when I commit, I have Husky which checks for indentation errors / usual errors (like props are not used.... etc). My app is a TypeScript React-Native app.

I am getting the following:

  25:1   error  Expected indentation of 4 spaces but found 2      indent  26:1   error  Expected indentation of 2 spaces but found 0      indent  27:1   error  Expected indentation of 4 spaces but found 2      indent  28:1   error  Expected indentation of 6 spaces but found 4      indent  29:1   error  Expected indentation of 8 spaces but found 6      indent  30:1   error  Expected indentation of 8 spaces but found 6      indent  31:1   error  Expected indentation of 10 spaces but found 8     indent  32:1   error  Expected indentation of 10 spaces but found 8     indent  33:1   error  Expected indentation of 10 spaces but found 8     indent  34:1   error  Expected indentation of 10 spaces but found 8     indent  35:1   error  Expected indentation of 10 spaces but found 8     indent  36:1   error  Expected indentation of 8 spaces but found 6      indent  37:1   error  Expected indentation of 6 spaces but found 4      indent  39:1   error  Expected indentation of 6 spaces but found 4      indent  40:1   error  Expected indentation of 8 spaces but found 6      indent  41:1   error  Expected indentation of 8 spaces but found 6      indent  42:1   error  Expected indentation of 8 spaces but found 6      indent  43:1   error  Expected indentation of 8 spaces but found 6      indent  44:1   error  Expected indentation of 6 spaces but found 4      indent  45:1   error  Expected indentation of 4 spaces but found 2      indent  46:1   error  Expected indentation of 2 spaces but found 0      indent

My VSCode is set to 2 spaces,

My eslint.rc rule is "indent": ["error", 2] and my prettier.rc is set to "tabWidth": 2,I don't understand why it's giving errors, the code is formatted as it should be. I even ran prettier myself command-shift-f on Mac.

Any ideeas?


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>