I m working on reactjs web app, which has eslintrc.json file. In this file I have set few eslint rules off/warn so as to skip them instead of error. npm run lint works fine locally, but during build it gives eslint errors.
//package.json
"scripts": {
"build": "env-cmd -f .env.development react-scripts build",
"lint": "eslint .",
.
.
.
}
//eslintrc
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"react-app",
"react-app/jest",
"plugin:react/recommended",
"airbnb",
"plugin:prettier/recommended"
],
"overrides": [],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "prettier"],
"rules": {
"quotes": [
"error",
"double",
{
"avoidEscape": true
}
],
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", ".jsx"]
}
],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react/static-property-placement": "off",
"react/jsx-props-no-spreading": "warn",
"no-shadow": "off",
"no-underscore-dangle": "off",
"default-param-last": "off",
"prettier/prettier": ["error", { "endOfLine": "auto" }],
"no-unused-vars": "off",
"import/no-cycle": "off",
"no-console": "off",
"no-param-reassign": 0,
}
}
Above are the file with eslint rules and scripts mentioned