@boehringer-ingelheim/eslint-config 8.0.0 → 8.1.0

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/configs/nextjs.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const nextPlugin = require('@next/eslint-plugin-next');
2
2
  const { defineConfig } = require('eslint/config');
3
3
 
4
+ const { NEXTJS_ROUTING_FILES } = require('../lib/nextjs.utils.js');
4
5
  const react = require('./react.js');
5
6
 
6
7
  module.exports = defineConfig(
@@ -10,34 +11,79 @@ module.exports = defineConfig(
10
11
  '@next/next': nextPlugin,
11
12
  },
12
13
  rules: {
14
+ ...nextPlugin.configs.recommended.rules,
15
+ ...nextPlugin.configs['core-web-vitals'].rules,
16
+ },
17
+ },
18
+ {
19
+ files: [`{app,src/app}/**/{${NEXTJS_ROUTING_FILES.join(',')}}.{ts,tsx}`],
20
+ rules: {
21
+ 'import/no-unused-modules': ['off'],
22
+
13
23
  // eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
14
24
  'react-refresh/only-export-components': [
15
25
  'warn',
16
26
  {
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
27
  allowExportNames: [
23
- 'config',
28
+ /**
29
+ * Next.js allows exporting the following options in pages, layouts and route handlers
30
+ *
31
+ * @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
32
+ */
24
33
  'dynamic',
25
34
  'dynamicParams',
26
35
  'fetchCache',
27
- 'generateMetadata',
28
- 'generateStaticParams',
29
- 'generateViewport',
30
36
  'maxDuration',
31
- 'metadata',
32
37
  'preferredRegion',
33
38
  'revalidate',
34
39
  'runtime',
40
+
41
+ /**
42
+ * Next.js allows exporting the following metadata options in layouts and pages
43
+ *
44
+ * @link https://nextjs.org/docs/app/api-reference/functions/generate-metadata
45
+ */
46
+ 'generateMetadata',
47
+ 'metadata',
48
+
49
+ /**
50
+ * Next.js allows exporting the following static params functions in pages
51
+ *
52
+ * @link https://nextjs.org/docs/app/api-reference/functions/generate-static-params
53
+ */
54
+ 'generateStaticParams',
55
+
56
+ /**
57
+ * Next.js allows exporting the following viewport options in layouts and pages
58
+ *
59
+ * @link https://nextjs.org/docs/app/api-reference/functions/generate-viewport
60
+ */
61
+ 'generateViewport',
35
62
  'viewport',
36
63
  ],
37
64
  },
38
65
  ],
39
- ...nextPlugin.configs.recommended.rules,
40
- ...nextPlugin.configs['core-web-vitals'].rules,
66
+ },
67
+ },
68
+ {
69
+ files: [`{middleware,src/middleware}.{ts,tsx}`],
70
+ rules: {
71
+ 'import/no-unused-modules': ['off'],
72
+
73
+ // eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
74
+ 'react-refresh/only-export-components': [
75
+ 'warn',
76
+ {
77
+ allowExportNames: [
78
+ /**
79
+ * Next.js allows exporting the following config options in middleware
80
+ *
81
+ * @link https://nextjs.org/docs/app/api-reference/file-conventions/middleware#config-object-optional
82
+ */
83
+ 'config',
84
+ ],
85
+ },
86
+ ],
41
87
  },
42
88
  },
43
89
  {
@@ -0,0 +1,24 @@
1
+ /**
2
+ * List of special file names used by Next.js for routing and layouts.
3
+ *
4
+ * These filenames have specific purposes in the Next.js app directory structure,
5
+ * such as defining pages, layouts, error boundaries, and loading states.
6
+ *
7
+ * @type {string[]}
8
+ * @see {@link https://nextjs.org/docs/app/getting-started/project-structure#routing-files}
9
+ */
10
+ const NEXTJS_ROUTING_FILES = [
11
+ 'default',
12
+ 'error',
13
+ 'global-error',
14
+ 'layout',
15
+ 'loading',
16
+ 'not-found',
17
+ 'page',
18
+ 'route',
19
+ 'template',
20
+ ];
21
+
22
+ module.exports = {
23
+ NEXTJS_ROUTING_FILES,
24
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boehringer-ingelheim/eslint-config",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "Shared eslint configuration used at Boehringer Ingelheim for code styling",
5
5
  "keywords": [
6
6
  "boehringer",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@eslint/compat": "^1.3.2",
36
- "@eslint/js": "^9.34.0",
37
- "@next/eslint-plugin-next": "^15.5.2",
36
+ "@eslint/js": "^9.35.0",
37
+ "@next/eslint-plugin-next": "^15.5.3",
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",
@@ -45,9 +45,9 @@
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
- "globals": "^16.3.0",
48
+ "globals": "^16.4.0",
49
49
  "is-ci": "^4.1.0",
50
- "typescript-eslint": "^8.42.0"
50
+ "typescript-eslint": "^8.43.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@boehringer-ingelheim/prettier-config": "2.0.0",
@@ -59,6 +59,6 @@
59
59
  "dotenv-cli": "10.0.0",
60
60
  "husky": "9.1.7",
61
61
  "prettier": "3.6.2",
62
- "semantic-release": "24.2.7"
62
+ "semantic-release": "24.2.8"
63
63
  }
64
64
  }