@movable/lint-config v0.1.0
@movable/lint-config
Shared lint configuration for Movable Ink
Installation
To start using @movable/lint-config
, add it to your devDependencies
by running:
yarn add -D @movable/lint-config
Note that this will install ESLint and Prettier for you, so you do not need to have these dependencies listed in your own project. This helps us to keep versions consistent across projects.
Prettier
Configure your project to extend from the shared Prettier configuration by creating a file called .prettierrc
in the root of your project:
"@movable/lint-config/prettier"
It is recommended that you configure Prettier this way so that tools like vscode-prettier
can read the file and fix files automatically for you.
ESLint
A few ESLint configurations are provided, based on the kind of environment you are working in.
This sets up some shared rules, as well as configuring ESLint to run Prettier (so that both projects do not have to be run independently). You can extend from the base configuration like so:
// .eslintrc.js
module.exports = {
extends: '@movable/lint-config/eslint'
}
An environment-specific configuration can be used instead by providing the path to that file instead:
// .eslintrc.js
module.exports = {
extends: '@movable/lint-config/eslint/node'
}
Linting Your Project
You can lint your project by running
yarn eslint . --fix
This will automatically fix any fixable issues (like those that Prettier can solve) and report any others for you to fix yourself.
4 years ago