1.4.0 • Published 2 years ago

@zoovu/eslint-config-custom v1.4.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
2 years ago

Linting

This package helps you in setting up linting for a new or existing custom project. It contains a script which removes unused or deprecated configurations (e.g. TSLint), and configures ESLint.

ESLint is configured to check the code for compliance with recommended rules from Official ESLint plugin for Vue.js, Airbnb JavaScript Style Guide and recommended rules from TypeScript ESLint plugin. It also runs Prettier as the final rule in order to handle consistent code formatting.

Developing

If you want to extend rules, find the appropriate files within /configs directory.

To publish the new config simply run yarn publish, and set the new version (make sure it works before you do that).

Also, do not forget to update version in package.json.

Setup within projects

  1. Add package dependency to your project.
yarn add @zoovu/eslint-config-custom -D
  1. Run the init command.
yarn zoovu-custom-linting init
  1. After performing first two steps, configuration setup is finished and you should already notice some warnings in your editor. Additionally, you can also add a script to your project's package.json in order to be able to lint the whole project with just one command.
{
  "scripts": {
    "lint": "eslint --ext .js,.vue,.ts src --fix"
  }
}

VS Code users

Install the ESLint plugin and you should have linting support out-of-the-box.

Typescript warning

During linting, you may encounter a message complaining about unsupported TypeScript version. To get rid of that message and start using the latest TypeScript (not the version provided by WBC), add it as your project's dependency.

yarn add typescript -D