@spokedev/eslint-config-jigsaw
v0.1.22-rc1
Published
ESLint rules for Jigsaw.
Downloads
10
Readme
Linting
Contains the linting rules for Jigsaw.
Recommended VS Code Extensions
Please install the following extensions if using VS Code:
- Code Spell Checker - Catch spelling mistakes.
- Cucumber (Gherkin) - Syntax highlighting for Cucumber/Gherkin files.
- DotENV - Syntax highlighting for
.env
files. - EditorConfig - Use the same editor settings as everybody else.
- ESLint - Linter plugin required for this module.
- GitLens - See who committed each line of code.
- Markdown Preview Mermaid - Renders Mermaid graphs in Markdown preview.
- Swagger Viewer - Preview Swagger files.
- TODO Highlight - Highlight
// TODO: ...
comments in code. - vscode-icons - Make the directory tree viewer easier to read.
- Whitespacer - Utility for converting tabs to spaces and back.
- YAML - Syntax highlighting for
.yaml|.yml
files.
Quick Start
To use this linting package in your projects you must include the peerDependencies
listed in the ./package.json
as devDependencies
in your project, and create a .eslintrc.js
file the root directory of your project.
1. Add all the peerDependencies
as devDependencies
in your project:
{
"name": "my-project",
"devDependencies": {
"@jigsaw/eslint-config-jigsaw": "-version-",
"babel-eslint": "-version-",
"eslint": "-version-",
... // See package.json for the full list of other dependencies required.
}
}
2. Make sure you include an engines.node
property in your package.json
containing the minimum supported Node.js version, e.g. ">12"
:
{
"name": "my-project",
"devDependencies": {...},
"engines": {
"node": ">12"
}
}
3. Create an .eslintrc.js
file in the root directory of your project like one of the following:
Using the backend rules
module.exports = {
"extends": "@spokedev/eslint-config-jigsaw/backend",
};
Using the frontend rules
module.exports = {
"extends": "@spokedev/eslint-config-jigsaw/frontend",
};
Using the base rules
module.exports = {
"extends": "@spokedev/eslint-config-jigsaw",
};
Making Changes
The frontend rules are contained in ./frontend.js
and the backend rules in ./backend.js
. You probably want to edit either of those files. The base rules are shared between both the frontend and backend and can be found in ./base.js
.
- Modify the rules you need.
- If using a new plugin, make sure you add it as a
peerDependency
in./package.json
. - Increment the package version with
npm version [patch|minor|major]
. - Git commit and push.
- Publish to npm with
npm publish
. - Update projects with the new npm package version and run
npm update
.