From 65d16a58c0def3aea88edeb88c812347c5d1551f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 17 Feb 2022 12:01:24 +0000 Subject: [PATCH] chore: reverse target/from in eslint rule (#3280) --- .eslintrc | 58 +++++++++++++++++++-------------- packages/nuxt3/src/core/nuxt.ts | 3 ++ 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/.eslintrc b/.eslintrc index 402223851a..ae8c279b6a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,7 +3,9 @@ "NodeJS": true, "$fetch": true }, - "plugins": ["jsdoc"], + "plugins": [ + "jsdoc" + ], "extends": [ "plugin:jsdoc/recommended", "@nuxtjs/eslint-config-typescript", @@ -17,30 +19,36 @@ "jsdoc/require-param": "off", "jsdoc/require-returns": "off", "jsdoc/require-param-type": "off", - "import/no-restricted-paths": ["error", { - "zones": [ - { - "target": "packages/nuxt3/src/!(core)/**/*", - "from": "packages/nuxt3/src/core", - "message": "core should not directly import from modules." - }, - { - "target": "packages/nuxt3/src/!(app)/**/*", - "from": "packages/nuxt3/src/app", - "message": "app should not directly import from modules." - }, - { - "target": "packages/nitro", - "from": "packages/!(nitro)/**/*", - "message": "nitro should not directly import other packages." - } - ] - }], - "@typescript-eslint/no-unused-vars": ["error", { - "argsIgnorePattern": "^_", - "varsIgnorePattern": "^_", - "ignoreRestSiblings": true - }] + "import/no-restricted-paths": [ + "error", + { + "zones": [ + { + "from": "packages/nuxt3/src/!(core)/**/*", + "target": "packages/nuxt3/src/core", + "message": "core should not directly import from modules." + }, + { + "from": "packages/nuxt3/src/!(app)/**/*", + "target": "packages/nuxt3/src/app", + "message": "app should not directly import from modules." + }, + { + "from": "packages/nitro", + "target": "packages/!(nitro)/**/*", + "message": "nitro should not directly import other packages." + } + ] + } + ], + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "ignoreRestSiblings": true + } + ] }, "settings": { "jsdoc": { diff --git a/packages/nuxt3/src/core/nuxt.ts b/packages/nuxt3/src/core/nuxt.ts index dc014e9e9f..a98a0e3acc 100644 --- a/packages/nuxt3/src/core/nuxt.ts +++ b/packages/nuxt3/src/core/nuxt.ts @@ -2,10 +2,13 @@ import { resolve } from 'pathe' import { createHooks } from 'hookable' import type { Nuxt, NuxtOptions, NuxtConfig, ModuleContainer, NuxtHooks } from '@nuxt/schema' import { loadNuxtConfig, LoadNuxtOptions, nuxtCtx, installModule, addComponent, addVitePlugin, addWebpackPlugin } from '@nuxt/kit' +// Temporary until finding better placement +/* eslint-disable import/no-restricted-paths */ import pagesModule from '../pages/module' import metaModule from '../meta/module' import componentsModule from '../components/module' import autoImportsModule from '../auto-imports/module' +/* eslint-enable */ import { distDir, pkgDir } from '../dirs' import { version } from '../../package.json' import { ImportProtectionPlugin, vueAppPatterns } from './plugins/import-protection'