Background:
Webstorm2019.1 editor, import a new project, the package.json has been written, directly NPM install to install node_ Module package. And then the question came…
Problem Description:
Question 1: after installing node_ After the module, the eslint of the project does not work, so it can’t check the syntax and repair automatically; See editor tips eslint:this.cliEnigne is not a XXXX
Question 2: after installing eslint, the verification rules are not what you want…. For example: force all HTML tags to be written in Hump style, & lt; el-button> Change to & lt; ElButton> It’s awkward to look at…
terms of settlement:
The solution to problem 1:
The version of webstorm does not correspond to the version of eslint. I have reduced the version of eslint in the project.
npm uninstall eslint // Uninstall eslint
npm install [email protected] –save-dev // Install a lower version of eslint
be careful: Remember to install it in devdependencies. The following items will not be packaged in the production environment. Command NPM install XXX — When I installed save dev, I didn’t add dev, but it was installed under dependencies. As a result, I couldn’t install it or caused other errors.
The solution to problem 2:
Tried a lot of ways, also rewritten the eslintrc.js rule, added the rules about hump in the rules, but it didn’t work, I don’t know why…..
Finally, compared with the previous project, I changed the version of eslint package to the same one, and the problem was solved!
I changed these two bags
npm install [email protected] –save-dev
npm install [email protected] –save-dev
Little knowledge:
Do you really understand the difference between devdependencies and dependencies?
devdependencies
for local environment development dependencies
User publishing environment
Devdependencies are modules that will only be relied on in the development environment, and the production environment will not be included in the package. Through node_ Env = development or node_ Env = production specifies the development or production environment
the packages that depend on can be used not only in the development environment, but also in the production environment. In fact, this sentence is the key. According to this concept, it’s easy to decide whether to use — save or — save dev when installing a module
div>
Read More:
- Eslint error reporting and resolution
- Solution to prompt “cannot find module ‘eslint config defaults / configurations / eslint’” when submitting with Git
- Webstorm startup error load error: undefined path variables
- Configure eslint in vscode to automatically repair and save the code
- Problems and solutions of error reporting in using swiper in Vue
- Problems with vue project installation No ESLint configuration found
- ESLint: Expected space or tab after ‘//‘ in comment.(spaced-comment)
- Solution of error reporting in PIP installation of iPhone
- Error reporting – the project directly introduces the error reporting and solution of. SCSS file
- Svn notes: error reporting in use
- webstorm npm install –save –save-exact –loglevel error react react-dom react-scripts has failed.
- In many cases, the problem of error reporting by label in latex
- Solution of Prophet error reporting when installing R package in Kubuntu virtual machine environment
- Error reporting using selenium in pycharm
- Processing method of eslint verification error
- Solution of node canvas error reporting in MacOS M1 installation
- Several solutions to HDF5 error reporting in Python environment
- Batch error reporting in Java spring
- Error reporting in CentOS 7 using yum
- Solution to error reporting in Java @ override