Legacy

@nuxtjs/eslint-config

Opinionated ESlint configuration used internally for Nuxt 2 projects.

Opinionated ESlint configuration used internally for Nuxt 2 projects.

This package is for Nuxt 2. For Nuxt 3 projects, use @nuxt/eslint instead.
This package is in maintainance mode and no longer have active developments.
Source code on GitHub

Usage

  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/eslint-config"]
}

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 and you can read more about Nuxt's TypeScript support in the docs.