9.1.0 • Published 3 months ago

eslint-plugin-gb v9.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

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

RuleSetting
@typescript-eslint/consistent-type-importswarn
@typescript-eslint/explicit-member-accessibilitywarn
@typescript-eslint/explicit-module-boundary-typeswarn
@typescript-eslint/member-orderingwarn (with alphabetical ordering and strict rules.)
@typescript-eslint/no-unused-varsoff

recommended-type-checked config

all of the recommended rules and also the following.

RuleSetting
@typescript-eslint/no-floating-promiseswarn
@typescript-eslint/unbound-methoderror

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 versioneslint version
^9.0.0>=9.0.0
^2.0.0<9.0.0
9.0.0-alpha.6

4 months ago

9.0.0-alpha.5

4 months ago

9.0.0-alpha.4

4 months ago

9.1.0-0

3 months ago

9.0.0-alpha.3

4 months ago

9.0.0-alpha.2

4 months ago

9.1.0-2

3 months ago

9.1.0-1

3 months ago

9.1.0

3 months ago

9.0.0

4 months ago

9.0.0-alpha.1

4 months ago

2.0.0-alpha.3

1 year ago

2.0.0-alpha.4

1 year ago

2.0.0-alpha.6

1 year ago

2.0.0

1 year ago

2.0.0-alpha.0

1 year ago

2.0.0-alpha.1

1 year ago

2.0.0-alpha.2

1 year ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.0

3 years ago

0.0.0

3 years ago