diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 55058e0a..2558bb75 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -6,7 +6,7 @@ module.exports = defineConfig({ root: true, extends: [ 'eslint:recommended', - 'plugin:node/recommended', + 'plugin:n/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/stylistic', 'plugin:regexp/recommended', @@ -21,7 +21,6 @@ module.exports = defineConfig({ eqeqeq: ['warn', 'always', { null: 'never' }], 'no-debugger': ['error'], 'no-empty': ['warn', { allowEmptyCatch: true }], - 'no-process-exit': 'off', 'no-useless-escape': 'off', 'prefer-const': [ 'warn', @@ -30,14 +29,15 @@ module.exports = defineConfig({ }, ], - 'node/no-missing-import': [ + 'n/no-process-exit': 'off', + 'n/no-missing-import': [ 'error', { allowModules: ['types', 'estree', 'less', 'sass', 'stylus'], tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'], }, ], - 'node/no-missing-require': [ + 'n/no-missing-require': [ 'error', { // for try-catching yarn pnp @@ -45,22 +45,22 @@ module.exports = defineConfig({ tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'], }, ], - 'node/no-extraneous-import': [ + 'n/no-extraneous-import': [ 'error', { allowModules: ['vite', 'less', 'sass', 'vitest'], }, ], - 'node/no-extraneous-require': [ + 'n/no-extraneous-require': [ 'error', { allowModules: ['vite'], }, ], - 'node/no-deprecated-api': 'off', - 'node/no-unpublished-import': 'off', - 'node/no-unpublished-require': 'off', - 'node/no-unsupported-features/es-syntax': 'off', + 'n/no-deprecated-api': 'off', + 'n/no-unpublished-import': 'off', + 'n/no-unpublished-require': 'off', + 'n/no-unsupported-features/es-syntax': 'off', '@typescript-eslint/ban-ts-comment': 'off', // TODO: we should turn this on in a new PR '@typescript-eslint/ban-types': 'off', // TODO: we should turn this on in a new PR @@ -119,32 +119,32 @@ module.exports = defineConfig({ { files: ['*.spec.ts'], rules: { - 'node/no-extraneous-import': 'off', + 'n/no-extraneous-import': 'off', }, }, { files: ['**/build.config.ts'], rules: { 'no-undef': 'off', - 'node/no-missing-import': 'off', + 'n/no-missing-import': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', }, }, { files: ['playground/**'], rules: { - 'node/no-extraneous-import': 'off', - 'node/no-extraneous-require': 'off', - 'node/no-missing-import': 'off', - 'node/no-missing-require': 'off', + 'n/no-extraneous-import': 'off', + 'n/no-extraneous-require': 'off', + 'n/no-missing-import': 'off', + 'n/no-missing-require': 'off', // engine field doesn't exist in playgrounds - 'node/no-unsupported-features/es-builtins': [ + 'n/no-unsupported-features/es-builtins': [ 'error', { version: '^18.0.0 || >=20.0.0', }, ], - 'node/no-unsupported-features/node-builtins': [ + 'n/no-unsupported-features/node-builtins': [ 'error', { version: '^18.0.0 || >=20.0.0', diff --git a/package.json b/package.json index 1b6c1dc8..83f13919 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "eslint": "^8.57.0", "eslint-define-config": "^2.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-node": "^11.1.0", + "eslint-plugin-n": "^14.0.0", "eslint-plugin-regexp": "^2.3.0", "execa": "^8.0.1", "fast-glob": "^3.3.2", diff --git a/packages/plugin-vue-jsx/src/index.ts b/packages/plugin-vue-jsx/src/index.ts index f79ea502..2d2b82da 100644 --- a/packages/plugin-vue-jsx/src/index.ts +++ b/packages/plugin-vue-jsx/src/index.ts @@ -6,7 +6,7 @@ import jsx from '@vue/babel-plugin-jsx' import { createFilter, normalizePath } from 'vite' import type { ComponentOptions } from 'vue' import type { Plugin } from 'vite' -// eslint-disable-next-line node/no-extraneous-import +// eslint-disable-next-line n/no-extraneous-import import type { CallExpression, Identifier } from '@babel/types' import type { Options } from './types' diff --git a/packages/plugin-vue/src/handleHotUpdate.ts b/packages/plugin-vue/src/handleHotUpdate.ts index 2b15a4e9..6ccd0ad8 100644 --- a/packages/plugin-vue/src/handleHotUpdate.ts +++ b/packages/plugin-vue/src/handleHotUpdate.ts @@ -3,7 +3,7 @@ import type { SFCBlock, SFCDescriptor } from 'vue/compiler-sfc' import type { HmrContext, ModuleNode } from 'vite' import { isCSSRequest } from 'vite' -// eslint-disable-next-line node/no-extraneous-import +// eslint-disable-next-line n/no-extraneous-import import type * as t from '@babel/types' import { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4ae76ad9..3e88349f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,9 +53,9 @@ importers: eslint-plugin-import: specifier: ^2.29.1 version: 2.29.1(@typescript-eslint/parser@7.2.0)(eslint@8.57.0) - eslint-plugin-node: - specifier: ^11.1.0 - version: 11.1.0(eslint@8.57.0) + eslint-plugin-n: + specifier: ^14.0.0 + version: 14.0.0(eslint@8.57.0) eslint-plugin-regexp: specifier: ^2.3.0 version: 2.3.0(eslint@8.57.0) @@ -3821,8 +3821,8 @@ packages: - supports-color dev: true - /eslint-plugin-es@3.0.1(eslint@8.57.0): - resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} + /eslint-plugin-es@4.1.0(eslint@8.57.0): + resolution: {integrity: sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '>=4.19.1' @@ -3867,16 +3867,17 @@ packages: - supports-color dev: true - /eslint-plugin-node@11.1.0(eslint@8.57.0): - resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} - engines: {node: '>=8.10.0'} + /eslint-plugin-n@14.0.0(eslint@8.57.0): + resolution: {integrity: sha512-mNwplPLsbaKhHyA0fa/cy8j+oF6bF6l81hzBTWa6JOvPcMNAuIogk2ih6d9tYvWYzyUG+7ZFeChqbzdFpg2QrQ==} + engines: {node: '>=12.22.0'} peerDependencies: - eslint: '>=5.16.0' + eslint: '>=7.0.0' dependencies: eslint: 8.57.0 - eslint-plugin-es: 3.0.1(eslint@8.57.0) - eslint-utils: 2.1.0 + eslint-plugin-es: 4.1.0(eslint@8.57.0) + eslint-utils: 3.0.0(eslint@8.57.0) ignore: 5.3.0 + is-core-module: 2.13.1 minimatch: 3.1.2 resolve: 1.22.8 semver: 6.3.1 @@ -3913,11 +3914,26 @@ packages: eslint-visitor-keys: 1.3.0 dev: true + /eslint-utils@3.0.0(eslint@8.57.0): + resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} + engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} + peerDependencies: + eslint: '>=5' + dependencies: + eslint: 8.57.0 + eslint-visitor-keys: 2.1.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@2.1.0: + resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} + engines: {node: '>=10'} + 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}