eslint-plugin-harmony
TypeScript icon, indicating that this package has built-in type declarations

7.2.0 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.10next
7.2.02,017latest

Version History

VersionDownloads (Last 7 Days)Published
7.2.02,017
7.1.286
7.1.15
7.1.038
7.0.20
7.0.10
7.0.00
6.1.00
6.0.40
6.0.30
6.0.2532
6.0.10
6.0.00
5.1.01
5.0.25
5.0.10
4.0.00
3.0.1886
3.0.00
2.1.94
2.1.80
2.1.70
2.1.60
2.1.50
2.1.30
2.1.20
2.1.10
2.1.00
2.0.40
2.0.33
2.0.20
2.0.10
2.0.00
1.1.30
1.1.20
1.1.10
1.1.00
1.0.491
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i eslint-plugin-harmony

Weekly Downloads

3,668

Version

7.2.0

License

MIT

Unpacked Size

38.4 kB

Total Files

42

Last publish

Collaborators

  • unional