@boehringer-ingelheim/eslint-config 7.0.0-next.3 → 7.0.0-next.5

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 CHANGED
@@ -142,10 +142,26 @@ This shared ESLint configuration is specifically tailored for [React](https://re
142
142
  - [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
143
143
  - [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react)
144
144
  - [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
145
+ - [`eslint-plugin-react-refresh`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) (with rule severity `warn`)
145
146
 
146
147
  The configuration sets several custom rules, including [`@typescript-eslint/no-restricted-types`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-restricted-types.mdx) and [`@typescript-eslint/consistent-type-definitions`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-definitions.mdx), as well as rules for organizing and formatting import statements.
147
148
  Additionally in restricts the usage of enums using [`no-restricted-syntax`](https://github.com/eslint/eslint/blob/main/docs/src/rules/no-restricted-syntax.md).
148
149
 
150
+ ### Next.js
151
+
152
+ ```js
153
+ import boehringer from '@boehringer-ingelheim/eslint-config';
154
+
155
+ export default boehringer.config(
156
+ boehringer.configs.strict,
157
+ boehringer.configs.nextjs
158
+ );
159
+ ```
160
+
161
+ This shared ESLint configuration is specifically tailored for [Next.js](https://nextjs.org/) projects. It extends the [react configuration](#react) and includes the [`@next/eslint-plugin-next`](https://nextjs.org/docs/app/api-reference/config/eslint) plugin with the recommended and [`core-web-vital`](https://nextjs.org/docs/app/api-reference/config/eslint#with-core-web-vitals) rule set. The configuration also adapts the rule `react-refresh/only-export-components` to be compatible with Next.js.
162
+
163
+ It
164
+
149
165
  ### Playwright
150
166
 
151
167
  ```js
@@ -0,0 +1,46 @@
1
+ const nextPlugin = require('@next/eslint-plugin-next');
2
+ const tseslint = require('typescript-eslint');
3
+
4
+ const react = require('./react.js');
5
+
6
+ module.exports = tseslint.config(
7
+ ...react,
8
+ {
9
+ plugins: {
10
+ '@next/next': nextPlugin,
11
+ },
12
+ rules: {
13
+ // eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
14
+ 'react-refresh/only-export-components': [
15
+ 'warn',
16
+ {
17
+ /**
18
+ * Next.js allows exporting the following options in pages, layouts and route handlers
19
+ *
20
+ * @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
21
+ */
22
+ allowExportNames: [
23
+ 'config',
24
+ 'dynamic',
25
+ 'dynamicParams',
26
+ 'fetchCache',
27
+ 'generateMetadata',
28
+ 'generateStaticParams',
29
+ 'generateViewport',
30
+ 'maxDuration',
31
+ 'metadata',
32
+ 'preferredRegion',
33
+ 'revalidate',
34
+ 'runtime',
35
+ 'viewport',
36
+ ],
37
+ },
38
+ ],
39
+ ...nextPlugin.configs.recommended.rules,
40
+ ...nextPlugin.configs['core-web-vitals'].rules,
41
+ },
42
+ },
43
+ {
44
+ ignores: ['.next/*'],
45
+ },
46
+ );
package/configs/react.js CHANGED
@@ -13,6 +13,7 @@ module.exports = tseslint.config(
13
13
  jsxA11y.flatConfigs.recommended,
14
14
  react.configs.flat.recommended,
15
15
  react.configs.flat['jsx-runtime'],
16
+ reactRefresh.configs.recommended,
16
17
  {
17
18
  languageOptions: {
18
19
  globals: {
@@ -25,9 +26,7 @@ module.exports = tseslint.config(
25
26
  },
26
27
  },
27
28
  plugins: {
28
- 'jsx-a11y': jsxA11y,
29
29
  'react-hooks': reactHooks,
30
- 'react-refresh': reactRefresh,
31
30
  },
32
31
  rules: {
33
32
  // @typescript-eslint: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules
package/index.js CHANGED
@@ -2,6 +2,7 @@ const tseslint = require('typescript-eslint');
2
2
 
3
3
  const base = require('./configs/base.js');
4
4
  const local = require('./configs/local.js');
5
+ const nextjs = require('./configs/nextjs.js');
5
6
  const playwright = require('./configs/playwright.js');
6
7
  const prettierDisable = require('./configs/prettier-disable.js');
7
8
  const react = require('./configs/react.js');
@@ -12,6 +13,7 @@ module.exports = {
12
13
  configs: {
13
14
  base,
14
15
  local,
16
+ nextjs,
15
17
  playwright,
16
18
  prettierDisable,
17
19
  react,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boehringer-ingelheim/eslint-config",
3
- "version": "7.0.0-next.3",
3
+ "version": "7.0.0-next.5",
4
4
  "description": "Shared eslint configuration used at Boehringer Ingelheim for code styling",
5
5
  "keywords": [
6
6
  "boehringer",
@@ -22,7 +22,7 @@
22
22
  "prepare": "husky",
23
23
  "release": "dotenv -- semantic-release --no-ci",
24
24
  "release:ci": "semantic-release",
25
- "repair": "npx --no rimraf .git/hooks node_modules package-lock.json && npm install",
25
+ "repair": "npx --no rimraf@6 .git/hooks node_modules package-lock.json && npm install",
26
26
  "lint": "eslint ."
27
27
  },
28
28
  "peerDependencies": {
@@ -30,30 +30,31 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@eslint/js": "^9.17.0",
33
+ "@next/eslint-plugin-next": "^15.1.4",
33
34
  "eslint-config-prettier": "^9.1.0",
34
35
  "eslint-import-resolver-typescript": "^3.7.0",
35
36
  "eslint-plugin-import": "^2.31.0",
36
37
  "eslint-plugin-jsx-a11y": "^6.10.2",
37
- "eslint-plugin-perfectionist": "^4.3.0",
38
+ "eslint-plugin-perfectionist": "^4.6.0",
38
39
  "eslint-plugin-playwright": "^2.1.0",
39
- "eslint-plugin-react": "^7.37.2",
40
+ "eslint-plugin-react": "^7.37.3",
40
41
  "eslint-plugin-react-hooks": "^5.1.0",
41
42
  "eslint-plugin-react-refresh": "^0.4.16",
42
43
  "eslint-plugin-sonarjs": "^1.0.4",
43
44
  "globals": "^15.14.0",
44
45
  "is-ci": "^4.1.0",
45
- "typescript-eslint": "^8.18.1"
46
+ "typescript-eslint": "^8.19.1"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@boehringer-ingelheim/prettier-config": "2.0.0",
49
- "@commitlint/cli": "19.6.0",
50
+ "@commitlint/cli": "19.6.1",
50
51
  "@commitlint/config-conventional": "19.6.0",
51
52
  "@commitlint/types": "19.5.0",
52
53
  "@semantic-release/changelog": "6.0.3",
53
54
  "@semantic-release/git": "10.0.1",
54
- "dotenv-cli": "7.4.4",
55
+ "dotenv-cli": "8.0.0",
55
56
  "husky": "9.1.7",
56
57
  "prettier": "3.4.2",
57
- "semantic-release": "24.2.0"
58
+ "semantic-release": "24.2.1"
58
59
  }
59
60
  }