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

@vue/eslint-config-standard

Package Overview
Dependencies
Maintainers
5
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/eslint-config-standard

eslint-config-standard for Vue.js projects


Version published
Weekly downloads
106K
decreased by-7.53%
Maintainers
5
Created
Weekly downloads
 

Package description

What is @vue/eslint-config-standard?

@vue/eslint-config-standard is an ESLint configuration package specifically designed for Vue.js projects. It extends the standard ESLint rules with additional rules and settings tailored for Vue.js development, ensuring code quality and consistency.

What are @vue/eslint-config-standard's main functionalities?

Standard JavaScript Rules

This feature extends the standard ESLint rules along with essential Vue.js rules. It ensures that your JavaScript code adheres to widely accepted best practices and coding standards.

{"extends":["eslint:recommended","plugin:vue/essential","@vue/standard"]}

Vue.js Specific Rules

This feature includes rules specific to Vue.js, such as preventing unused variables in Vue components and ensuring that templates have a single root element.

{"extends":["plugin:vue/essential"],"rules":{"vue/no-unused-vars":"error","vue/no-multiple-template-root":"error"}}

Code Formatting

This feature enforces consistent code formatting rules, such as no semicolons and 2-space indentation, to maintain a uniform code style across the project.

{"extends":["@vue/standard"],"rules":{"semi":["error","never"],"indent":["error",2]}}

Other packages similar to @vue/eslint-config-standard

Readme

Source

@vue/eslint-config-standard

eslint-config-standard for Vue

This config is specifically designed to be used by @vue/cli & create-vue setups and is not meant for outside use (it can be used but some adaptations on the user side might be needed - for details see the config file).

A part of its design is that this config may implicitly depend on other parts of @vue/cli/create-vue setups, such as eslint-plugin-vue being extended in the same resulting config.

Installation

In order to work around a known limitation in ESLint, we recommend you to use this package alongside @rushstack/eslint-patch, so that you don't have to install too many dependencies:

npm add --dev @vue/eslint-config-standard @rushstack/eslint-patch

Usage

An example .eslintrc.cjs:

require("@rushstack/eslint-patch/modern-module-resolution")

module.exports = {
  root: true,
  extends: [
    'plugin:vue/vue3-essential',
    '@vue/eslint-config-standard'
  ]
}

Aliases

By default, none of the built-in rules require you to configure aliases in ESLint.

But if you want to enable some additional rules that need to actually resolve the imported module on the filesystem (e.g. import/no-unresolved) by yourself, you should configure it. In that case, we provided a helper function to simplify the task.

For example, it is a widely accepted convention to use @ as an alias to the src folder in the Vue ecosystem. To enable this, you can use the following config:

require('@rushstack/eslint-patch/modern-module-resolution')

const path = require('node:path')
const createAliasSetting = require('@vue/eslint-config-standard/createAliasSetting')

module.exports = {
  root: true,
  extends: [
    'plugin:vue/vue3-essential',
    '@vue/eslint-config-standard'
  ],
  rules: {
    'import/no-unresolved': 'error'
  }
  settings: {
    ...createAliasSetting({
      '@': `${path.resolve(__dirname, './src')}`
    })
  }
}

createAliasSetting accepts a map of aliases and their corresponding paths, and returns a settings object to be spread in to the settings field of the ESLint config.

Keywords

FAQs

Package last updated on 22 Jul 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