@onefinity/eslint-config
v2.0.1
Published
Generic base configuration for [ESLint][eslint] supporting setups using [ESNext][esnext], [Node.js][nodejs], [React][react], and [TypeScript][typescript]. Combine it with [`@onefinity/stylelint-config`][onefinity-stylelint-config] to lint CSS as well.
Downloads
166
Readme
Onefinity ESLint Config
Generic base configuration for ESLint supporting setups using
ESNext, Node.js, React, and
TypeScript. Combine it with
@onefinity/stylelint-config
to lint CSS as well.
Available configurations
The following configurations are available and can be extended in a project-specific ESLint configuration. Note that it's possible to mix and match configurations.
@onefinity/eslint-config/esnext
Base configuration for vanilla EcmaScript projects targeting browser environments.@onefinity/eslint-config/node
Base configuration for projects targeting Node.js.@onefinity/eslint-config/react
Additional configuration and rules for projects using React and JSX.@onefinity/eslint-config/typescript
Additional configuration and rules for projects written in TypeScript.
Usage
Installation
Install the package using the following command.
$ npm install --save-dev @onefinity/eslint-config
Extending
Use the extends
feature provided by ESLint in the
project-specific .eslintrc
configuration file.
{
"extends": [
"@onefinity/eslint-config/esnext"
]
}
Scripts
The following scripts can be added to package.json
to make it easier to start
the linter.
{
"scripts": {
"lint:js": "eslint \"source/**/*.js\" \"*.js\"",
"lint:fix": "npm run lint:js -- --fix"
}
}