How to turn off eslint detection in vue (multiple methods)

How to turn off eslint detection in vue (multiple methods)

1. Problem Description

When we develop a vue project, we may accidentally choose eslint when creating it. This detection rule is a nightmare for novices and will make you crash. So what should we do if we don't want eslint to detect it? I have summarized some methods for different versions.

2. Problem Solving

1. First is the older vue project

Older projects may have a file like webpack.base.conf.js . If there is this file, just modify it to solve it.

insert image description here

The red-framed part in the above picture shows the file contents in my project. Other projects may have other contents. We can just comment out or remove the contents in the frame.

insert image description here

2. When creating a project, do not choose eslint

insert image description here

3. If the editing software you are using is WebStorm

insert image description here

4. The created project does not have a webpack.base.conf.js file, but has a .eslintrc.js

insert image description here

@vue/standard

Just comment this out.

5. For newer Vue projects, there is no (direct) webpack.base.conf.js file in the directory, but there may be one in node_module. And there is no .eslintrc.js file

In this case, our project's directory structure will generally create a vue.config.js file, and we can operate this file

module.exports = {
  lintOnSave: false
},

After the change, you need to restart the project to take effect. You can turn it off by setting it to false. For other configurations, see the description on the official website

insert image description here

insert image description here

6. Modify the .eslintignore file

There is a file .eslintignore in the root directory. Just add the files you don’t need to check.
For example, if you don't want it to check vue files, then add .vue. Of course, this will prevent all vue files from being checked. Similarly, .js means that all js files will not be checked. The advantage of this is that it is simple and easy to understand, but the disadvantage is that it is a bit troublesome.

This method is basically enough to solve this problem, but the author still recommends that you use this test file when you have some development experience. It can not only cultivate good programming habits, but also make it easier to keep the same style as other people in the team.

This concludes this article on how to turn off eslint detection in vue (multiple methods). For more information about how to turn off eslint detection in vue, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • vue-cli3 solution to cancel eslint code verification
  • How to remove eslint validation from projects built with vue-cli scaffolding
  • Explanation of steps to cancel ESLint code detection in Vue project
  • Solution to remove eslint checker errors in vue cli2 and cli3

<<:  Use Xshell to connect to the Linux virtual machine on VMware (graphic steps)

>>:  MySQL transaction isolation level details

Recommend

Summary of CSS3 practical methods (recommended)

1. Rounded border: CSS CodeCopy content to clipbo...

HTML blockquote tag usage and beautification

Blockquote Definition and Usage The <blockquot...

MySQL establishes efficient index example analysis

This article uses examples to describe how to cre...

Installation and configuration method of Zabbix Agent on Linux platform

Here is a brief summary of the installation and c...

Summary of MySQL 8.0 Online DDL Quick Column Addition

Table of contents Problem Description Historical ...

Summary of the understanding of virtual DOM in Vue

It is essentially a common js object used to desc...

A "classic" pitfall of MySQL UPDATE statement

Table of contents 1. Problematic SQL statements S...

4 functions implemented by the transform attribute in CSS3

In CSS3, the transform function can be used to im...

Analysis of MySQL Aborted connection warning log

Preface: Sometimes, the session connected to MySQ...

5 Easy Ways to Free Up Space on Ubuntu

Preface Most people will probably perform this op...

A detailed guide to custom directives in Vue

Table of contents 1. What is a custom instruction...

Nginx configuration and compatibility with HTTP implementation code analysis

Generate SSL Key and CSR file using OpenSSL To co...

How to use Axios asynchronous request API in Vue

Table of contents Setting up a basic HTTP request...