Home > Software engineering >  How to remove the Insert ; errors in react-native followed by prettier prettier
How to remove the Insert ; errors in react-native followed by prettier prettier

Time:06-30

Trying to fix the error since long , not able to figure it out why I am getting errors due to some prettier/prettier thing which keeps on saying that 'Insert ;' / 'Insert enter' in my react-native project.

Also showing error in App.js ERROR: Line 1:9 : Replace View,.Text with .View, .Text. prettier/prettier

Here is my .eslintrc.js file :

module.exports = {
    root:true,
    extends:'@react-native-community'
}

Here is my prettier.js file :

module.exports = {
    arrowParens:'avoid',
    bracketSameLine:true,
    bracketSpacing:false,
    singleQuote:true,
    trailingComma: 'all',
}

App.js first line

import {View , Text} from 'react-native'

I have installed the need eslint and other packages but it didn't solved.Also I don't have any VScode extensions related to them installed. Any help would be appreciated !

CodePudding user response:

have you tried to installing prettier - code formatter . and also try to enable format on save How do you format code on save in VS Code

CodePudding user response:

Got the answer after searching a lot!

Change eslintrc.js a bit as below:

module.exports = { root:true, extends:'@react-native-community' rules:{ 'prettier/prettier':0 } }

That would solve the issue!

  • Related