You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@vue/cli-plugin-eslint

Package Overview
Dependencies
Maintainers
3
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/cli-plugin-eslint

eslint plugin for vue-cli


Version published
Weekly downloads
465K
decreased by-2.88%
Maintainers
3
Install size
18.7 MB
Created
Weekly downloads
 

Package description

What is @vue/cli-plugin-eslint?

@vue/cli-plugin-eslint is a Vue CLI plugin that adds ESLint support to your Vue.js projects. It helps in maintaining code quality and consistency by integrating ESLint, a popular linting tool for JavaScript, into the Vue development workflow.

What are @vue/cli-plugin-eslint's main functionalities?

Linting on Save

This feature enables linting of your code every time you save a file. It helps catch errors and enforce coding standards in real-time.

module.exports = {
  lintOnSave: true
};

Custom ESLint Configuration

This feature allows you to customize the ESLint configuration to fit your project's specific needs. You can add custom rules, plugins, and settings.

module.exports = {
  lintOnSave: true,
  configureWebpack: {
    module: {
      rules: [
        {
          enforce: 'pre',
          test: /\.js$/,
          loader: 'eslint-loader',
          exclude: /node_modules/
        }
      ]
    }
  }
};

Linting Scripts

This feature adds a linting script to your package.json file, enabling you to run ESLint checks via the command line. This is useful for integrating linting into your CI/CD pipeline.

{
  "scripts": {
    "lint": "vue-cli-service lint"
  }
}

Other packages similar to @vue/cli-plugin-eslint

Changelog

Source

5.0.4 (2022-03-22)

:bug: Bug Fix
  • @vue/cli-service
    • #7005 Better handling of publicPath: 'auto' (@AndreiSoroka)
  • @vue/cli-shared-utils, @vue/cli-ui
    • 75826d6 fix: replace node-ipc with @achrinza/node-ipc to further secure the dependency chain
Committers: 1

Readme

Source

@vue/cli-plugin-eslint

eslint plugin for vue-cli

Injected Commands

  • vue-cli-service lint

    Usage: vue-cli-service lint [options] [...files]
    
    Options:
    
      --format [formatter] specify formatter (default: stylish)
      --no-fix             do not fix errors
      --max-errors         specify number of errors to make build failed (default: 0)
      --max-warnings       specify number of warnings to make build failed (default: Infinity)
      --output-file        specify file to write report to
    

Lints and fixes files. If no specific files are given, it lints all files in src and tests, as well as all JavaScript files in the root directory (these are most often config files such as babel.config.js or .eslintrc.js).

Other ESLint CLI options are not supported.

::: tip vue-cli-service lint will lint dotfiles .*.js by default. If you want to follow ESLint's default behavior instead, consider adding a .eslintignore file in your project. :::

Configuration

ESLint can be configured via .eslintrc or the eslintConfig field in package.json. See the ESLint configuration docs for more detail.

::: tip The following option is under the section of vue.config.js. It is respected only when @vue/cli-plugin-eslint is installed. :::

Lint-on-save during development with eslint-loader is enabled by default. It can be disabled with the lintOnSave option in vue.config.js:

module.exports = {
  lintOnSave: false
}

When set to true, eslint-loader will emit lint errors as warnings. By default, warnings are only logged to the terminal and does not fail the compilation.

To make lint errors show up in the browser overlay, you can use lintOnSave: 'error'. This will force eslint-loader to always emit errors. this also means lint errors will now cause the compilation to fail.

Alternatively, you can configure the overlay to display both warnings and errors:

// vue.config.js
module.exports = {
  devServer: {
    overlay: {
      warnings: true,
      errors: true
    }
  }
}

When lintOnSave is a truthy value, eslint-loader will be applied in both development and production. If you want to disable eslint-loader during production build, you can use the following config:

// vue.config.js
module.exports = {
  lintOnSave: process.env.NODE_ENV !== 'production'
}

Installing in an Already Created Project

vue add eslint

Injected webpack-chain Rules

  • config.module.rule('eslint')
  • config.module.rule('eslint').use('eslint-loader')

Keywords

FAQs

Package last updated on 22 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc