Skip to content

Instantly share code, notes, and snippets.

@ghughes13
Last active April 13, 2021 17:06
Show Gist options
  • Save ghughes13/b7888e5f40cd05138e0dda81063a814e to your computer and use it in GitHub Desktop.
Save ghughes13/b7888e5f40cd05138e0dda81063a814e to your computer and use it in GitHub Desktop.
How to add eslint
  1. git pull origin master to ensure to update package.json
  2. npm install to install updates to eslint packages
  3. In VS Code, install the ESLint (dbaeumer.vscode-eslint) extension.
  4. Open the command palette => Search for: Preferences: Open Settings(JSON) => add the following options inside the settings object:
"eslint.workingDirectories": [
    {
      "mode": "auto"
    }
  ],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false
},
"eslint.codeAction.showDocumentation": {
    "enable": true
},
  1. Eslint errors/warnings should now show up in files.

*If you get to a step and something doesn't work, restart VS Code. *If that doesn't work look in the bottom right and click on 'ESLint' to see if it's giving any errors.

eslint: https://eslint.org/docs/rules/ eslint-plugin-vue: https://eslint.vuejs.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment