We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
checkPaths
1 parent bdbd214 commit 23c42f2Copy full SHA for 23c42f2
plugin/pluginCore.js
@@ -2,7 +2,7 @@ const { extname } = require('path')
2
3
const pa11y = require('pa11y');
4
const readdirp = require('readdirp')
5
-const { isDirectory } = require('path-type')
+const { isDirectory, isFile } = require('path-type')
6
7
exports.runPa11y = async function({ htmlFilePaths, testMode, debugMode }) {
8
let results = await Promise.all(htmlFilePaths.map(pa11y));
@@ -43,6 +43,11 @@ const findHtmlFiles = async function(fileAndDirPath) {
43
return fileInfos.map(({ fullPath }) => fullPath)
44
}
45
46
+ if (!(await isFile(fileAndDirPath))) {
47
+ console.warn(`Input "checkPaths" does not exist: ${fileAndDirPath}`)
48
+ return []
49
+ }
50
+
51
if (extname(fileAndDirPath) !== '.html') {
52
return []
53
0 commit comments