eslint-config-tamia

Tâmia ESLint config

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

eslint-config-tamia

npm Node.js CI status

This package provides a shared ESLint config that I use on all my projects.

Should be used with Prettier, has no own code style rules.

All presets include the following ESLint plugins:

Usage

We export three ESLint configurations:

eslint-config-tamia

Base set of rules for JavaScript.

npm install --save-dev eslint eslint-config-tamia

eslint.config.mjs:

import tamia from 'eslint-config-tamia';
export default [...tamia];

eslint-config-tamia/typescript

Lints TypeScript. Includes:

npm install --save-dev eslint eslint-config-tamia

eslint.config.mjs:

import tamiaTypeScript from 'eslint-config-tamia/typescript';
export default [...tamiaTypeScript];

This config uses types for linting, so you need to have tsconfig.json that looks like this:

{
  "compilerOptions": {
    "esModuleInterop": true,
    "strict": true
  },
  "include": ["src/*", "*.ts"]
}

eslint-config-tamia/typescript-react

Lints TypeScript and React. Includes:

npm install --save-dev eslint eslint-config-tamia eslint-plugin-jsx-a11y

eslint.config.mjs:

import tamiaTypeScriptReact from 'eslint-config-tamia/typescript-react';
import jsxAccessibility from 'eslint-plugin-jsx-a11y';

export default [
  ...tamiaTypeScriptReact,
  jsxAccessibility.flatConfigs.strict
];

This config uses types for linting, so you need to have tsconfig.json that looks like this:

{
  "compilerOptions": {
    "jsx": "preserve",
    "esModuleInterop": true,
    "strict": true
  },
  "include": ["src/*", "*.ts"]
}

Code style at a glance

  • Tab indentation.
  • Single-quotes.
  • Semicolons.
  • Declare variables just before their first usage.
  • Multiple variable statements over multiple variable in a single statement.
  • Make const, not var.
  • Use === and !== over == and !=.
  • Return early.
  • Limit line lengths to 80 chars.
  • Prefer readability over religion.
  • Use ES6.

Example:

function eatFood(food) {
  if (food.length === 0) {
    return ['No food'];
  }

  return food.map(dish => `No ${dish.toLowerCase()}`);
}

const food = ['Pizza', 'Burger', 'Coffee'];
console.log(eatFood(food));

See ESlint config docs for more information.

版本列表
9.9.2 2026-05-09
9.9.1 2025-12-17
9.9.0 2025-11-18
9.8.0 2025-11-12
9.7.0 2025-10-29
9.6.6 2025-10-20
9.6.5 2025-10-20
9.6.4 2025-10-20
9.6.3 2025-10-20
9.6.2 2025-10-20
9.6.1 2025-10-20
9.6.0 2025-10-20
9.5.0 2025-10-14
9.4.4 2025-10-14
9.4.3 2025-10-10
9.4.2 2025-10-10
9.4.1 2025-10-10
9.4.0 2025-10-10
9.3.1 2025-09-29
9.3.0 2025-09-26
9.2.3 2025-01-09
9.2.2 2025-01-02
9.2.1 2024-12-09
9.2.0 2024-12-08
9.1.23 2024-09-25
9.1.22 2024-09-25
9.1.21 2024-09-17
9.1.20 2024-09-17
9.1.19 2024-09-17
9.1.18 2024-09-11
9.1.17 2024-09-11
9.1.16 2024-09-09
9.1.15 2024-09-09
9.1.14 2024-09-09
9.1.13 2024-09-06
9.1.12 2024-09-06
9.1.11 2024-09-06
9.1.10 2024-08-04
9.1.9 2024-08-02
9.1.8 2024-07-26
9.1.7 2024-07-26
9.1.6 2024-07-25
9.1.5 2024-07-25
9.1.4 2024-07-25
9.1.3 2024-07-25
9.1.2 2024-07-25
9.1.1 2024-07-25
9.1.0 2024-07-25
9.0.3 2024-07-25
9.0.2 2024-07-25
9.0.1 2024-07-25
9.0.0 2024-07-25
8.1.3 2024-02-08
8.1.2 2023-10-20
8.1.1 2023-10-07
8.1.0 2023-07-16
8.0.4 2023-06-24
8.0.3 2023-05-26
8.0.2 2023-05-23
8.0.1 2022-09-05
8.0.0 2022-04-28
7.2.7 2021-08-03
7.2.6 2020-10-19
7.2.5 2020-06-18
7.2.4 2020-06-05
7.2.3 2020-06-05
7.2.2 2020-06-05
7.2.1 2020-06-05
7.2.0 2020-06-04
7.1.2 2020-03-29
7.1.1 2019-10-22
7.1.0 2019-10-21
7.0.1 2019-08-20
7.0.0 2019-08-19
6.2.1 2019-06-20
6.2.0 2019-06-18
6.1.1 2019-06-18
6.1.0 2019-06-17
6.0.2 2018-08-20
6.0.1 2018-07-23
6.0.0 2018-07-05
5.0.1 2018-03-21
5.0.0 2017-12-19
4.2.3 2017-09-12
4.2.2 2017-09-07
4.2.1 2017-09-05
4.2.0 2017-08-28
4.1.2 2017-07-23
4.1.1 2017-06-16
4.1.0 2017-06-13
4.0.2 2017-05-12
4.0.1 2017-05-11
4.0.0 2017-05-11
3.3.4 2017-03-10
3.3.3 2017-03-10
3.3.2 2017-01-20
3.3.1 2016-12-10
3.3.0 2016-11-16
3.2.2 2016-11-15
3.2.1 2016-11-08
3.2.0 2016-10-25
3.1.1 2016-09-21
3.1.0 2016-09-21
3.0.0 2016-07-06
2.0.1 2016-05-11
2.0.0 2016-05-11
1.2.0 2016-03-15
1.1.0 2016-03-07
1.0.0 2016-01-13