Shareable ESLint config for the Ely.by's projects
Go to file
2019-12-16 14:53:04 +03:00
docs/rules Init commit 2019-05-24 18:38:25 +03:00
src Upgrade configuration to be compatible with eslint 6 and latest changes in the eslint-typescript 2019-12-16 13:59:31 +03:00
tests/lib/rules Init commit 2019-05-24 18:38:25 +03:00
.eslintrc.js Fix lint 2019-12-16 14:13:21 +03:00
.gitignore Init commit 2019-05-24 18:38:25 +03:00
.npmignore Add travis config and prepare package to be published on npm 2019-05-24 18:51:41 +03:00
.travis.yml Use own package to lint code 2019-05-24 19:04:47 +03:00
babel.config.js Init commit 2019-05-24 18:38:25 +03:00
jest.config.js Init commit 2019-05-24 18:38:25 +03:00
LICENSE.md Init commit 2019-05-24 18:38:25 +03:00
package.json Bump version 2019-12-16 14:53:04 +03:00
README.md Fix base config name in the README 2019-06-03 14:16:46 +03:00
tsconfig.json Init commit 2019-05-24 18:38:25 +03:00
yarn.lock Bump eslint-utils from 1.3.1 to 1.4.3 2019-12-16 11:14:02 +00:00

Ely.by ESLint rules

Set of ESLint rules used in development of Ely.by JS projects. Contains rules for pure JS, JSX, ReactJS and TS.

Installation

First of all install Ely.by ESLint plugin and eslint peer dependency via NPM:

npm install @elyby/eslint-plugin eslint --save-dev

Or via yarn:

yarn add -D @elyby/eslint-plugin eslint

Configuration

The configuration is divided into several parts. The base provides only pure js checks. To use it, simply add the plugin:@elyby/base configuration to the extends block:

{
    "extends": [
        "plugin:@elyby/base"
    ]
}

React

The configuration for React requires additional dependencies. Install them first:

# NPM:
npm install eslint-plugin-react eslint-plugin-react-hooks --save-dev
# Yarn:
yarn add -D eslint-plugin-react eslint-plugin-react-hooks

Then add the plugin:@elyby/react configuration to the extends block:

{
    "extends": [
        "plugin:@elyby/base",
        "plugin:@elyby/react"
    ]
}

TypeScript

Configuration for TypeScript also requires additional libraries:

# NPM:
npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin --save-dev
# Yarn:
yarn add -D @typescript-eslint/parser @typescript-eslint/eslint-plugin

Then add the plugin:@elyby/react configuration to the extends block:

{
    "extends": [
        "plugin:@elyby/base",
        "plugin:@elyby/typescript"
    ]
}

You may still wish to override some of our rules, as well as the rest of our eslint configuration settings. For example, you can specify the preferred env for eslint:

{
    "env": {
        "browser": true,
        "es6": true
    }
}

Using our custom fixers

First of all, you must install Ely.by's ESLint plugin as described in the installation chapter. After that you can enable our custom rules with defining our plugin in plugins section:

{
    "plugins": [
        "@elyby"
    ]
}

After that all custom rules will be available for use.

List of supported rules

License

Ely.by ESLint plugin is licensed under the MIT License.