Skip to content

Commit

Permalink
Ensure ESLint actually runs (#1572)
Browse files Browse the repository at this point in the history
In project mode, ESLint succeeds without doing anything when called
without any files, so pass it the current directory.
  • Loading branch information
Kurt-von-Laven committed Mar 12, 2023
1 parent 2e47237 commit 7cf8ab2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Add build date in Beta docker images, by @nvuillam
- Correct misleading error message in **GitlabCommentReporter.py**, see [#2420](https://github.com/oxsecurity/megalinter/issues/2420)
- Fix **GitlabCommentReporter** wrong variables names, check [#2423](https://github.com/oxsecurity/megalinter/issues/2423)
- Ensure ESLint actually runs in project mode rather than silently do nothing, by @Kurt-von-Laven [#2455](https://github.com/oxsecurity/megalinter/pull/2455).

- Core
- Improve config test, by @bdovaz in <https://github.com/oxsecurity/megalinter/pull/2426>
Expand Down
2 changes: 2 additions & 0 deletions megalinter/linters/EslintLinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ def build_lint_command(self, file=None):
cmd = super().build_lint_command(file)
if "--ignore-path" in cmd or "--ignore-pattern" in cmd:
cmd = list(filter(lambda a: a != "--no-ignore", cmd))
if self.cli_lint_mode == "project":
cmd.append(".")
return cmd

0 comments on commit 7cf8ab2

Please sign in to comment.