Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@nuxtjs/eslint-config

nuxt989.3kMIT12.0.0

ESlint config used for Nuxt

readme

Nuxt ESLint Config

GitHub Actions npm npm (scoped with tag)

ESlint config used for Nuxt.

Usage

Do you want to add the config to your own projects? There you go:

  1. Add this package to your devDependencies
$ npm i -D @nuxtjs/eslint-config
# or
$ yarn add -D @nuxtjs/eslint-config
  1. Install eslint if not already present locally or globally
$ npm i -D eslint
# or
$ yarn add -D eslint
  1. Create a .eslintrc file

  2. Extend our config (you can use just the scope name as ESLint will assume the eslint-config prefix):

{
  "extends": [
    "@nuxtjs"
  ]
}

Full example

A full example .eslintrc for a project with babel support:

Dont forget to npm i -D @babel/eslint-parser or yarn add -D @babel/eslint-parser

{
  "root": true,
  "parser": "@babel/eslint-parser",
  "parserOptions": {
    "sourceType": "module"
  },
  "extends": [
    "@nuxtjs"
  ]
}

TypeScript

If you're using TypeScript, follow Usage section by replacing @nuxtjs/eslint-config by @nuxtjs/eslint-config-typescript.

And in your .eslintrc all you need is :

{
  "extends": [
    "@nuxtjs/eslint-config-typescript"
  ]
}

You can then edit/override same rules as you could with @nuxtjs/eslint-config but also TypeScript rules. You can find the list of supported TypeScript rules here.

Also see Nuxt TypeScript Support.

License

Setup inspired by eslint-config-standard

Published under the MIT License.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

12.0.0 (2022-11-16)

Features

11.0.0 (2022-08-31)

Bug Fixes

  • disable vue/multi-word-component-names for files in subdirectories (#211) (c54d7fd), closes #208

10.0.0 (2022-05-02)

Bug Fixes

  • add missing dependency eslint-plugin-n (022aa5f)
  • add missing peer dependency eslint-plugin-import (resolves #148) (80f0b89)
  • disable vue/multi-word-component-names for app.vue and error.vue (resolves #201) (bbb0e27)
  • disable multiword-rule (#190) (821057e)
  • eslint-config-typescript: use parser config (7617549)
  • eslint-plugin-import ordering errors in windows (39ad2b4)
  • eslint-plugin-import ordering errors in windows (4f6f4a9)
  • remove dependency on eslint-plugin-standard (#185) (ee47f83)
  • turn off typescript 'no-undef' rule per docs (#144) (ddb552b)
  • typescript: import/named errors when using TypeScript (#170) (401d626)
  • use @typescript-eslint/parser under vue-eslint-parser (bea5b05)
  • feat!: remove eslint-plugin-jest dependency (resolves #180) (952edbb), closes #180

Features

  • update eslint config packages (a3bb0bf)
  • warn console and debugger in dev (#56) (425a8fa)

BREAKING CHANGES

  • You have to manually add jest plugin and jest/globals to the env object in eslint config