-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: ensure config files are files #42
Conversation
Hi @tjenkinson!, thanks for the Pull Request The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
Read more about contributing to ESLint here |
@nzakas @mdjermanovic please could someone click the button to run the workflow? |
Locally I'm getting
even on 'main' when trying to run the tests |
Hi @tjenkinson!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
Read more about contributing to ESLint here |
299adf7
to
20ebd85
Compare
@@ -495,7 +495,7 @@ class ConfigArrayFactory { | |||
basePath | |||
); | |||
|
|||
if (fs.existsSync(ctx.filePath)) { | |||
if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a similar check is done here:
#44 should fix the test failure |
Hi @tjenkinson!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
Read more about contributing to ESLint here |
Currently if a directory name matches a config file it will be treated as a file and then fail later when we try and read it.
19ae64b
to
4c77284
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, I can reproduce this bug with directories named package.json
, .eslintrc
etc.
The change LGTM, thanks!
no longer needed since eslint/eslintrc#42 and eslint/eslint#14808
no longer needed since eslint/eslintrc#42 and eslint/eslint#14808
Currently if a directory name matches a config file it will be treated as a file and then fail later when we try and read it.
This is causing an error for us in a fixture where we have a directory called "package.json".
Refs rollup/plugins#927