@cloudfour/eslint-plugin

23.0.0 • Public • Published

@cloudfour/eslint-plugin

NPM version Build Status Renovate

Cloud Four's ESLint configuration. This exports itself as a "super-plugin" because of a limitation of ESLint.

The way this works is that it requires all of the plugin dependencies, and exports them from this plugin under a prefix.

The plugins that this exposes are:

To override settings for any of these plugins, you must prefix the configuration with cloudfour/, because the plugins are exposed through this "super-plugin".

{
  "extends": ["plugin:@cloudfour/recommended"],
  "rules": {
    "@cloudfour/promise/no-native": "off"
  }
}

In addition to the recommended configuration, @cloudfour/eslint-plugin also re-exports typescript-eslint's disable-type-checked configuration. This configuration disables any rules that depend on typescript-eslint's typescript integration.

Installation

npm install --save-dev @cloudfour/eslint-plugin eslint prettier

Usage

Add this to your package.json:

  "scripts": {
    "check-lint": "eslint . && prettier --check .",
    "lint": "eslint --fix . && prettier --write ."
  },
  "eslintConfig": {
    "extends": "plugin:@cloudfour/recommended"
  },
  "prettier": {
    "singleQuote": true
  }

Check for Lint Errors

npm run check-lint

Fix Lint Errors

This command will attempt to automatically fix lint errors. Note that not all lint errors can be fixed this way, so be prepeared to fix any remaining errors by hand.

npm run lint

Troubleshooting Note

This config relies on using a version of eslint installed locally to your project. If you also have eslint installed globally, it's possible to run into conflicts. To avoid any problems, either:

  • Just use the npm run check-lint and npm run lint scripts, which will run the local version of eslint.
  • Or, if you prefer to run eslint by hand, use npx, which will run the local version of eslint. eg, npx eslint '**/*.js'

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
23.0.0275latest
2.0.0-alpha.04next

Version History

VersionDownloads (Last 7 Days)Published
2.0.0-alpha.04
23.0.0275
22.0.00
21.1.00
21.0.00
20.0.20
20.0.10
20.0.00
19.0.00
18.0.10
18.0.00
17.1.00
17.0.10
17.0.00
16.0.00
15.0.10
15.0.00
14.0.00
13.0.01
12.0.00
11.0.00
10.0.00
9.0.00
8.0.00
7.0.00
6.0.01
5.0.00
4.0.00
3.0.00
2.0.10
2.0.00

Package Sidebar

Install

npm i @cloudfour/eslint-plugin

Weekly Downloads

281

Version

23.0.0

License

MIT

Unpacked Size

36.3 kB

Total Files

7

Last publish

Collaborators

  • cloudfour-user
  • gerardo-rodriguez
  • calebeby
  • spaceninja
  • cloudfour-paul
  • tylersticka