Skip to content

@we/eslint-config

Install

bash
yarn add -D eslint git+https://git.weconstudio.it/we/eslint-config.git

Config .eslintrc.js

js
module.exports = {
  extends: "@we/eslint-config/nuxt",
  rules: {
    // custom rules
  },
};

Add scripts for package.json

For example:

json
{
  "scripts": {
    "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
    "lint": "yarn lint:js",
    "lintfix": "yarn lint:js --fix"
  }
}

Config VS Code auto fix

Install VS Code ESLint extension and create .vscode/settings.json

json
{
  "prettier.enable": false,
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}