@next/eslint-plugin-next
Advanced tools
Comparing version 9.5.4-canary.20 to 9.5.4-canary.21
@@ -20,7 +20,14 @@ const path = require('path') | ||
create: function (context) { | ||
const [pagesDirectory] = context.options | ||
const pagesDir = pagesDirectory || path.join(context.getCwd(), 'pages') | ||
if (!fs.existsSync(pagesDir)) { | ||
const [customPagesDirectory] = context.options | ||
const pagesDirs = customPagesDirectory | ||
? [customPagesDirectory] | ||
: [ | ||
path.join(context.getCwd(), 'pages'), | ||
path.join(context.getCwd(), 'src', 'pages'), | ||
] | ||
const pagesDir = pagesDirs.find((dir) => fs.existsSync(dir)) | ||
if (!pagesDir) { | ||
throw new Error( | ||
`Pages directory cannot be found at ${pagesDir}, if using a custom path, please configure with the no-html-link-for-pages rule` | ||
`Pages directory cannot be found at ${pagesDirs.join(' or ')}. ` + | ||
`If using a custom path, please configure with the no-html-link-for-pages rule` | ||
) | ||
@@ -27,0 +34,0 @@ } |
{ | ||
"name": "@next/eslint-plugin-next", | ||
"version": "9.5.4-canary.20", | ||
"version": "9.5.4-canary.21", | ||
"description": "ESLint plugin for NextJS.", | ||
@@ -11,3 +11,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "63fee0f30c0215614fde1ef7f2f0a18eff8ed0e4" | ||
"gitHead": "47b7e0b318f853c2dee9abbf401630773e8f24b9" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12928
380