Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 7ddec93

Browse files
committed
make sure every type of config file is considered before applying defaults
1 parent c49028d commit 7ddec93

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/extensions/default/ESLint/domain.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020
var ignorePath;
2121

2222
if (projectRoot) {
23-
configPath = projectRoot + '.eslintrc';
2423
try {
25-
if (fs.statSync(configPath).isFile()) {
26-
noop();
24+
var dirContent = fs.readdirSync(projectRoot);
25+
dirContent = dirContent.filter(function (entry) {
26+
return entry.match(/^\.eslintrc(\.(js|yaml|yml|json))?$/);
27+
});
28+
if (dirContent.length === 0) {
29+
throw new Error('no config file found!');
2730
}
2831
} catch (e) {
2932
// config file not found, use default

0 commit comments

Comments
 (0)