eslint-config-teppeis

ESLint config set for me!

MIT 162 个版本
安装
npm install eslint-config-teppeis
yarn add eslint-config-teppeis
pnpm add eslint-config-teppeis
bun add eslint-config-teppeis
README

eslint-config-teppeis

ESLint shareable configs for me!

npm version supported node.js version build status license

[!IMPORTANT] This config uses new flat config style since v19.

Priority

  1. Avoid "Possible Problems"
  2. Enable "Suggestions" if reasonable or fixable
  3. Use Prettier for stylistic formatting issues

Install

$ npm i -D eslint eslint-config-teppeis

and run npx eslint-config-teppeis --init to generate initial config files.

Usage

Load eslint-config-teppeis and export default build() in your eslint.config.js:

import { build } from "eslint-config-teppeis";
import { mocha } from "eslint-config-teppeis/configs/mocha";

export default await build(
  { base: "node18", typescript: true, esm: true },
  mocha,
  {
    ignores: ["dist", "test/fixtures"],
  },
);

Options

  • base (enum, required): es2021, es2022, es2023, node18 or node20
  • typescript (boolean, default false): use TypeScript
  • project (boolean|string|srting[], default false): the property of parserOptions to enable linting with type information
  • esm (boolean, default false): treat .js and .ts as ESM for a project that configures type:module in package.json

Configs for customization

Pure ECMAScript

Configs for ECMAScript versions

import { es2021 } from "eslint-config-teppeis/configs/es2021";

export default [es2021];
  • es2021
  • es2022
  • es2023

Node.js

Configs for Node versions

  • node18 (v18.18+ Maintenance)
  • node20 (v20.9+ Active LTS)
import { node18 } from "eslint-config-teppeis/configs/node18";

export default [node18];

TypeScript

Configs for TypeScript

  • typescript: Enable rules that don't require type information
  • typescriptTypeChecked: Require type information
import { node18, typescript } from "eslint-config-teppeis/configs";

export default [node18, typescript];

ES Modules

By default, only *.mjs and *.mts are treated as ES Modules in configs for Node.js. If you use type:module in package.json, use esm: true like:

import { build } from "eslint-config-teppeis";

export default build({ base: "node18", esm: true });

Browsers

This enables globals for browsers.

import { es2023, browser } from "eslint-config-teppeis/configs";

export default [es2023, browser];

Mocha

This enables globals for Mocha like describe or it only in **/test/*.js.

import { es2023, mocha } from "eslint-config-teppeis";

export default [es2023, mocha];

Note: Prettier

Just intall prettier and use it with eslint-config-teppeis. These configs don't include rule settings that conflict with Pretteir.

License

Licensed under the MIT license. Copyright (c) 2023, Teppei Sato

版本列表
19.1.2 2024-03-03
19.1.1 2024-02-14
19.1.0 2023-12-20
19.0.1-0 2023-11-05
19.0.1 2023-11-05
19.0.0-2 2023-10-29
19.0.0-1 2023-09-28
19.0.0-0 2023-09-28
19.0.0 2023-11-05
18.0.0-3 2023-08-13
18.0.0-2 2023-08-06
18.0.0-1 2023-07-29
18.0.0-0 2023-07-29
18.0.0 2023-09-14
17.0.4 2023-07-23
17.0.3 2023-07-06
17.0.2 2023-05-18
17.0.1 2023-04-29
17.0.0-0 2023-03-19
17.0.0 2023-03-19
16.0.1 2023-03-19
16.0.0-3 2022-07-03
16.0.0-2 2022-07-02
16.0.0-1 2022-06-08
16.0.0-0 2022-04-16
16.0.0 2022-07-06
15.0.1 2022-04-16
15.0.0-alpha.2 2021-11-30
15.0.0-alpha.1 2021-11-07
15.0.0-alpha.0 2021-11-07
15.0.0 2021-12-08
14.0.1 2021-10-16
14.0.0-0 2021-05-31
14.0.0 2021-06-13
13.1.6 2021-05-30
13.1.5 2021-03-02
13.1.4 2021-02-22
13.1.3 2021-02-17
13.1.2 2021-02-11
13.1.1 2021-02-11
13.1.0 2021-02-09
13.0.0-3 2021-02-06
13.0.0-2 2021-02-06
13.0.0-1 2021-02-06
13.0.0-0 2021-02-05
13.0.0 2021-02-06
12.0.0-6 2021-01-24
12.0.0-5 2021-01-24
12.0.0-4 2021-01-14
12.0.0-3 2020-09-03
12.0.0-2 2020-09-02
12.0.0-1 2020-06-07
12.0.0-0 2020-06-07
12.0.0 2021-01-27
11.0.2 2020-05-09
11.0.1 2020-02-13
11.0.0 2020-01-02
10.3.1 2019-12-27
10.3.0 2019-11-11
10.2.2 2019-10-28
10.2.1 2019-09-30
10.2.0 2019-09-23
10.1.3 2019-08-21
10.1.2 2019-07-11
10.1.1 2019-07-07
10.1.0 2019-07-01
10.0.0-alpha.7 2019-06-22
10.0.0-alpha.6 2019-06-12
10.0.0-alpha.5 2019-06-09
10.0.0-alpha.4 2019-06-02
10.0.0-alpha.3 2019-05-28
10.0.0-alpha.2 2019-05-18
10.0.0-alpha.1 2019-05-18
10.0.0-alpha.0 2019-05-18
10.0.0 2019-06-26
9.6.0 2019-05-02
9.5.1 2019-03-21
9.5.0 2019-02-18
9.4.0 2019-02-16
9.3.0-beta.1 2019-02-09
9.3.0-beta.0 2019-02-09
9.3.0 2019-02-10
9.2.0 2019-02-09
9.1.1 2019-02-09
9.1.0 2019-02-03
9.0.0-beta.1 2018-12-27
9.0.0-beta.0 2018-12-25
9.0.0 2018-12-27
8.3.1 2018-10-08
8.3.0 2018-09-29
8.2.0 2018-08-04
8.1.0 2018-07-22
8.0.0 2018-07-19
7.0.1 2018-07-10
7.0.0-beta.12 2018-06-23
7.0.0-beta.11 2018-06-10
7.0.0-beta.10 2018-05-29
7.0.0-beta.9 2018-05-12
7.0.0-beta.8 2018-05-12
7.0.0-beta.7 2018-05-10
7.0.0-beta.6 2018-05-08
7.0.0-beta.5 2018-05-07
7.0.0-beta.4 2018-05-04
7.0.0-beta.3 2018-05-04
7.0.0-beta.2 2018-05-04
7.0.0-beta.1 2018-05-03
7.0.0-beta.0 2018-04-29
7.0.0 2018-06-23
6.9.0 2018-04-21
6.8.0 2018-04-14
6.7.0 2018-04-01
6.6.2 2018-03-11
6.6.1 2018-02-25
6.6.0 2018-02-25
6.5.0 2018-02-25
6.4.0 2018-02-24
6.3.1 2017-11-03
6.3.0 2017-10-29
6.2.0 2017-08-19
6.1.0 2017-08-15
6.0.0 2017-08-15
5.3.0 2017-03-18
5.2.0 2017-03-17
5.1.0 2017-02-23
5.0.0 2017-02-18
4.0.0 2017-02-18
3.11.0 2017-02-18
3.10.0 2017-02-16
3.9.0 2017-01-10
3.8.0 2017-01-09
3.7.0 2017-01-08
3.6.0 2017-01-07
3.5.0 2016-11-16
3.4.0 2016-11-14
3.3.0 2016-08-08
3.2.0 2016-07-29
3.1.0 2016-07-24
3.0.2 2016-07-18
3.0.1 2016-07-18
3.0.0 2016-07-03
2.8.1 2016-07-18
2.8.0 2016-07-03
2.7.0 2016-06-14
2.6.0 2016-05-29
2.5.0 2016-05-29
2.4.0 2016-05-15
2.3.0 2016-05-01
2.2.0 2016-04-27
2.1.0 2016-04-27
2.0.4 2016-04-10
2.0.3 2016-04-10
2.0.2 2016-04-06
2.0.1 2016-04-06
2.0.0 2016-04-03
1.1.1 2016-04-01
1.1.0 2016-03-26
1.0.1 2016-03-26
1.0.0 2016-03-26
0.0.4 2016-03-26
0.0.3 2016-03-24
0.0.2 2016-03-24
0.0.1 2016-03-23