@boehringer-ingelheim/eslint-config 7.3.1 → 8.0.0-defineConfig.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/configs/base.js +2 -1
- package/configs/experimental-naming-convention.js +2 -2
- package/configs/local.js +2 -2
- package/configs/nextjs.js +2 -2
- package/configs/playwright.js +2 -2
- package/configs/prettier-disable.js +2 -2
- package/configs/react.js +2 -2
- package/configs/strict.js +2 -1
- package/index.d.ts +6 -8
- package/index.js +2 -2
- package/package.json +21 -21
package/README.md
CHANGED
|
@@ -26,14 +26,14 @@ Create or update the `eslint.config.mjs` (`eslint.config.cjs` is also possible i
|
|
|
26
26
|
```js
|
|
27
27
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
28
28
|
|
|
29
|
-
export default boehringer.
|
|
29
|
+
export default boehringer.defineConfig(
|
|
30
30
|
boehringer.configs.strict
|
|
31
31
|
)
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
#### `boehringer.
|
|
34
|
+
#### `boehringer.defineConfig(...)`
|
|
35
35
|
|
|
36
|
-
This function is a re-export for the config-helper of
|
|
36
|
+
This function is a re-export for the config-helper of eslint (See [docs](https://eslint.org/blog/2025/03/flat-config-extends-define-config-global-ignores/#introducing-defineconfig()-for-eslint)).
|
|
37
37
|
|
|
38
38
|
##### Extend or Override configuration
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ This is not recommended as the goal is to have similar code stylings in all proj
|
|
|
42
42
|
```js
|
|
43
43
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
44
44
|
|
|
45
|
-
export default boehringer.
|
|
45
|
+
export default boehringer.defineConfig(
|
|
46
46
|
boehringer.configs.strict,
|
|
47
47
|
{
|
|
48
48
|
rules: {
|
|
@@ -61,7 +61,7 @@ It is recommended to use this function to ensure that your `.gitignore` file is
|
|
|
61
61
|
```js
|
|
62
62
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
63
63
|
|
|
64
|
-
export default boehringer.
|
|
64
|
+
export default boehringer.defineConfig(
|
|
65
65
|
boehringer.includeIgnoreFile(), // default value '.gitignore'
|
|
66
66
|
boehringer.configs.strict,
|
|
67
67
|
);
|
|
@@ -72,7 +72,7 @@ or in case you have a different paths to your `.gitignore` file(s):
|
|
|
72
72
|
```js
|
|
73
73
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
74
74
|
|
|
75
|
-
export default boehringer.
|
|
75
|
+
export default boehringer.defineConfig(
|
|
76
76
|
boehringer.includeIgnoreFile('./backend/.gitignore'),
|
|
77
77
|
boehringer.includeIgnoreFile('./frontend/.gitignore'),
|
|
78
78
|
boehringer.configs.strict,
|
|
@@ -96,7 +96,7 @@ Opinionated Options that differ from the standard/recommended ESLint configurati
|
|
|
96
96
|
```js
|
|
97
97
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
98
98
|
|
|
99
|
-
export default boehringer.
|
|
99
|
+
export default boehringer.defineConfig(
|
|
100
100
|
boehringer.configs.base
|
|
101
101
|
)
|
|
102
102
|
```
|
|
@@ -118,7 +118,7 @@ This configuration also sets up the TypeScript parser [`@typescript-eslint/parse
|
|
|
118
118
|
```js
|
|
119
119
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
120
120
|
|
|
121
|
-
export default boehringer.
|
|
121
|
+
export default boehringer.defineConfig(
|
|
122
122
|
boehringer.configs.base,
|
|
123
123
|
boehringer.configs.local
|
|
124
124
|
);
|
|
@@ -131,7 +131,7 @@ This shared ESLint configuration configures or disables some rules for a better
|
|
|
131
131
|
```js
|
|
132
132
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
133
133
|
|
|
134
|
-
export default boehringer.
|
|
134
|
+
export default boehringer.defineConfig(
|
|
135
135
|
boehringer.configs.strict
|
|
136
136
|
);
|
|
137
137
|
```
|
|
@@ -143,7 +143,7 @@ This shared ESLint configuration extends the [base configuration](#base) and add
|
|
|
143
143
|
```js
|
|
144
144
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
145
145
|
|
|
146
|
-
export default boehringer.
|
|
146
|
+
export default boehringer.defineConfig(
|
|
147
147
|
boehringer.configs.strict,
|
|
148
148
|
boehringer.configs.react
|
|
149
149
|
);
|
|
@@ -164,7 +164,7 @@ Additionally in restricts the usage of enums using [`no-restricted-syntax`](http
|
|
|
164
164
|
```js
|
|
165
165
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
166
166
|
|
|
167
|
-
export default boehringer.
|
|
167
|
+
export default boehringer.defineConfig(
|
|
168
168
|
boehringer.configs.strict,
|
|
169
169
|
boehringer.configs.nextjs
|
|
170
170
|
);
|
|
@@ -177,7 +177,7 @@ This shared ESLint configuration is specifically tailored for [Next.js](https://
|
|
|
177
177
|
```js
|
|
178
178
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
179
179
|
|
|
180
|
-
export default boehringer.
|
|
180
|
+
export default boehringer.defineConfig(
|
|
181
181
|
boehringer.configs.strict,
|
|
182
182
|
boehringer.configs.playwright
|
|
183
183
|
);
|
|
@@ -188,7 +188,7 @@ or for specific files only:
|
|
|
188
188
|
```js
|
|
189
189
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
190
190
|
|
|
191
|
-
export default boehringer.
|
|
191
|
+
export default boehringer.defineConfig(
|
|
192
192
|
boehringer.configs.strict,
|
|
193
193
|
{
|
|
194
194
|
files: ['src/**/*.test.{ts,tsx}'],
|
|
@@ -208,7 +208,7 @@ This shared ESLint configuration is designed to enforce best practices and recom
|
|
|
208
208
|
```js
|
|
209
209
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
210
210
|
|
|
211
|
-
export default boehringer.
|
|
211
|
+
export default boehringer.defineConfig(
|
|
212
212
|
boehringer.configs.strict,
|
|
213
213
|
// possibly other configs,
|
|
214
214
|
boehringer.configs.experimentalNamingConvention
|
|
@@ -223,7 +223,7 @@ This shared ESLint configuration is designed to enforce some naming conventions.
|
|
|
223
223
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
224
224
|
import prettier from 'eslint-plugin-prettier/recommended';
|
|
225
225
|
|
|
226
|
-
export default boehringer.
|
|
226
|
+
export default boehringer.defineConfig(
|
|
227
227
|
boehringer.configs.strict,
|
|
228
228
|
// Following needs eslint-plugin-prettier to be installed as described by https://github.com/prettier/eslint-plugin-prettier
|
|
229
229
|
// Should be second to last
|
|
@@ -273,7 +273,7 @@ You can use the new [`allowDefaultProject`](https://typescript-eslint.io/package
|
|
|
273
273
|
```js
|
|
274
274
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
275
275
|
|
|
276
|
-
export default boehringer.
|
|
276
|
+
export default boehringer.defineConfig(
|
|
277
277
|
// other configs,
|
|
278
278
|
{
|
|
279
279
|
languageOptions: {
|
|
@@ -347,7 +347,7 @@ Give a ⭐️ if this project helped you!
|
|
|
347
347
|
|
|
348
348
|
## License
|
|
349
349
|
|
|
350
|
-
Copyright ©
|
|
350
|
+
Copyright © 2025 [Boehringer Ingelheim](https://github.com/boehringer-ingelheim).
|
|
351
351
|
This project is [MIT](https://github.com/boehringer-ingelheim/eslint-config/blob/master/LICENSE) licensed.
|
|
352
352
|
|
|
353
353
|
## Resources
|
package/configs/base.js
CHANGED
|
@@ -2,6 +2,7 @@ const eslint = require('@eslint/js');
|
|
|
2
2
|
const importPlugin = require('eslint-plugin-import');
|
|
3
3
|
const perfectionist = require('eslint-plugin-perfectionist');
|
|
4
4
|
const sonarjs = require('eslint-plugin-sonarjs');
|
|
5
|
+
const { defineConfig } = require('eslint/config');
|
|
5
6
|
const tseslint = require('typescript-eslint');
|
|
6
7
|
|
|
7
8
|
const {
|
|
@@ -10,7 +11,7 @@ const {
|
|
|
10
11
|
SORT_INTERSECTION_TYPES_GROUPS,
|
|
11
12
|
} = require('../lib/eslint-plugin-perfectionist.js');
|
|
12
13
|
|
|
13
|
-
module.exports =
|
|
14
|
+
module.exports = defineConfig(
|
|
14
15
|
eslint.configs.recommended,
|
|
15
16
|
tseslint.configs.recommendedTypeChecked,
|
|
16
17
|
tseslint.configs.stylisticTypeChecked,
|
package/configs/local.js
CHANGED
package/configs/nextjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const nextPlugin = require('@next/eslint-plugin-next');
|
|
2
|
-
const
|
|
2
|
+
const { defineConfig } = require('eslint/config');
|
|
3
3
|
|
|
4
4
|
const react = require('./react.js');
|
|
5
5
|
|
|
6
|
-
module.exports =
|
|
6
|
+
module.exports = defineConfig(
|
|
7
7
|
...react,
|
|
8
8
|
{
|
|
9
9
|
plugins: {
|
package/configs/playwright.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const playwright = require('eslint-plugin-playwright');
|
|
2
|
-
const
|
|
2
|
+
const { defineConfig } = require('eslint/config');
|
|
3
3
|
|
|
4
|
-
module.exports =
|
|
4
|
+
module.exports = defineConfig({
|
|
5
5
|
...playwright.configs['flat/recommended'],
|
|
6
6
|
rules: {
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const prettier = require('eslint-config-prettier');
|
|
2
|
-
const
|
|
2
|
+
const { defineConfig } = require('eslint/config');
|
|
3
3
|
|
|
4
|
-
module.exports =
|
|
4
|
+
module.exports = defineConfig({
|
|
5
5
|
...prettier,
|
|
6
6
|
rules: {
|
|
7
7
|
...prettier.rules,
|
package/configs/react.js
CHANGED
|
@@ -2,13 +2,13 @@ const jsxA11y = require('eslint-plugin-jsx-a11y');
|
|
|
2
2
|
const react = require('eslint-plugin-react');
|
|
3
3
|
const reactHooks = require('eslint-plugin-react-hooks');
|
|
4
4
|
const reactRefresh = require('eslint-plugin-react-refresh');
|
|
5
|
+
const { defineConfig } = require('eslint/config');
|
|
5
6
|
const globals = require('globals');
|
|
6
|
-
const tseslint = require('typescript-eslint');
|
|
7
7
|
|
|
8
8
|
const { SORT_IMPORTS_GROUPS } = require('../lib/eslint-plugin-perfectionist.js');
|
|
9
9
|
const base = require('./base.js');
|
|
10
10
|
|
|
11
|
-
module.exports =
|
|
11
|
+
module.exports = defineConfig(
|
|
12
12
|
...base,
|
|
13
13
|
jsxA11y.flatConfigs.recommended,
|
|
14
14
|
react.configs.flat.recommended,
|
package/configs/strict.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
const { defineConfig } = require('eslint/config');
|
|
1
2
|
const tseslint = require('typescript-eslint');
|
|
2
3
|
|
|
3
4
|
const base = require('./base.js');
|
|
4
5
|
|
|
5
|
-
module.exports =
|
|
6
|
+
module.exports = defineConfig(...base, tseslint.configs.strictTypeChecked, {
|
|
6
7
|
rules: {
|
|
7
8
|
// @typescript-eslint: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules
|
|
8
9
|
'@typescript-eslint/consistent-type-imports': 'error',
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Config } from 'typescript-eslint';
|
|
3
|
-
|
|
1
|
+
type Config = import('eslint').Linter.Config;
|
|
4
2
|
type Configs =
|
|
5
3
|
| 'base'
|
|
6
4
|
| 'experimentalNamingConvention'
|
|
@@ -11,18 +9,18 @@ type Configs =
|
|
|
11
9
|
| 'react'
|
|
12
10
|
| 'strict';
|
|
13
11
|
|
|
14
|
-
declare module '
|
|
15
|
-
const config: typeof import('typescript-eslint').config;
|
|
12
|
+
declare module '@boehringer-ingelheim/eslint-config' {
|
|
16
13
|
const configs: Record<Configs, Config>;
|
|
14
|
+
const defineConfig: typeof import('eslint/config').defineConfig;
|
|
17
15
|
/**
|
|
18
16
|
* Reads an ignore file (e.g. `.gitignore`) and returns an object with the ignore patterns.
|
|
19
17
|
*
|
|
20
18
|
* @param {string} [ignoreFilePath='.gitignore'] - The path to the ignore file. Defaults to `.gitignore`.
|
|
21
19
|
* @throws {TypeError} If the provided path is not a string.
|
|
22
20
|
* @throws {Error} If the provided path is an empty string.
|
|
23
|
-
* @returns {
|
|
21
|
+
* @returns {Config} The result of including the ignore file at the resolved absolute path.
|
|
24
22
|
*/
|
|
25
|
-
const includeIgnoreFile: (ignoreFilePath
|
|
23
|
+
const includeIgnoreFile: (ignoreFilePath?: string) => Config;
|
|
26
24
|
|
|
27
|
-
export {
|
|
25
|
+
export { configs, defineConfig, includeIgnoreFile };
|
|
28
26
|
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { defineConfig } = require('eslint/config');
|
|
2
2
|
|
|
3
3
|
const base = require('./configs/base.js');
|
|
4
4
|
const experimentalNamingConvention = require('./configs/experimental-naming-convention.js');
|
|
@@ -11,7 +11,6 @@ const strict = require('./configs/strict.js');
|
|
|
11
11
|
const { includeIgnoreFile } = require('./lib/include-ignore-file.js');
|
|
12
12
|
|
|
13
13
|
module.exports = {
|
|
14
|
-
config: tseslint.config,
|
|
15
14
|
configs: {
|
|
16
15
|
base,
|
|
17
16
|
experimentalNamingConvention,
|
|
@@ -22,5 +21,6 @@ module.exports = {
|
|
|
22
21
|
react,
|
|
23
22
|
strict,
|
|
24
23
|
},
|
|
24
|
+
defineConfig,
|
|
25
25
|
includeIgnoreFile,
|
|
26
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boehringer-ingelheim/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-defineConfig.1",
|
|
4
4
|
"description": "Shared eslint configuration used at Boehringer Ingelheim for code styling",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"boehringer",
|
|
@@ -29,36 +29,36 @@
|
|
|
29
29
|
"lint": "eslint ."
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"eslint": ">=
|
|
32
|
+
"eslint": ">= 9.34.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@eslint/compat": "^1.2
|
|
36
|
-
"@eslint/js": "^9.
|
|
37
|
-
"@next/eslint-plugin-next": "^15.
|
|
38
|
-
"eslint-config-prettier": "^10.
|
|
39
|
-
"eslint-import-resolver-typescript": "^
|
|
40
|
-
"eslint-plugin-import": "^2.
|
|
35
|
+
"@eslint/compat": "^1.3.2",
|
|
36
|
+
"@eslint/js": "^9.34.0",
|
|
37
|
+
"@next/eslint-plugin-next": "^15.5.2",
|
|
38
|
+
"eslint-config-prettier": "^10.1.8",
|
|
39
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
40
|
+
"eslint-plugin-import": "^2.32.0",
|
|
41
41
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
42
|
-
"eslint-plugin-perfectionist": "^4.
|
|
43
|
-
"eslint-plugin-playwright": "^2.2.
|
|
44
|
-
"eslint-plugin-react": "^7.37.
|
|
45
|
-
"eslint-plugin-react-hooks": "^5.
|
|
46
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
42
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
43
|
+
"eslint-plugin-playwright": "^2.2.2",
|
|
44
|
+
"eslint-plugin-react": "^7.37.5",
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
46
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
47
47
|
"eslint-plugin-sonarjs": "^1.0.4",
|
|
48
|
-
"globals": "^
|
|
48
|
+
"globals": "^16.3.0",
|
|
49
49
|
"is-ci": "^4.1.0",
|
|
50
|
-
"typescript-eslint": "^8.
|
|
50
|
+
"typescript-eslint": "^8.42.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@boehringer-ingelheim/prettier-config": "2.0.0",
|
|
54
|
-
"@commitlint/cli": "19.
|
|
55
|
-
"@commitlint/config-conventional": "19.
|
|
56
|
-
"@commitlint/types": "19.
|
|
54
|
+
"@commitlint/cli": "19.8.1",
|
|
55
|
+
"@commitlint/config-conventional": "19.8.1",
|
|
56
|
+
"@commitlint/types": "19.8.1",
|
|
57
57
|
"@semantic-release/changelog": "6.0.3",
|
|
58
58
|
"@semantic-release/git": "10.0.1",
|
|
59
|
-
"dotenv-cli": "
|
|
59
|
+
"dotenv-cli": "10.0.0",
|
|
60
60
|
"husky": "9.1.7",
|
|
61
|
-
"prettier": "3.
|
|
62
|
-
"semantic-release": "24.2.
|
|
61
|
+
"prettier": "3.6.2",
|
|
62
|
+
"semantic-release": "24.2.7"
|
|
63
63
|
}
|
|
64
64
|
}
|