Skip to content

Commit e48717a

Browse files
Ensure ESLint actually runs (#1572) (#2455)
In project mode, ESLint succeeds without doing anything when called without any files, so pass it the current directory.
1 parent b6bee18 commit e48717a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
1313
- Medias
1414

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

1720
- Core
1821

megalinter/linters/EslintLinter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ def build_lint_command(self, file=None):
1212
cmd = super().build_lint_command(file)
1313
if "--ignore-path" in cmd or "--ignore-pattern" in cmd:
1414
cmd = list(filter(lambda a: a != "--no-ignore", cmd))
15+
if self.cli_lint_mode == "project":
16+
cmd.append(".")
1517
return cmd

0 commit comments

Comments
 (0)