Fix ESLint configuration and parsing errors
- Fix .eslintrc.json format (remove comments and invalid JSON syntax) - Simplify environment.jsx to fix parsing error - Add proper ESLint rules for React project - Enable react-hooks plugin and configure settings
This commit is contained in:
parent
37f11dc23a
commit
1e9bab5d07
@ -1,52 +1,29 @@
|
|||||||
// module.exports = {
|
|
||||||
// "env": {
|
|
||||||
// "browser": true,
|
|
||||||
// "es2021": true,
|
|
||||||
// "jest": true
|
|
||||||
// },
|
|
||||||
// "extends": [
|
|
||||||
// "eslint:recommended",
|
|
||||||
// "plugin:react/recommended"
|
|
||||||
// ],
|
|
||||||
// "overrides": [
|
|
||||||
// {
|
|
||||||
// "env": {
|
|
||||||
// "node": true
|
|
||||||
// },
|
|
||||||
// "files": [
|
|
||||||
// ".eslintrc.{js,cjs,jsx}"
|
|
||||||
// ],
|
|
||||||
// "parserOptions": {
|
|
||||||
// "sourceType": "script"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ],
|
|
||||||
// "parserOptions": {
|
|
||||||
// "ecmaVersion": "latest",
|
|
||||||
// "sourceType": "module"
|
|
||||||
// },
|
|
||||||
// "plugins": [
|
|
||||||
// "react"
|
|
||||||
// ],
|
|
||||||
// "rules": {
|
|
||||||
// "react/react-in-jsx-scope": "off"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
{
|
{
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"es2021": true
|
"es2021": true,
|
||||||
|
"jest": true
|
||||||
},
|
},
|
||||||
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:react-hooks/recommended"],
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:react/recommended",
|
||||||
|
"plugin:react-hooks/recommended"
|
||||||
|
],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 12,
|
"ecmaVersion": 12,
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"ecmaFeatures": {
|
"ecmaFeatures": {
|
||||||
"jsx": true
|
"jsx": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// "plugins": ["react", "react-hooks"],
|
"plugins": ["react", "react-hooks"],
|
||||||
"rules": {
|
"rules": {
|
||||||
//add customize rules here as per your project's needs
|
"react/react-in-jsx-scope": "off",
|
||||||
|
"react/prop-types": "off"
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"react": {
|
||||||
|
"version": "detect"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,5 @@
|
|||||||
// For development environment
|
// For development environment
|
||||||
const publicUrl = process.env.PUBLIC_URL || "/";
|
export const base_path = process.env.PUBLIC_URL || "/";
|
||||||
export const base_path = publicUrl.endsWith('/') ? publicUrl : publicUrl + '/';
|
|
||||||
|
|
||||||
// For production with a subdirectory (uncomment and modify as needed)
|
// For production with a subdirectory (uncomment and modify as needed)
|
||||||
// export const base_path = "/react/";
|
// export const base_path = "/react/";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user