diff --git a/index.js b/index.js index 36e7441..55a343e 100644 --- a/index.js +++ b/index.js @@ -35,8 +35,7 @@ async function fileExists(filePath) { } const defaultFilesToCheck = [ - '.editorconfig', - '.gitattributes' + '.editorconfig' ]; async function isGitRepo(directoryPath) { @@ -53,6 +52,9 @@ async function checkDirectoryFiles(directoryPath) { const isJavascriptDirectory = await hasPackageJson(directoryPath); if (isJavascriptDirectory) filesToCheck.push('.eslintrc.json'); + const isDirectoryGitRepo = await isGitRepo(directoryPath); + if (isDirectoryGitRepo) filesToCheck.push('.gitignore', '.gitattributes'); + for (const fileToCheck of filesToCheck) { const filePath = path.join(directoryPath, fileToCheck); const currentFileExists = await fileExists(filePath);