npm

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

9.1.0 • Public • Published

eslint-plugin-gb

Description

My favorite eslint configurations for ESLint >=9. A version for earlier ESLint releases in available on eslint-plugin-gb@2.

Installation

npm add --save-dev typescript
npm add --save-dev eslint
npm add --save-dev @typescript-eslint/parser
npm add --save-dev @typescript-eslint/eslint-plugin
npm add --save-dev eslint-plugin-gb

Usage

see Configuration Files - ESLint - Pluggable JavaScript Linter for detailed information. For the basics add the eslint.config.js to the root of your project.

// eslint.config.cjs
const js = require('@eslint/js');
const gb = require('eslint-plugin-gb');

module.exports = [
  ...js.configs.recommended,
  ...gb.configs['flat/recommended'],
  {
    files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
    // Override or add rules here
    rules: {},
  },
];
// eslint.config.mjs
import js from "@eslint/js";
import ts from "typescript-eslint";
import gb from "eslint-plugin-gb";
import globals from "globals";

/** @type {import('eslint').Linter.Config[]} */
export default [
  js.configs.recommended,
  ...ts.configs.recommended,
  ...gb.configs["flat/recommended"],
];

recommended config

Rule Setting
@typescript-eslint/consistent-type-imports warn
@typescript-eslint/explicit-member-accessibility warn
@typescript-eslint/explicit-module-boundary-types warn
@typescript-eslint/member-ordering warn (with alphabetical ordering and strict rules.)
@typescript-eslint/no-unused-vars off

recommended-type-checked config

all of the recommended rules and also the following.

Rule Setting
@typescript-eslint/no-floating-promises warn
@typescript-eslint/unbound-method error

development

This is a bare-bones library. There are no npm scripts or monorepo plugins. npx prettier . -w works ok.

eslint-plugin-gb & eslint Compatibility Chart

eslint-plugin-gb version eslint version
^9.0.0 >=9.0.0
^2.0.0 <9.0.0

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
9.1.033latest
9.1.0-20next

Version History

VersionDownloads (Last 7 Days)Published
9.1.033
9.1.0-20
9.1.0-11
9.1.0-00
9.0.00
9.0.0-alpha.60
9.0.0-alpha.51
9.0.0-alpha.40
9.0.0-alpha.30
9.0.0-alpha.20
9.0.0-alpha.10
2.0.06
2.0.0-alpha.60
2.0.0-alpha.40
2.0.0-alpha.30
2.0.0-alpha.20
2.0.0-alpha.10
2.0.0-alpha.01
1.5.10
1.5.00
1.4.00
1.3.00
1.2.00
1.1.00
1.0.10
1.0.00
0.2.00
0.0.00

Package Sidebar

Install

npm i eslint-plugin-gb

Weekly Downloads

42

Version

9.1.0

License

ISC

Unpacked Size

8.42 kB

Total Files

9

Last publish

Collaborators

  • garyb432