包详细信息

@comandeer/eslint-config

Comandeer24.3kMIT0.17.0

Shareable ESLint configuration

eslint, eslintconfig

自述文件

@comandeer/eslint-config

Build Status npm (scoped)

Super opinionated ESLint configuration.

Installation

npm install @comandeer/eslint-config --save-dev

Usage

Put it inside your eslint.config.js file:

import { eslintConfig } from '@comandeer/eslint-config';

export default eslintConfig();

Optionally, you could also include formatting rules:

import { eslintConfig } from '@comandeer/eslint-config';
import { formattingConfig } from '@comandeer/eslint-config/formatting';

export default [
    ...eslintConfig(),
    ...formattingConfig()
];

Options

Both exports accepts the same set of options as an options object:

eslintConfig( {
    tsProject: [ './packages/*/tsconfig.json' ]
} );

Available options

Name Value type Default value Description
tsProject Array<string> [ './tsconfig.json' ] Paths to all TS config files in the project that should be used for linting.
allowDefaultExports Array<string> [] Glob patterns for files that are allowed to contain default exports. Default exports are always allowed in config files (`/.config.{js,mjs,ts,mts}`)*

License

See LICENSE file for details.

更新日志

@comandeer/eslint-config Changelog

All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.


0.17.0 – 2025-03-08

Added

  • #103: the allowDefaultExports option to specify files that are allowed to contain default exports.
  • #105: support for TypeScript 5.8.

Changed

  • #103: BREAKING CHANGE: config files (*.config.{js,mjs,ts,mts}) are always allowed to contain default exports.
  • #105: BREAKING CHANGE: updated dependencies:

    | Dependency | Old version | New version | | ---------------------------------------- | ----------- | ----------- | | @babel/core | ^7.25.8 | ^7.26.9 | | @babel/eslint-parser | ^7.25.8 | ^7.26.8 | | @babel/eslint-plugin | ^7.25.7 | ^7.25.9 | | @babel/plugin-syntax-import-attributes | ^7.25.7 | ^7.26.0 | | @babel/preset-env | ^7.25.8 | ^7.26.9 | | ⚠️ @stylistic/eslint-plugin | ^2.9.0 | ^4.2.0 | | @typescript-eslint/eslint-plugin | ^8.8.1 | ^8.26.0 | | @typescript-eslint/eslint-parser | ^8.8.1 | ^8.26.0 | | ⚠️ globals | ^15.11.0 | ^16.0.0 |

    Dependencies with major version change are marked with the "⚠️" emoji.

  • #108: the supported ES version is now set to 'latest'.

Removed

  • #104: BREAKING CHANGE: the @babel/no-invalid-this rule has been removed.

0.16.0 – 2024-10-13

Changed

  • BREAKING CHANGE: the package removed default exports in favor of named ones:
    • @comandeer/eslint-config now exports eslintConfig named export,
    • @comandeer/eslint-config/formatting now exports formattingConfig named export.
  • #99: BREAKING CHANGE: importing types now requires the import type syntax.
  • #100: BREAKING CHANGE default exports are no longer allowed.
  • #101: updated dependencies:

    | Dependency | Old version | New version | | ---------------------------------------- | ----------- | ----------- | | @babel/core | ^7.25.2 | ^7.25.8 | | @babel/eslint-parser | ^7.25.1 | ^7.25.8 | | @babel/eslint-plugin | ^7.25.1 | ^7.25.7 | | @babel/plugin-syntax-import-attributes | ^7.24.7 | ^7.25.7 | | @babel/preset-env | ^7.25.3 | ^7.25.8 | | @stylistic/eslint-plugin | ^2.6.2 | ^2.9.0 | | @typescript-eslint/eslint-plugin | ^8.0.1 | ^8.8.1 | | @typescript-eslint/eslint-parser | ^8.0.1 | ^8.8.1 | | globals | ^15.9.0 | ^15.11.0 |

0.15.0 – 2024-08-14

Changed

  • #97: BREAKING CHANGE: the @babel/semi rule was replaced with the @stylistic/semi one.

Fixed

0.14.0 – 2024-08-09

Added

  • #90: support for ESLint 9.
  • #92: support for Node 22.

Changed

  • #90: BREAKING CHANGE: updated dependencies:

    | Dependency | Old version | New version | | ---------------------------------------- | ----------- | ----------- | | @babel/core | ^7.24.0 | ^7.25.2 | | @babel/eslint-parser | ^7.23.10 | ^7.25.1 | | @babel/eslint-plugin | ^7.23.5 | 7.25.1 | | @babel/plugin-syntax-import-attributes | ^7.23.3 | ^7.24.7 | | @babel/preset-env | ^7.24.0 | ^7.25.3 | | ⚠️ @stylistic/eslint-plugin | ^1.6.3 | ^2.6.2 | | ⚠️ @typescript-eslint/eslint-plugin | ^7.1.0 | ^8.0.1 | | ⚠️ @typescript-eslint/parser | ^7.1.0 | ^8.0.1 | | ⚠️ globals | ^14.0.0 | ^15.9.0 |

    Dependencies with major version change are marked with the "⚠️" emoji.

Removed

  • #90: BREAKING CHANGE: support for ESLint 8.
  • #92: BREAKING CHANGE: support for Node 18.

0.13.1 – 2024-03-10

Fixed

  • #88: incorrect glob patterns in monorepos.

0.13.0 – 2024-03-02

Added

  • #85: BREAKING CHANGE: configuration options.

0.12.0 – 2024-03-01

Added

  • #81: basic support for monorepo.

Removed

  • #83: BREAKING CHANGE: support for Node 16.

Changed

  • #80: BREAKING CHANGE: move formatting rules to @stylistic.
  • #82: BREAKING CHANGE: updated dependencies:

    | Dependency | Old version | New version | | ---------------------------------------- | ----------- | ----------- | | @babel/core | ^7.22.9 | ^7.24.0 | | @babel/eslint-parser | ^7.22.9 | ^7.23.10 | | @babel/eslint-plugin | ^7.22.5 | 7.23.5 | | @babel/plugin-syntax-import-attributes | ^7.22.5 | ^7.23.3 | | @babel/preset-env | ^7.22.9 | ^7.24.0 | | ⭐ @stylistic/eslint-plugin | N/A | ^1.6.3 | | ⚠️ @typescript-eslint/eslint-plugin | ^6.1.0 | ^7.1.0 | | ⚠️ @typescript-eslint/parser | ^6.1.0 | ^7.1.0 | | ⚠️ globals | ^13.20.0 | ^14.0.0 |

    New dependencies are marked with the "⭐" emoji.

    Dependencies with major version change are marked with the "⚠️" emoji.

Fixed

  • #79: the no-undef rule in TS code is incorrectly switched on.

0.11.1 – 2023-07-22

Fixed

  • #76: incorrect publishing workflow resulting in an incorrect package being published.

0.11.0 – 2023-07-22

Added

  • #67: new rules for linting TS files.
  • #74: support for import attributes/assertions syntax.

Changed

  • #59: BREAKING CHANGE: move to the new config system.
  • #73: BREAKING CHANGE: move the codebase to ESM.
  • #70: BREAKING CHANGE: use TS parser only for TS files.
  • [#72]: BREAKING CHANGE: separate formatting rules as a ./formatting subpath export.
  • #74: BREAKING CHANGE: use @babel/eslint-parser for JS files.
  • #71: BREAKING CHANGE: updated dependencies:

    | Dependency | Old version | New version | | ------------------------------------------ | ----------- | ----------- | | ⭐ @babel/core | N/A | ^7.22.9 | | ⭐ @babel/eslint-parser | N/A | ^7.22.9 | | ⭐ @babel/eslint-plugin | N/A | ^7.22.5 | | ⭐ @babel/plugin-syntax-import-attributes | N/A | ^7.22.5 | | ⭐ @babel/preset-env | N/A | ^7.22.9 | | ⚠️ @typescript-eslint/eslint-plugin | ^5.38.0 | ^6.1.0 | | ⚠️ @typescript-eslint/parser | ^5.38.0 | ^6.1.0 | | ⭐ globals | N/A | ^13.20.0 |

    New dependencies are marked with the "⭐" emoji.

    Dependencies with major version change are marked with the "⚠️" emoji.

Fixed

  • #69: incorrect tsconfig.json file used to lint the project.

0.10.0 – 2023-02-06

Changed

  • #64: BREAKING CHANGE: replaced Mocha-oriented rules with ava-oriented ones in test files.

0.9.0 – 2022-09-23

Added

  • #57: basic support for linting TypeScript code.
  • #60: support for Node 18.

Changed

  • #58: update dependencies.

Removed

  • #60 BREAKING CHANGE: support for Node < 16.12.0.

0.8.0 – 2022-03-24

Added

0.7.0 – 2022-03-21

Added

  • #51: support for ES2022 syntax.

0.6.0 – 2022-03-20

Removed

0.5.0 – 2021-11-19

Changed

  • #45 BREAKING CHANGE: ignore tests/__fixtures__ instead of tests/fixtures/.
  • #46 BREAKING CHANGE: update dependencies:
    • the minimal required version of ESLint was changed to 8.0.0,
    • the version of eslint=plugin-mocha was changed to ^9.0.0.

Fixed

  • #47 The engine field in package.json points to version 8 instead of 12.

0.4.0 – 2021-05-20

Added

Changed

  • #38 Set ESLint env to ES2021.

Fixed

  • #37 require-await and require-yield rules can change the behavior of the code.

0.3.0 – 2021-02-20

Added

  • #32 Support for separate testing environment.

0.2.2 – 2019-09-07

Fixed

  • #23 Missing restrictions on console usage.

0.2.1 – 2019-06-30

Fixed

  • #21 Allow space after async keyword in arrow functions.

0.2.0 – 2019-06-29

Added

  • #1 Official support for Node 10.
  • #13 Official support for Node 12.
  • #12 Official support for Windows and macOS.
  • #17 Functions can be used before their definitions.

Changed

  • #10 BREAKING CHANGE: update ESLint to ^6.0.1.
  • #18 Update supported ES version to ES2019.

Removed

  • #13 BREAKING CHANGE: support for Node 6.
  • #16 BREAKING CHANGE: dependency on eslint:recommended.

0.1.0 – 2018-04-14

Added

  • First public version.