chore: reverse target/from in eslint rule (#3280)

This commit is contained in:
Daniel Roe 2022-02-17 12:01:24 +00:00 committed by GitHub
parent 467ab693b9
commit 65d16a58c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 25 deletions

View File

@ -3,7 +3,9 @@
"NodeJS": true, "NodeJS": true,
"$fetch": true "$fetch": true
}, },
"plugins": ["jsdoc"], "plugins": [
"jsdoc"
],
"extends": [ "extends": [
"plugin:jsdoc/recommended", "plugin:jsdoc/recommended",
"@nuxtjs/eslint-config-typescript", "@nuxtjs/eslint-config-typescript",
@ -17,30 +19,36 @@
"jsdoc/require-param": "off", "jsdoc/require-param": "off",
"jsdoc/require-returns": "off", "jsdoc/require-returns": "off",
"jsdoc/require-param-type": "off", "jsdoc/require-param-type": "off",
"import/no-restricted-paths": ["error", { "import/no-restricted-paths": [
"zones": [ "error",
{ {
"target": "packages/nuxt3/src/!(core)/**/*", "zones": [
"from": "packages/nuxt3/src/core", {
"message": "core should not directly import from modules." "from": "packages/nuxt3/src/!(core)/**/*",
}, "target": "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." "from": "packages/nuxt3/src/!(app)/**/*",
}, "target": "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." "from": "packages/nitro",
} "target": "packages/!(nitro)/**/*",
] "message": "nitro should not directly import other packages."
}], }
"@typescript-eslint/no-unused-vars": ["error", { ]
"argsIgnorePattern": "^_", }
"varsIgnorePattern": "^_", ],
"ignoreRestSiblings": true "@typescript-eslint/no-unused-vars": [
}] "error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
]
}, },
"settings": { "settings": {
"jsdoc": { "jsdoc": {

View File

@ -2,10 +2,13 @@ import { resolve } from 'pathe'
import { createHooks } from 'hookable' import { createHooks } from 'hookable'
import type { Nuxt, NuxtOptions, NuxtConfig, ModuleContainer, NuxtHooks } from '@nuxt/schema' import type { Nuxt, NuxtOptions, NuxtConfig, ModuleContainer, NuxtHooks } from '@nuxt/schema'
import { loadNuxtConfig, LoadNuxtOptions, nuxtCtx, installModule, addComponent, addVitePlugin, addWebpackPlugin } from '@nuxt/kit' 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 pagesModule from '../pages/module'
import metaModule from '../meta/module' import metaModule from '../meta/module'
import componentsModule from '../components/module' import componentsModule from '../components/module'
import autoImportsModule from '../auto-imports/module' import autoImportsModule from '../auto-imports/module'
/* eslint-enable */
import { distDir, pkgDir } from '../dirs' import { distDir, pkgDir } from '../dirs'
import { version } from '../../package.json' import { version } from '../../package.json'
import { ImportProtectionPlugin, vueAppPatterns } from './plugins/import-protection' import { ImportProtectionPlugin, vueAppPatterns } from './plugins/import-protection'