0.11.0 • Published 5 months ago
@cdoublev/eslint-config v0.11.0
ESLint configuration
Minimal ESLint rule presets:
@cdoublev/eslint-config
: 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
Usage
Simply add the required configurations to the main export of eslint.config.js
. For example, in a server side rendered React application, tested with Jest:
// eslint.config.js
const common = require('@cdoublev/eslint-config')
const browser = require('@cdoublev/eslint-config/browser')
const jest = require('@cdoublev/eslint-config/jest')
const node = require('@cdoublev/eslint-config/node')
const react = require('@cdoublev/eslint-config/react')
module.exports = [
common,
jest, // Looks for __tests__/**/*.js, tests/**/*.js, **/*.test.js
react,
{ ...node, files: ['server/**/*.js'] },
{ ...browser, files: ['src/**/*.js'] },
]
The following dependencies may need to be installed depending on the configuration:
eslint-plugin-compat
for@cdoublev/eslint-config/browser
eslint-plugin-n
for@cdoublev/eslint-config/node
eslint-plugin-react
andeslint-plugin-react-hooks
for@cdoublev/eslint-config/react
eslint-plugin-jest
for@cdoublev/eslint-config/jest
globals
for@cdoublev/eslint-config/node
and@cdoublev/eslint-config/react
How rules are selected?
- they must be as few as possible to detect errors (tests already exist for this)
- they must be otherwise related to spacing, line breaks, code complexity
- they must not increase code complexity
- they must be widely accepted by the JS community
This document provides some comments about each rule. If a rule exists in this document and is not activated, it will never be.
0.11.0
5 months ago
0.10.2
1 year ago
0.10.3
1 year ago
0.10.0
2 years ago
0.10.1
2 years ago
0.9.1
2 years ago
0.9.0
3 years ago
0.8.2
4 years ago
0.8.1
4 years ago
0.8.0
4 years ago
0.7.0
4 years ago
0.6.1
5 years ago
0.6.0
5 years ago
0.5.0
5 years ago
0.4.1
5 years ago
0.4.0
5 years ago
0.3.0
5 years ago
0.2.0
5 years ago
0.1.0
5 years ago