7.0.0 • Published 6 years ago

eslint-config-schibsted v7.0.0

Weekly downloads
225
License
MIT
Repository
github
Last release
6 years ago

eslint-config-schibsted Build Status

A module to contain the Schibsted JavaScript linting rules for ESLint.

How to use

yarn add eslint-config-schibsted eslint@^4.19.1eslint-plugin-import@^2.12.0 eslint-plugin-prettier@^2.6.0 eslint-plugin-unicorn@^4.0.3 prettier@^1.13.3 -D

Then add the extends option to your .eslintrc.*:

{
    "extends": "schibsted",
    "root": true
}

You can override specific settings by specifying them as normal. See http://eslint.org/docs/developer-guide/shareable-configs for more details.

Additional configurations

There are several configurations available:

  1. eslint-config-schibsted, which is the base and standalone
  2. eslint-config-schibsted-chai for inclusion with chai files
  3. eslint-config-schibsted-flow for inclusion with flow typed files
  4. eslint-config-schibsted-modules for inclusion with ES6 module files
  5. eslint-config-schibsted-node for inclusion with Node files.
  6. eslint-config-schibsted-react for inclusion with React files, and requires eslint-plugin-react

The additional packages should be included as extends in directories containing the relevant source type files.

Intent

The intent of these packages is to provide a common set of rules for coding within the Schibsted codebases. It is made up from a number of different packages with predefined settings. This will make transitioning between projects a smoother experience.

Why not just AirBnB?

While AirBnB is a popular configuration, there are a lot of valuable rules that are not included in it. Instead of having every project need to source these additional rules, the eslint-config-schibsted-* packages provide these for you.

AirBnB is one of the included configurations in these packages.

Prettier

Linting usually happens in two places.

  1. In the editor.
  2. In build tools.

By default this config uses Prettier in relaxed mode. This means that errors will not show for rules that are covered by running prettier --write. This allows people to code in their own style.

However, it means that build tools, by default, also don't include the errors. You may want errors to show in your build tools so you will need to specify the prettier-strict config as appropriate. e.g. using the cli add --config ./packages/eslint-config-schibsted/prettier-strict.js.

If you would like code editors to show the errors as well, simply add prettier-strict to the extends config.

{
    "extends": [
      "schibsted",
      "schibsted/prettier-strict"
    ],
    "root": true  
}
7.0.0

6 years ago

7.0.0-3.0

6 years ago

7.0.0-2.0

6 years ago

7.0.0-1

6 years ago

7.0.0-0

6 years ago

6.0.0

6 years ago

5.0.0

6 years ago

4.0.0

7 years ago

3.1.0

7 years ago

0.0.1

8 years ago