3.0.1 • Published 12 days ago

@cruk/eslint-config v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 days ago

ESLint config

These are settings for ESLint

What it does

This setup lints your JavaScript code based on practices.

Installation

In the root directory of your repository run:

npm

npm i -D @cruk/eslint-config

yarn

yarn add --dev @cruk/eslint-config

Peer deps

This will install the configuration package but peer dependencies are required for @cruk/eslint-config. To install these:

If using npm 5+ or yarn:

npx install-peerdeps --dev @cruk/eslint-config

If using npm < 5 and Linux/OSX:

(
  export PKG=@cruk/eslint-config;
  npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)

If using npm < 5 and Windows:

npm install -g install-peerdeps
install-peerdeps --dev @cruk/eslint-config

Configuration

Create (or update) an .eslintrc file in the root of your repo with the following content:

{
  "extends": ["@cruk"]
}

Additionally create .eslintignore in the root of your repo. It is recommended that the content of these files match your .gitignore file.

You can test your setup is correct by running

npx eslint --fix-dry-run .

Monorepos

For monorepos the .eslintrc must be modified to handle different tsconfig.json locations. See the content below. The jest version is also set as it cannot be determined at the root package level.

{
  "extends": ["@cruk"],
  "parserOptions": {
    "sourceType": "module",
    "project": ["./packages/*/tsconfig.json"]
  },
  "settings": {
    "jest": {
      "version": 26
    }
  }
}

This repository is inspired by eslint-config-wesbos.

The peer dependency instructions are inherited from eslint-config-airbnb.

3.0.1

12 days ago

3.0.0

2 months ago

2.3.0

3 months ago

2.2.0

4 months ago

2.1.0

10 months ago

2.0.0

10 months ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.8

1 year ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago