The error “package.json » eslint-config-react-app/jest#overrides[0]: environment key ‘jest/globals’ is unknown” occurs when the Jest environment configuration is not recognized by ESLint.
To resolve this error, you need to update the ESLint configuration in your package.json file. Specifically, you need to add the “jest” environment key to the overrides section of the eslintConfig object.
Here is an example of how the updated package.json file should look like:
{
"eslintConfig": {
"extends": "react-app",
"overrides": [
{
"files": ["**/*.test.js", "**/*.spec.js"],
"env": {
"jest": true
}
}
]
}
}
In the above example, the “jest” environment key is added to the overrides section. This tells ESLint that the specified files (in this case, any file with a .test.js or .spec.js extension) should be parsed with Jest-specific environment settings.
- Package ‘@angular/core’ is not a dependency.
- Display nested JSON data in HTML table using JavaScript dynamically
- Html table javascript add column dynamically?
- Package io/fs: unrecognized import path “io/fs”: import path does not begin with hostname
- P-calendar width
- Package java.sql is not accessible
- Package “bootstrap” was found but does not support schematics.
- Package:stats’ may not be available when loading