@boehringer-ingelheim/eslint-config 7.4.0 → 8.0.0-defineConfig.2
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/LICENSE +1 -1
- package/README.md +31 -21
- 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 +5 -9
- package/package.json +8 -8
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -25,24 +25,22 @@ Create or update the `eslint.config.mjs` (`eslint.config.cjs` is also possible i
|
|
|
25
25
|
|
|
26
26
|
```js
|
|
27
27
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
28
|
+
import { defineConfig } from 'eslint/config';
|
|
28
29
|
|
|
29
|
-
export default
|
|
30
|
+
export default defineConfig(
|
|
30
31
|
boehringer.configs.strict
|
|
31
32
|
)
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
####
|
|
35
|
-
|
|
36
|
-
This function is a re-export for the config-helper of typescript eslint (See [docs](https://github.com/typescript-eslint/typescript-eslint/blob/a383d5022b81eaf65ce7b0946491444c6eaa28e3/docs/packages/TypeScript_ESLint.mdx#config)).
|
|
37
|
-
|
|
38
|
-
##### Extend or Override configuration
|
|
35
|
+
#### Extend or Override configuration
|
|
39
36
|
|
|
40
37
|
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:
|
|
41
38
|
|
|
42
39
|
```js
|
|
43
40
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
41
|
+
import { defineConfig } from 'eslint/config';
|
|
44
42
|
|
|
45
|
-
export default
|
|
43
|
+
export default defineConfig(
|
|
46
44
|
boehringer.configs.strict,
|
|
47
45
|
{
|
|
48
46
|
rules: {
|
|
@@ -60,8 +58,9 @@ It is recommended to use this function to ensure that your `.gitignore` file is
|
|
|
60
58
|
|
|
61
59
|
```js
|
|
62
60
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
61
|
+
import { defineConfig } from 'eslint/config';
|
|
63
62
|
|
|
64
|
-
export default
|
|
63
|
+
export default defineConfig(
|
|
65
64
|
boehringer.includeIgnoreFile(), // default value '.gitignore'
|
|
66
65
|
boehringer.configs.strict,
|
|
67
66
|
);
|
|
@@ -71,8 +70,9 @@ or in case you have a different paths to your `.gitignore` file(s):
|
|
|
71
70
|
|
|
72
71
|
```js
|
|
73
72
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
73
|
+
import { defineConfig } from 'eslint/config';
|
|
74
74
|
|
|
75
|
-
export default
|
|
75
|
+
export default defineConfig(
|
|
76
76
|
boehringer.includeIgnoreFile('./backend/.gitignore'),
|
|
77
77
|
boehringer.includeIgnoreFile('./frontend/.gitignore'),
|
|
78
78
|
boehringer.configs.strict,
|
|
@@ -95,8 +95,9 @@ Opinionated Options that differ from the standard/recommended ESLint configurati
|
|
|
95
95
|
|
|
96
96
|
```js
|
|
97
97
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
98
|
+
import { defineConfig } from 'eslint/config';
|
|
98
99
|
|
|
99
|
-
export default
|
|
100
|
+
export default defineConfig(
|
|
100
101
|
boehringer.configs.base
|
|
101
102
|
)
|
|
102
103
|
```
|
|
@@ -117,8 +118,9 @@ This configuration also sets up the TypeScript parser [`@typescript-eslint/parse
|
|
|
117
118
|
|
|
118
119
|
```js
|
|
119
120
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
121
|
+
import { defineConfig } from 'eslint/config';
|
|
120
122
|
|
|
121
|
-
export default
|
|
123
|
+
export default defineConfig(
|
|
122
124
|
boehringer.configs.base,
|
|
123
125
|
boehringer.configs.local
|
|
124
126
|
);
|
|
@@ -130,8 +132,9 @@ This shared ESLint configuration configures or disables some rules for a better
|
|
|
130
132
|
|
|
131
133
|
```js
|
|
132
134
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
135
|
+
import { defineConfig } from 'eslint/config';
|
|
133
136
|
|
|
134
|
-
export default
|
|
137
|
+
export default defineConfig(
|
|
135
138
|
boehringer.configs.strict
|
|
136
139
|
);
|
|
137
140
|
```
|
|
@@ -142,8 +145,9 @@ This shared ESLint configuration extends the [base configuration](#base) and add
|
|
|
142
145
|
|
|
143
146
|
```js
|
|
144
147
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
148
|
+
import { defineConfig } from 'eslint/config';
|
|
145
149
|
|
|
146
|
-
export default
|
|
150
|
+
export default defineConfig(
|
|
147
151
|
boehringer.configs.strict,
|
|
148
152
|
boehringer.configs.react
|
|
149
153
|
);
|
|
@@ -163,8 +167,9 @@ Additionally in restricts the usage of enums using [`no-restricted-syntax`](http
|
|
|
163
167
|
|
|
164
168
|
```js
|
|
165
169
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
170
|
+
import { defineConfig } from 'eslint/config';
|
|
166
171
|
|
|
167
|
-
export default
|
|
172
|
+
export default defineConfig(
|
|
168
173
|
boehringer.configs.strict,
|
|
169
174
|
boehringer.configs.nextjs
|
|
170
175
|
);
|
|
@@ -176,8 +181,9 @@ This shared ESLint configuration is specifically tailored for [Next.js](https://
|
|
|
176
181
|
|
|
177
182
|
```js
|
|
178
183
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
184
|
+
import { defineConfig } from 'eslint/config';
|
|
179
185
|
|
|
180
|
-
export default
|
|
186
|
+
export default defineConfig(
|
|
181
187
|
boehringer.configs.strict,
|
|
182
188
|
boehringer.configs.playwright
|
|
183
189
|
);
|
|
@@ -187,12 +193,13 @@ or for specific files only:
|
|
|
187
193
|
|
|
188
194
|
```js
|
|
189
195
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
196
|
+
import { defineConfig } from 'eslint/config';
|
|
190
197
|
|
|
191
|
-
export default
|
|
198
|
+
export default defineConfig(
|
|
192
199
|
boehringer.configs.strict,
|
|
193
200
|
{
|
|
194
201
|
files: ['src/**/*.test.{ts,tsx}'],
|
|
195
|
-
...
|
|
202
|
+
...boehringer.configs.playwright[0],
|
|
196
203
|
},
|
|
197
204
|
);
|
|
198
205
|
```
|
|
@@ -207,8 +214,9 @@ This shared ESLint configuration is designed to enforce best practices and recom
|
|
|
207
214
|
|
|
208
215
|
```js
|
|
209
216
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
217
|
+
import { defineConfig } from 'eslint/config';
|
|
210
218
|
|
|
211
|
-
export default
|
|
219
|
+
export default defineConfig(
|
|
212
220
|
boehringer.configs.strict,
|
|
213
221
|
// possibly other configs,
|
|
214
222
|
boehringer.configs.experimentalNamingConvention
|
|
@@ -222,8 +230,9 @@ This shared ESLint configuration is designed to enforce some naming conventions.
|
|
|
222
230
|
```js
|
|
223
231
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
224
232
|
import prettier from 'eslint-plugin-prettier/recommended';
|
|
233
|
+
import { defineConfig } from 'eslint/config';
|
|
225
234
|
|
|
226
|
-
export default
|
|
235
|
+
export default defineConfig(
|
|
227
236
|
boehringer.configs.strict,
|
|
228
237
|
// Following needs eslint-plugin-prettier to be installed as described by https://github.com/prettier/eslint-plugin-prettier
|
|
229
238
|
// Should be second to last
|
|
@@ -272,8 +281,9 @@ You can use the new [`allowDefaultProject`](https://typescript-eslint.io/package
|
|
|
272
281
|
|
|
273
282
|
```js
|
|
274
283
|
import boehringer from '@boehringer-ingelheim/eslint-config';
|
|
284
|
+
import { defineConfig } from 'eslint/config';
|
|
275
285
|
|
|
276
|
-
export default
|
|
286
|
+
export default defineConfig(
|
|
277
287
|
// other configs,
|
|
278
288
|
{
|
|
279
289
|
languageOptions: {
|
|
@@ -347,7 +357,7 @@ Give a ⭐️ if this project helped you!
|
|
|
347
357
|
|
|
348
358
|
## License
|
|
349
359
|
|
|
350
|
-
Copyright ©
|
|
360
|
+
Copyright © 2025 [Boehringer Ingelheim](https://github.com/boehringer-ingelheim).
|
|
351
361
|
This project is [MIT](https://github.com/boehringer-ingelheim/eslint-config/blob/master/LICENSE) licensed.
|
|
352
362
|
|
|
353
363
|
## 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,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Config } from 'typescript-eslint';
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
3
2
|
|
|
4
3
|
type Configs =
|
|
5
4
|
| 'base'
|
|
@@ -11,18 +10,15 @@ type Configs =
|
|
|
11
10
|
| 'react'
|
|
12
11
|
| 'strict';
|
|
13
12
|
|
|
14
|
-
declare module './index' {
|
|
15
|
-
const
|
|
16
|
-
const configs: Record<Configs, Config>;
|
|
13
|
+
declare module './index.js' {
|
|
14
|
+
export const configs: Record<Configs, Linter.Config[]>;
|
|
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 {Linter.Config} The result of including the ignore file at the resolved absolute path.
|
|
24
22
|
*/
|
|
25
|
-
const includeIgnoreFile: (ignoreFilePath
|
|
26
|
-
|
|
27
|
-
export { config, configs, includeIgnoreFile };
|
|
23
|
+
export const includeIgnoreFile: (ignoreFilePath?: string) => Linter.Config;
|
|
28
24
|
}
|
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.2",
|
|
4
4
|
"description": "Shared eslint configuration used at Boehringer Ingelheim for code styling",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"boehringer",
|
|
@@ -29,25 +29,25 @@
|
|
|
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.3.
|
|
36
|
-
"@eslint/js": "^9.
|
|
37
|
-
"@next/eslint-plugin-next": "^15.
|
|
35
|
+
"@eslint/compat": "^1.3.2",
|
|
36
|
+
"@eslint/js": "^9.34.0",
|
|
37
|
+
"@next/eslint-plugin-next": "^15.5.2",
|
|
38
38
|
"eslint-config-prettier": "^10.1.8",
|
|
39
39
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
40
40
|
"eslint-plugin-import": "^2.32.0",
|
|
41
41
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
42
42
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
43
|
-
"eslint-plugin-playwright": "^2.2.
|
|
43
|
+
"eslint-plugin-playwright": "^2.2.2",
|
|
44
44
|
"eslint-plugin-react": "^7.37.5",
|
|
45
45
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
46
46
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
47
47
|
"eslint-plugin-sonarjs": "^1.0.4",
|
|
48
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",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
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
61
|
"prettier": "3.6.2",
|
|
62
62
|
"semantic-release": "24.2.7"
|