From 15cf3e62fbed992ef9befb9d125bd0f19d61c20b Mon Sep 17 00:00:00 2001 From: nodkz Date: Mon, 8 Jun 2020 11:45:33 +0600 Subject: [PATCH] fix: skip files and dirs started from dot (eg .eslintrc.js) --- src/__tests__/__testSchema__/query/.eslintrc.js | 3 +++ src/directoryToAst.ts | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 src/__tests__/__testSchema__/query/.eslintrc.js diff --git a/src/__tests__/__testSchema__/query/.eslintrc.js b/src/__tests__/__testSchema__/query/.eslintrc.js new file mode 100644 index 0000000..1dfac1d --- /dev/null +++ b/src/__tests__/__testSchema__/query/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: '../../../../.eslintrc', +}; diff --git a/src/directoryToAst.ts b/src/directoryToAst.ts index 16035b6..f35e811 100644 --- a/src/directoryToAst.ts +++ b/src/directoryToAst.ts @@ -199,6 +199,11 @@ function checkInclusion( return false; } + // Skip dir/files started from dot + if (/^\..*/i.test(filename)) { + return false; + } + if (kind === 'file') { if ( // Verify file has valid extension