diff --git a/apps/web/package.json b/apps/web/package.json index 59f3cb7..e3064bd 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -65,7 +65,7 @@ "eslint-plugin-code-import-patterns": "^3.0.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.28.1", - "eslint-plugin-node": "^11.1.0", + "eslint-plugin-n": "^16.2.0", "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", diff --git a/apps/web/src/config.ts b/apps/web/src/config.ts index 9643bea..7dfcf71 100644 --- a/apps/web/src/config.ts +++ b/apps/web/src/config.ts @@ -1,4 +1,4 @@ -/* eslint-disable node/no-process-env -- config.ts is the only place where reading from process.env is allowed */ +/* eslint-disable n/no-process-env -- config.ts is the only place where reading from process.env is allowed */ let deploymentOrigin; if (typeof window !== 'undefined') { diff --git a/package.json b/package.json index 8d25842..6cefee7 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,11 @@ "prettier": "^2.8.8", "turbo": "^1.10.16" }, + "dependenciesMeta": { + "@pkerschbaum-homepage/config-eslint": { + "injected": true + } + }, "packageManager": "pnpm@8.9.0", "engines": { "pnpm": "8.9.0", diff --git a/packages/mdx/package.json b/packages/mdx/package.json index 653f532..35f27d5 100644 --- a/packages/mdx/package.json +++ b/packages/mdx/package.json @@ -46,7 +46,7 @@ "eslint-plugin-code-import-patterns": "^3.0.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.28.1", - "eslint-plugin-node": "^11.1.0", + "eslint-plugin-n": "^16.2.0", "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-regexp": "^2.1.0", "eslint-plugin-unicorn": "^48.0.1", diff --git a/platform/config-eslint/eslint-ecma.cjs b/platform/config-eslint/eslint-ecma.cjs index 4e39fbd..9d7880c 100644 --- a/platform/config-eslint/eslint-ecma.cjs +++ b/platform/config-eslint/eslint-ecma.cjs @@ -14,7 +14,7 @@ module.exports = { */ 'only-warn', '@typescript-eslint/eslint-plugin', - 'node', + 'n', 'regexp', 'code-import-patterns', ], @@ -26,7 +26,7 @@ module.exports = { 'plugin:regexp/recommended', 'plugin:import/recommended', 'plugin:import/typescript', - 'plugin:node/recommended', + 'plugin:n/recommended', 'plugin:unicorn/recommended', 'plugin:eslint-comments/recommended', 'prettier', @@ -99,23 +99,23 @@ module.exports = { ], }, ], - 'node/handle-callback-err': 'error', - 'node/no-callback-literal': 'error', - // disable "node/no-extraneous-import" --> thanks to "isolated mode" of node_modules of pnpm and "public-hoist-pattern" being disabled of this monorepo, there is no possibilty for extraneous imports - 'node/no-extraneous-import': 'off', - // disable "node/no-missing-import" --> covered by TypeScript - 'node/no-missing-import': 'off', - 'node/no-process-env': 'error', - 'node/no-sync': 'error', - // disable "node/no-unpublished-import" and "node/no-unpublished-require" --> wrong positive for "@vercel/analytics" for whatever reason - 'node/no-unpublished-import': 'off', - 'node/no-unpublished-require': 'off', - // disable "node/no-unsupported-features/es-syntax" --> covered by TypeScript - 'node/no-unsupported-features/es-syntax': 'off', - // disable "node/no-unsupported-features/es-builtins" --> covered by TypeScript - 'node/no-unsupported-features/es-builtins': 'off', - // disable "node/no-unsupported-features/node-builtins" --> covered by TypeScript - 'node/no-unsupported-features/node-builtins': 'off', + 'n/handle-callback-err': 'error', + 'n/no-callback-literal': 'error', + // disable "n/no-extraneous-import" --> thanks to "isolated mode" of node_modules of pnpm and "public-hoist-pattern" being disabled of this monorepo, there is no possibilty for extraneous imports + 'n/no-extraneous-import': 'off', + // disable "n/no-missing-import" --> covered by TypeScript + 'n/no-missing-import': 'off', + 'n/no-process-env': 'error', + 'n/no-sync': 'error', + // disable "n/no-unpublished-import" and "n/no-unpublished-require" --> wrong positive for "@vercel/analytics" for whatever reason + 'n/no-unpublished-import': 'off', + 'n/no-unpublished-require': 'off', + // disable "n/no-unsupported-features/es-syntax" --> covered by TypeScript + 'n/no-unsupported-features/es-syntax': 'off', + // disable "n/no-unsupported-features/es-builtins" --> covered by TypeScript + 'n/no-unsupported-features/es-builtins': 'off', + // disable "n/no-unsupported-features/node-builtins" --> covered by TypeScript + 'n/no-unsupported-features/node-builtins': 'off', 'unicorn/filename-case': 'off', 'unicorn/no-negated-condition': 'off', 'unicorn/no-null': 'off', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b27dd5..97fb7cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ importers: devDependencies: '@pkerschbaum-homepage/config-eslint': specifier: workspace:* - version: link:platform/config-eslint + version: file:platform/config-eslint '@pkerschbaum-homepage/config-stylelint': specifier: workspace:* version: link:platform/config-stylelint @@ -40,6 +40,9 @@ importers: turbo: specifier: ^1.10.16 version: 1.10.16 + dependenciesMeta: + '@pkerschbaum-homepage/config-eslint': + injected: true apps/web: dependencies: @@ -164,9 +167,9 @@ importers: eslint-plugin-import: specifier: ^2.28.1 version: 2.28.1(@typescript-eslint/parser@6.8.0)(eslint@8.52.0) - eslint-plugin-node: - specifier: ^11.1.0 - version: 11.1.0(eslint@8.52.0) + eslint-plugin-n: + specifier: ^16.2.0 + version: 16.2.0(eslint@8.52.0) eslint-plugin-only-warn: specifier: ^1.1.0 version: 1.1.0 @@ -276,9 +279,9 @@ importers: eslint-plugin-import: specifier: ^2.28.1 version: 2.28.1(@typescript-eslint/parser@6.8.0)(eslint@8.52.0) - eslint-plugin-node: - specifier: ^11.1.0 - version: 11.1.0(eslint@8.52.0) + eslint-plugin-n: + specifier: ^16.2.0 + version: 16.2.0(eslint@8.52.0) eslint-plugin-only-warn: specifier: ^1.1.0 version: 1.1.0 @@ -2553,6 +2556,12 @@ packages: engines: {node: '>=6'} dev: true + /builtins@5.0.1: + resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} + dependencies: + semver: 7.5.4 + dev: true + /busboy@1.6.0: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} @@ -3243,15 +3252,15 @@ packages: resolution: {integrity: sha512-Vfsm4P8Xz/Na7TmOG5NwqresW1hSyZNdQDcR6yDodhn4ydbo884D9zqrcg4kbZ5z8OAE25m6sYNsB2qTvYVqVg==} dev: true - /eslint-plugin-es@3.0.1(eslint@8.52.0): - resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} - engines: {node: '>=8.10.0'} + /eslint-plugin-es-x@7.2.0(eslint@8.52.0): + resolution: {integrity: sha512-9dvv5CcvNjSJPqnS5uZkqb3xmbeqRLnvXKK7iI5+oK/yTusyc46zbBZKENGsOfojm/mKfszyZb+wNqNPAPeGXA==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - eslint: '>=4.19.1' + eslint: '>=8' dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@eslint-community/regexpp': 4.9.1 eslint: 8.52.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 dev: true /eslint-plugin-eslint-comments@3.2.0(eslint@8.52.0): @@ -3360,19 +3369,22 @@ packages: semver: 6.3.1 dev: true - /eslint-plugin-node@11.1.0(eslint@8.52.0): - resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} - engines: {node: '>=8.10.0'} + /eslint-plugin-n@16.2.0(eslint@8.52.0): + resolution: {integrity: sha512-AQER2jEyQOt1LG6JkGJCCIFotzmlcCZFur2wdKrp1JX2cNotC7Ae0BcD/4lLv3lUAArM9uNS8z/fsvXTd0L71g==} + engines: {node: '>=16.0.0'} peerDependencies: - eslint: '>=5.16.0' + eslint: '>=7.0.0' dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + builtins: 5.0.1 eslint: 8.52.0 - eslint-plugin-es: 3.0.1(eslint@8.52.0) - eslint-utils: 2.1.0 + eslint-plugin-es-x: 7.2.0(eslint@8.52.0) + get-tsconfig: 4.7.2 ignore: 5.2.4 + is-core-module: 2.13.1 minimatch: 3.1.2 resolve: 1.22.8 - semver: 6.3.1 + semver: 7.5.4 dev: true /eslint-plugin-only-warn@1.1.0: @@ -3462,18 +3474,6 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} - dependencies: - eslint-visitor-keys: 1.3.0 - dev: true - - /eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - dev: true - /eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5897,11 +5897,6 @@ packages: set-function-name: 2.0.1 dev: true - /regexpp@3.2.0: - resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} - engines: {node: '>=8'} - dev: true - /regexpu-core@5.3.2: resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} engines: {node: '>=4'} @@ -7252,3 +7247,13 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: false + + file:platform/config-eslint: + resolution: {directory: platform/config-eslint, type: directory} + name: '@pkerschbaum-homepage/config-eslint' + peerDependencies: + eslint-config-next: ^13 + peerDependenciesMeta: + eslint-config-next: + optional: true + dev: true