Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@bjerk/eslint-config

bjerkio1.3kApache-2.06.0.2

A reusable Eslint config built by and maintained by Bjerk.

readme

@bjerk/eslint-config

A reusable Eslint config built by and maintained by Bjerk.

yarn add @bjerk/eslint-config eslint

Usage

To use this config, you'll need to add an .eslintrc.js file to your project. This file should export an object with the following structure:

module.exports = {
  extends: '@bjerk/eslint-config',
};

To make the configuration work with Typescript, you'll need to add the parserOptions as follows:

module.exports = {
  extends: '@bjerk/eslint-config',
  parserOptions: {
    project: true,
    tsconfigRootDir: __dirname,
  },
};

You can also use parts of this configuration if you want to. For example, if you only want to use our base config, you can do this:

{
  "extends": "@bjerk/eslint-config/base"
}

These are the available configs:

  • @bjerk/eslint-config
  • @bjerk/eslint-config/base
  • @bjerk/eslint-config/import
  • @bjerk/eslint-config/typescript
  • @bjerk/eslint-config/esm

Note: The main @bjerk/eslint-config config includes all the others, but also prettier (and eslint-config-prettier).

Tip: We often use this along with @simenandre/prettier, a shared Prettier config. Typically, we recommend letting prettier handle all formatting, and eslint handle all linting.

Motivation

We want to have a consistent code style, and we want to promote readable and maintainable code. We also want to avoid bugs and errors, and we want to have a good developer experience.

This is our take on making that happen with Eslint!

Contributing

In comparison to many other eslint configurations, we welcome contributions to this config. If you have any ideas on how to improve it, please open an issue or a pull request!

This isn't supposed to be a Bjerk only config, but rather a config that everyone can use. We want to make it as good as possible, and we want to make it as useful as possible. If you agree with our motivation, we'd love to have you on board!

Thanks

This config is inspired by:

Thanks are in order! 🙏

changelog

Changelog

6.0.1 (2023-08-13)

Bug Fixes

  • add missing file to package (d4030ac)

6.0.0 (2023-08-09)

⚠ BREAKING CHANGES

  • improve esm rules (#270)

Features

Bug Fixes

  • deps: update dependency eslint-config-prettier to v9 (#267) (790581d)

5.4.0 (2023-07-24)

Features

Bug Fixes

  • do not depend on prettier and typescript (#261) (824cbbd)

5.3.0 (2023-07-19)

Features

  • bump eslint to ^8.45.0 (2e2d467)
  • use modern module resolution (adc1c91)

5.2.0 (2023-07-18)

Features

Bug Fixes

  • deps: update dependency eslint-plugin-unicorn to v48 (#253) (73fe733)

5.0.0 (2023-07-13)

v5 is yet a step towards making our code more readable and maintainable!

With v5 we are introducing typed checked lining and stylistics config, as typescript-eslint recommends. To further make it easier for contributors and consumers of this eslint config, the separate topics are split into:

You can import only the ones you want if that is your style.

To make v5 work, you have to add parserOptions:

{
  "extends": "@bjerk/eslint-config",
  "parserOptions": {
    "project": true
  }
}

⚠ BREAKING CHANGES

  • use typed checked linting and stylistic config (#247)
  • split into separate configs (#246)

Features

  • remove unused dependencies (daec2b3)
  • use typed checked linting and stylistic config (#247) (b461fd6)

Code Refactoring

4.2.0 (2023-07-06)

Features

  • deps: update dependency prettier to v3 (#238) (8959828)

4.0.0 (2023-04-15)

⚠ BREAKING CHANGES

  • Error when using explicit any (#214)

Code Refactoring

3.1.0 (2023-03-05)

Features

3.0.1 (2022-11-18)

Bug Fixes

3.0.0 (2022-11-18)

⚠ BREAKING CHANGES

  • Remove jest eslint rules (#117)

Features

2.2.2 (2022-09-10)

Bug Fixes

  • add peerDevDependencies (537f9fe)

2.2.1 (2022-09-10)

Bug Fixes

2.2.0 (2022-09-10)

Features

  • add deps and installation guide (4563398)

2.1.0 (2022-07-14)

Features

2.0.1 (2022-03-12)

Bug Fixes

2.0.0 (2022-03-12)

⚠ BREAKING CHANGES

  • Drop support for node@v14

Features

  • Drop support for node@v14 (4e75d6e)

1.0.0 (2021-08-29)

Features