Dva application code git commits, vscode tips “always find module ‘eslint – config – defaults/configurations/eslint’ Referenced from: c: \ Users \ \. XXX eslintrc
Cause analysis,
Use eslintrc syntax check module dva application in git commits vscode will from the project component and its parent directory (English ancestors) looking for local. Eslintrc file (eslint configuration file).
If the file is not found, the C: /Users/ XXX /.eslintrc file is sought (this is the global configuration file).
Let’s open a global file like this
{
/* See all the pre-defined configs here: https://www.npmjs.com/package/eslint-config-defaults */
"extends": "defaults/configurations/eslint",
"parser": "babel-eslint",
"ecmaFeatures": {
"jsx": true
},
"plugins": [
"react"
],
"env": {
"amd": true,
"browser": true,
"jquery": true,
"node": true,
"es6": true,
"worker": true
},
"rules": {
"eqeqeq": 2,
"comma-dangle": 1,
"no-console": 0,
"no-debugger": 1,
"no-extra-semi": 1,
"no-extra-parens": 1,
"no-irregular-whitespace": 0,
"no-undef": 0,
"no-unused-vars": 0,
"semi": 1,
"semi-spacing": 1,
"valid-jsdoc": [
2,
{ "requireReturn": false }
],
"react/display-name": 2,
"react/forbid-prop-types": 1,
"react/jsx-boolean-value": 1,
"react/jsx-closing-bracket-location": 1,
"react/jsx-curly-spacing": 1,
"react/jsx-indent-props": 1,
"react/jsx-max-props-per-line": 0,
"react/jsx-no-duplicate-props": 1,
"react/jsx-no-literals": 0,
"react/jsx-no-undef": 1,
"react/jsx-sort-prop-types": 1,
"react/jsx-sort-props": 0,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-danger": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-direct-mutation-state": 1,
"react/no-multi-comp": 1,
"react/no-set-state": 0,
"react/no-unknown-property": 1,
"react/prop-types":0,
"react/react-in-jsx-scope": 0,
"react/require-extension": 1,
"react/self-closing-comp": 1,
"react/sort-comp": 1,
"react/wrap-multilines": 1
}
}
As you can see, the file references defaults/configurations/eslint; This error is usually reported because the project does not have the module referenced in the configuration file installed.
The solution
Method 1,
Still using eslint, installing ‘eslint – config – defaults/configurations/eslint’ module;
See https://www.npmjs.com/package/eslint-config-defaults;
NPM instruction
npm install --save-dev eslint eslint-config-defaults
There are many syntax errors when git is committed. These rules are defined by the Eslint configuration file. Just follow the change
Method 2,
Delete the global configuration file and add the local.eslintrc file in the project root. The file content can be customized to their own needs to modify the content; Such as the following is my own version; Just umi; There is no reference to the error module, while avoiding the tedious grammar check (of course, it is not recommended to do this, it helps to ensure the code style in the collaborative development process is unified and easy to maintain);
{
"extends": "umi"
}
div>
Read More:
- Failed to load plugin jsdoc: Cannot find module ‘eslint-plugin-jsdoc‘
- [How to Fix] Cannot find module ‘babel-eslint‘
- Failed to load plugin react: cannot find module ‘eslint plugin react’ appears when running Vue project‘
- Problems with vue project installation No ESLint configuration found
- Solution of “do not use ‘new’ for side effects” for eslint verification of Vue project
- Processing method of eslint verification error
- Error reporting of eslint in webstorm
- Configure eslint in vscode to automatically repair and save the code
- Error: solution to the problem of cannot find module ‘webpack / bin / config yargs’
- Error: Cannot find module’webpack/bin/config-yargs’ solution
- Eslint error handling: ‘QQ’ is not defined
- Vscode error parsing error: invalid ecmaVersion.eslint ‘import’
- Vue: validation syntax error of eslint
- Uniapp ESLint error: ‘uni‘ is not defined no-undef [How to Solve]
- ESLint: Expected space or tab after ‘//‘ in comment.(spaced-comment)
- Vscode development Vue project eslint check error
- Solved – problem cannot find module ‘webpack / bin / config yargs’
- Eslint error reporting and resolution
- When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error [How to Fix]
- Cannot find module ‘webpack cli / bin / config yargs‘