Giter VIP home page Giter VIP logo

eslint-config's Introduction

Teachiq eslint-config

This package is intended to configure everything you need for eslint relevant vscode extensions

Installing

npm install -D @teachiq/eslint-config

Using

Make sure all your local Eslint dependencies are removed along with anything related to prettier.

After install you need a .eslintrc.js in your project.

It should look like this:

module.exports = {
  extends: ['@teachiq/eslint-config/{profile-name}'],
}

Where profile-name should be replaced with one of the profile options

  • vue
  • vue3
  • typescript
  • vue-typescript
  • vue3-typescript

If you want the base linting only add @teachiq instead, like this

module.exports = {
  extends: ['@teachiq'],
}

Note: That should be all you need in your .eslintrc file, unless you explicitly want to override the official config (not recommended)

VScode Extensions

This config works best with the eslint extension

Format on save

In order to get the "format on save" in vscode to work with this config you need to change some user settings.

Your user settings- or workspace settings (the one in the .vscode directory) .json files must include the following:

settings.json

{
  "editor.defaultFormatter": "dbaeumer.vscode-eslint",
  "eslint.format.enable": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.fixAll.stylelint": true
  },
  "eslint.validate": [
    "javascript",
    "vue"
  ]
}

If you have the VSCode StyleLint plugin, make sure .vue files are enabled there as well

"stylelint.validate": [..., "vue"],

Troubleshooting

  • Sometimes the package-lock file doesn't seem to update properly. Try with a fresh install. Remove package-lock and node folder then run install again.

  • Try to install eslint-config with --legacy-peer-deps flag

  • Make sure you removed all project Eslint packages before installation

  • Try rebooting VS Code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.