npm package: @spokedev/eslint-config-jigsaw
Description: ESLint rules for Jigsaw.
Author: Josh Cole
Latest version: 0.1.22-rc1

# Linting
Contains the linting rules for Jigsaw.

## Recommended VS Code Extensions
Please install the following extensions if using VS Code:

* [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) - Catch spelling mistakes.
* [Cucumber (Gherkin)](https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete) - Syntax highlighting for Cucumber/Gherkin files.
* [DotENV](https://marketplace.visualstudio.com/items?itemName=mikestead.dotenv) - Syntax highlighting for `.env` files.
* [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) - Use the same editor settings as everybody else.
* [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - Linter plugin required for this module.
* [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) - See who committed each line of code.
* [Markdown Preview Mermaid](https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid) - Renders Mermaid graphs in Markdown preview.
* [Swagger Viewer](https://marketplace.visualstudio.com/items?itemName=Arjun.swagger-viewer) - Preview Swagger files.
* [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight) - Highlight `// TODO: ...` comments in code.
* [vscode-icons](https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons) - Make the directory tree viewer easier to read.
* [Whitespacer](https://marketplace.visualstudio.com/items?itemName=deerawan.vscode-whitespacer) - Utility for converting tabs to spaces and back.
* [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-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:

```json
{
  "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"`:
```json
{
  "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**

```javascript
module.exports = {
  "extends": "@spokedev/eslint-config-jigsaw/backend",
};
```

**Using the frontend rules**

```javascript
module.exports = {
  "extends": "@spokedev/eslint-config-jigsaw/frontend",
};
```

**Using the base rules**

```javascript
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`.

1. Modify the rules you need.
2. If using a new plugin, make sure you add it as a `peerDependency` in `./package.json`.
3. Increment the package version with `npm version [patch|minor|major]`.
4. Git commit and push.
5. Publish to npm with `npm publish`.
6. Update projects with the new npm package version and run `npm update`.