7.2.0 • Published 11 months ago

eslint-plugin-harmony v7.2.0

Weekly downloads
30
License
MIT
Repository
github
Last release
11 months ago

eslint-plugin-harmony

NPM version NPM downloads

semantic-release

Visual Studio Code phpStorm Atom

A eslint config styles package that work across IDEs.

Design Principles

There are several configurations available in this package. Although they are different as they are designed for different programmers, here are the principles that they all follow:

  • They are designed to be used by team
  • Each team member can use one of the supported IDE
  • The formatter available on each IDE should work with each configuration
  • Code should look well and consistent on each IDE with folding
    • so that when you stop by your team member's cube, the code looks the same.
  • Thrive for easy to write (with the fewest keystrokes) while keeping the code clean

Supported IDE

Installation

You'll first need to install ESLint:

npm install --save-dev eslint

Next, install eslint-plugin-harmony:

npm install --save-dev eslint-plugin-harmony

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-harmony globally.

Usage

To use the ESLint style, extends from one of the following:

{
  "extends": "plugin:harmony/recommended",
  "extends": "plugin:harmony/latest",
  "extends": "plugin:harmony/es5",
  "extends": "plugin:harmony/es5-strict",
  "extends": "plugin:harmony/ts-prettier", // experimental
  "extends": "plugin:harmony/ts-recommended", // or use overrides
  "extends": "plugin:harmony/ts-recommended-type-check", // or use overrides
  "extends": "plugin:harmony/ts-recommended-cra",
  "extends": "plugin:harmony/ts-recommended-type-check-cra",
}

TypeScript

The TypeScript style is extended from @typescript-eslint/eslint-plugin.

They are adjusted to the style in harmony. Also, the configuration are simplified.

Since you will likely to have some JavaScript files in your TypeScript project (e.g. jest.config.js, webpack.config.js, etc.), it is recommended to use the overrides.extends feature in eslint to support mixed environment:

{
  "extends": [
    "plugin:harmony/recommended"
  ],
  "overrides": [
    {
      "files": [
        "*.ts",
        "*.tsx"
      ],
      "extends": [
        "plugin:harmony/ts-recommended"
      ]
    }
  ]
}

Note that for ts-recommended-type-check you still need to specify parserOptions.project.

{
  "extends": [
    "plugin:harmony/recommended"
  ],
  "overrides": [
    {
      "files": [
        "*.ts",
        "*.tsx"
      ],
      "extends": [
        "plugin:harmony/ts-recommended-type-check"
      ],
      "parserOptions": {
        "project": "tsconfig.json"
      }
    }
  ]
}

For more information, please check out @typescript-eslint/eslint-plugin.

JetBrains IDE

After you import the settings, you need to use them in the setting:

setting

You also need to change your language version appropriately:

language version

Contribute

pnpm i
pnpm bootstrap
7.2.0

11 months ago

7.1.2

2 years ago

7.1.1

2 years ago

7.0.2

3 years ago

7.1.0

3 years ago

7.0.0

3 years ago

7.0.1

3 years ago

6.1.0

3 years ago

6.0.1

3 years ago

6.0.3

3 years ago

6.0.2

3 years ago

6.0.4

3 years ago

6.0.0

3 years ago

5.1.0

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

4.0.0

4 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.9

5 years ago

2.1.8

5 years ago

2.1.7

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago