Unverified Commit a7f0332b authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

Skip pagesDirRules when pagesDir is not present (#41075)

Follow up for #40132

Do not apply pages lint rule `@next/next/no-html-link-for-pages` for
appDir
parent fd6c9079
...@@ -154,7 +154,6 @@ async function lint( ...@@ -154,7 +154,6 @@ async function lint(
let nextEslintPluginIsEnabled = false let nextEslintPluginIsEnabled = false
const nextRulesEnabled = new Map<string, Severity>() const nextRulesEnabled = new Map<string, Severity>()
const pagesDirRules = ['@next/next/no-html-link-for-pages']
for (const configFile of [eslintrcFile, pkgJsonPath]) { for (const configFile of [eslintrcFile, pkgJsonPath]) {
if (!configFile) continue if (!configFile) continue
...@@ -187,6 +186,7 @@ async function lint( ...@@ -187,6 +186,7 @@ async function lint(
} }
const pagesDir = findPagesDir(baseDir, hasAppDir).pages const pagesDir = findPagesDir(baseDir, hasAppDir).pages
const pagesDirRules = pagesDir ? ['@next/next/no-html-link-for-pages'] : []
if (nextEslintPluginIsEnabled) { if (nextEslintPluginIsEnabled) {
let updatedPagesDir = false let updatedPagesDir = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment