Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

eslint react native

npm i --dev eslint prettier @react-native-community/eslint-config

// in .eslintrc paste this
{
  "extends": "@react-native-community",
  "rules": {
    "quotes": [
      2,
      "double",
      {
        "avoidEscape": true
      }
    ]
  }
}
// paste this in package.json scripts means check my whole directory for only js files
"lint": "eslint . --ext .js"

// run it like this
npm run lint
// to fix errors
npm run lint -- --fix
 
PREVIOUS NEXT
Tagged: #eslint #react #native
ADD COMMENT
Topic
Name
2+9 =