Vue with the use of hand-foot racks generated by the project directly modified. vue file, save the compilation on the report of a lot of errors, the solution:

Source: Internet
Author: User
Vue with the use of hand-foot racks generated by the project directly modified. vue file, save the compilation on the report of a lot of errors, solution: a problem:

Because set the Eslint, if you do not want to have the specification of JS code, can be reinitialized to turn off the eslint. Use Eslint to lint your code? (y/n) This step select No

If you want to have good specifications, in fact, the error has been very clear, most of the indentation is not standardized, the semicolon does not need to wait for the reason, it is easy to solve. It becomes a habit to write more.
Second, or modify the configuration in Eslint:
1. No more empty lines (No-multiple-empty-lines)
Solution: Http://eslint.org/docs/rules/no-multiple-empty-lines 2.        Semi Extra semicolon (extra semicolon) if you want to impose a semicolon, you will report the above error, such as, in the Vue interface file Mainjs to impose a semicolon, the solution: in the Eslintrc.js file configuration Specific details: Http://eslint.org/docs/rules/semi
3. NewLine required at the end of the file but not found literally translates to saying that a newline character is not found when the file ends. Solution: In the face of this error, directly in the corresponding file in the last enter the right, this is too easy, it is not worthy of the map
4.Expect to indent the 2 spaces, but found the 4 expected indent 2 spaces, but found 4 if you want this hint format, details: Http://eslint.org/docs/rul Es/indent in my project, I am not the format of this hint, so how do we do it, very simply, we just configure ' indent ' in rules under the Eslintrc.js file: 0 And so on, such as the 2nd problem in the figure of the set indent spaces, different bugs corresponding to different settings, click the link query.
Third, the use of VUE-CLI scaffolding to build the Webpack project, in the development process, the eslint verification is too rigorous, want to pass this validation to shut down, the operation is as follows:

Remove the following in the Webpack.base.conf.js:

Preloaders: [
      {
        test:/\.vue$/,
        loader: ' Eslint ',
        include:projectroot,
        exclude: [/node_modules /,/ignore_lib/]
      },
      {
        test:/\.js$/,
        loader: ' Eslint ',
        include:projectroot,
        exclude: [/ node_modules/,/ignore_lib/]
      }
    

Or do not want to check the file just like the above create a ignore_lib, and then throw it all in.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.