Skip to content

Commit

Permalink
Ensure ESLint actually runs (#1572) (#2455)
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 Apr 4, 2023
1 parent b6bee18 commit e48717a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,9 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Medias

- Linter enhancements & fixes
- Ensure ESLint actually runs in project mode rather than silently doing
nothing, by @Kurt-von-Laven
[#2455](https://github.com/oxsecurity/megalinter/pull/2455).

- Core

Expand Down
2 changes: 2 additions & 0 deletions megalinter/linters/EslintLinter.py
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 e48717a

Please sign in to comment.