0.10.3 • Published 7 months ago

@cdoublev/eslint-config v0.10.3

Weekly downloads
5
License
MIT
Repository
github
Last release
7 months ago

ESLint configuration

How to use a configuration:

Append its identifier to the extends property of the ESLint configuration file:

  • @cdoublev/eslint-config (extended by all configurations below): to lint (ES6+) files executed anywhere
  • @cdoublev/eslint-config/node: to lint files executed in NodeJS
  • @cdoublev/eslint-config/browser: to lint files executed in a browser
  • @cdoublev/eslint-config/jest: to lint files executed in Jest
  • @cdoublev/eslint-config/react: to lint files executed in React

For example, in a React application rendered server side and tested with Jest:

// .eslintrc.js
module.exports = {
  extends: ['@cdoublev/eslint-config'],
  overrides: [
    {
      files: ['__mocks__/**/*.js', '__tests__/**/*.js'],
      extends: ['@cdoublev/eslint-config/node', '@cdoublev/eslint-config/jest'],
    },
    {
      files: ['server/**/*.js'],
      extends: ['@cdoublev/eslint-config/node'],
    },
    {
      files: ['src/**/*.js'],
      extends: ['@cdoublev/eslint-config/react'],
    },
  ],
}

Optional dependencies:

The following dependencies may be required depending on the configuration.

How rules are selected?

The following conventions apply for selecting rules:

  • they must not already be included in eslint:recommended or plugin:[plugin-name]/recommended
  • they must be as few as possible to detect errors
  • they must be otherwise related to spacing, line breaks, code clarity, and (performance) optimization
  • they must not prevent code clarity
  • they must be widely accepted by the JS community

Configuring a linter to detect as many errors as possible is often counterproductive: the runtime and tests are already responsible for this.

This document provides some comments about each rule. If a rule exists in this document and is not activated, it will never be.

0.10.2

7 months ago

0.10.3

7 months ago

0.10.0

1 year ago

0.10.1

1 year ago

0.9.1

1 year ago

0.9.0

2 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

5 years ago

0.1.0

5 years ago