@boehringer-ingelheim/eslint-config

中文文档
10.0.0发布于 2026/07/10MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2781

Shared eslint configuration used at Boehringer Ingelheim for code styling

原始使用文档
文档目录24 节
  1. Usage
  2. Install the package
  3. Add the configuration
  4. Run
  5. Shared Configurations
  6. Base
  7. Local
  8. Strict
  9. React
  10. Next.js
  11. Playwright
  12. (experimental) Naming Convention
  13. Prettier-disable
  14. Known issues
  15. Parsing error
  16. Local Development
  17. Install Dependencies
  18. Test
  19. Repair
  20. Release
  21. Roadmap
  22. Show your support
  23. License
  24. Resources

ESLint Configuration

ESLint statically analyzes your code to quickly find problems. It is built into most text editors and you can run ESLint as part of your continuous integration pipeline. - https://eslint.org/

This is the shared ESLint configuration used at Boehringer Ingelheim for code styling.

npm version npm downloads License: MIT Maintenance Conventional Commits semantic-release: angular

Usage

Install the package

npm install --save-dev @boehringer-ingelheim/eslint-config

Add the configuration

Create or update the eslint.config.mjs (eslint.config.cjs is also possible if commonjs is preferred) file in your projects root directory accordingly.

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict
)

Extend or Override configuration

This is not recommended as the goal is to have similar code stylings in all projects, but if for some reason you need to add or change the configuration, it is possible in the following way:

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict, 
  {
    rules: {
      'no-empty-function': 'off',
    },
  }
);

boehringer.includeIgnoreFile()

The includeIgnoreFile function allows you to include .gitignore files in your ESLint configuration using a relative path. This is an adjusted version of the same function from ESLint (Ignore Files). It is recommended to use this function to ensure that your .gitignore file is properly included in your ESLint setup.

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.includeIgnoreFile(), // default value '.gitignore'
  boehringer.configs.strict,
);

or in case you have a different paths to your .gitignore file(s):

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.includeIgnoreFile('./backend/.gitignore'),
  boehringer.includeIgnoreFile('./frontend/.gitignore'),
  boehringer.configs.strict,
);

More Information: ESLint - Configuration Files

Run

npx eslint .

Shared Configurations

Opinionated Options that differ from the standard/recommended ESLint configurations.

Base

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.base
)

This shared ESLint configuration is set up for TypeScript projects that adhere to modern JavaScript standards. It uses the latest version of TypeScript (ES2022) and extends several plugins and recommended rules to enforce best practices and catch potential errors.

The following plugins are used in this configuration:

Additionally, the eslint-plugin-perfectionist is used to automatically fix sorting issues.

This configuration also sets up the TypeScript parser @typescript-eslint/parser and eslint-import-resolver-typescript.

Local

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.base,
  boehringer.configs.local
);

This shared ESLint configuration configures or disables some rules for a better performance locally. With the help of is-ci those configs only apply to environments outside the CI pipelines.

Strict

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict
);

This shared ESLint configuration extends the base configuration and adds additional strict linting rules from the typescript-eslint plugin. These strict rules aim to enforce a high standard of code quality and improve code maintainability.

React

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict,
  boehringer.configs.react
);

This shared ESLint configuration is specifically tailored for React projects, and extends the base configuration. It uses the browser environment, and includes recommended configurations for the following plugins:

The configuration sets several custom rules, including @typescript-eslint/no-restricted-types and @typescript-eslint/consistent-type-definitions, as well as rules for organizing and formatting import statements. Additionally in restricts the usage of enums using no-restricted-syntax.

Next.js

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict,
  boehringer.configs.nextjs
);

This shared ESLint configuration is specifically tailored for Next.js projects. It extends the react configuration and includes the @next/eslint-plugin-next plugin with the recommended and core-web-vital rule set. The configuration also adapts the rule react-refresh/only-export-components to be compatible with Next.js.

Playwright

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict,
  boehringer.configs.playwright
);

or for specific files only:

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict,
  {
    files: ['src/**/*.test.{ts,tsx}'],
    ...boehringer.configs.playwright[0],
  },
);

This shared ESLint configuration is designed to enforce best practices and recommendations when writing tests with Playwright. It extends the eslint-plugin-playwright configuration and adds the following rules:

(experimental) Naming Convention

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict,
  // possibly other configs,
  boehringer.configs.experimentalNamingConvention
);

This shared ESLint configuration is designed to enforce some naming conventions. It uses the @typescript-eslint/naming-convention rule for enforcing the naming conventions. The enforced conventions can be found in configs/naming-convention.js

Prettier-disable

import boehringer from '@boehringer-ingelheim/eslint-config';
import prettier from 'eslint-plugin-prettier/recommended';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  boehringer.configs.strict,
  // Following needs eslint-plugin-prettier to be installed as described by https://github.com/prettier/eslint-plugin-prettier
  // Should be second to last
  prettier,
  // Should be last
  boehringer.configs.prettierDisable,
);

This shared ESLint configuration is wrapper around eslint-config-disable, which is used to turn off all rules that are unnecessary or might conflict with Prettier. This wrapper reenables a few rules that can be used with our shared configurations as we are using specific options of those rules which are compatible with Prettier (see Special Rules). Following rules are reenabled:

  • curly with the (default) option "all": Enforce consistent brace style for all control statements
  • no-confusing-arrow with allowParens false and onlyOneSimpleParam true: Disallow arrow functions where they could be confused with comparisons.

Known issues

Parsing error

ESLint may throw one of the following errors for some files (even for its own eslint.config.js):

  • ESLint was configured to run ... However, that TSConfig does not / none of those TSConfigs include this file.
  • ... was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject

This error is caused by including the respective file in the scope of ESLint but not in the scope of TypeScript. For more information about this error and more suggestions how to solve it you can check the troubleshooting of typescript-eslint.

Our recommendation is to keep type-aware linting of those files.

Solution 1

Include the .(c|m)?js files in your main tsconfig.json:

{
  "include": [
    // your existing includes
    "*.*js", // this will include all .js, .cjs, .mjs files and similar in your project root
    "*.ts", // this will include all .ts files and similar in your project root
    // Add all other files/folders in which this error occurs
  ]
}

Solution 2

You can use the new allowDefaultProject option, which works perfectly with our projectService configuration:

import boehringer from '@boehringer-ingelheim/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig(
  // other configs,
  {
    languageOptions: {
      parserOptions: {
        projectService: {
          allowDefaultProject: [
            '*.*js', 
            '.*.*js',
          ],
          // defaultProject can be used to specify separate tsconfig options for "out-of-project" files included by allowDefaultProject
          // defaultProject: 'tsconfig.eslint.json',
        },
      },
    },
  },
)

Local Development

Install Dependencies

npm install

Test

npm test

Repair

This command may be useful when obscure errors or issues are encountered. It removes and recreates dependencies of your project.

npm run repair

Release

[!IMPORTANT]
Manual releases are not supported to ensure consistency and security, see: https://docs.npmjs.com/trusted-publishers

Releases are automated through GitHub Actions using semantic-release. It bumps the version according to conventional commits, publishes the package to npm and release a new version to GitHub.

npm run release

Roadmap

  • Shared configuration: Angular
  • Shared configuration: Node.js
  • Test Cases
  • "Flat" Config

Show your support

Give a ⭐️ if this project helped you!

License

Copyright © 2026 Boehringer Ingelheim.
This project is MIT licensed.

Resources

版本与发布记录

@boehringer-ingelheim/eslint-config 共发布 106 个版本,首次发布于 2023/02/07;过去 12 个月发布了 30 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
10.0.0latest2026/07/103 个月前
10.0.0-next.22026/07/094 个月前
10.0.0-next.12026/06/264 个月前
10.0.0-import-x.12026/06/124 个月前
9.5.02026/05/275 个月前
9.5.0-add-regression-testing.22026/05/275 个月前

其他发布通道:flat-config → 6.0.0-flat-config.2,migrate-flat-config → 7.0.0-migrate-flat-config.1,typescript-eslint-parser-options → 7.0.0-typescript-eslint-parser-options.1,shared-configuration-nextjs → 7.0.0-shared-configuration-nextjs.4,naming-convetion-configuration → 7.0.0-naming-convetion-configuration.2,support-playwright-ct → 7.2.0-support-playwright-ct.1。

关于 @boehringer-ingelheim/eslint-config 的常见问题

@boehringer-ingelheim/eslint-config 是什么?

Shared eslint configuration used at Boehringer Ingelheim for code styling

如何安装 @boehringer-ingelheim/eslint-config?

在项目目录运行 npm install @boehringer-ingelheim/eslint-config,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(>= 9.34.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@boehringer-ingelheim/eslint-config 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@boehringer-ingelheim/eslint-config 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@boehringer-ingelheim/eslint-config 可以商用吗?

@boehringer-ingelheim/eslint-config 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@boehringer-ingelheim/eslint-config 的下载量有多少?

根据 npm 官方下载统计,@boehringer-ingelheim/eslint-config 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,781 次,日均约 93 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@boehringer-ingelheim/eslint-config 还在维护吗?

最新版本 10.0.0 发布于 2026/07/10(3 个月前);至今共发布 106 个版本,其中过去 12 个月发布了 30 个;首次发布于 2023/02/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。