Skip to content
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

Ensure ESLint actually runs in project mode (#1572) #2455

Merged
merged 1 commit into from Apr 4, 2023
Merged

Conversation

Kurt-von-Laven
Copy link
Collaborator

@Kurt-von-Laven Kurt-von-Laven commented Mar 12, 2023

Fixes #1572

In project mode, ESLint succeeds without doing anything when called without any files, so pass it the current directory.

Proposed Changes

  1. In EslintLinter.py, pass ESLint an extra . at the end of its command line when it is in project mode.

Readiness Checklist

Author/Contributor

  • Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

@Kurt-von-Laven Kurt-von-Laven added the bug Something isn't working label Mar 12, 2023
@Kurt-von-Laven Kurt-von-Laven self-assigned this Mar 12, 2023
@nvuillam
Copy link
Member

nvuillam commented Mar 12, 2023

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ BASH bash-exec 6 0 0.01s
✅ BASH shellcheck 6 0 0.16s
✅ BASH shfmt 6 0 0 0.43s
✅ COPYPASTE jscpd yes no 3.43s
✅ DOCKERFILE hadolint 116 0 18.82s
✅ JSON eslint-plugin-jsonc 21 0 0 2.61s
✅ JSON jsonlint 19 0 0.24s
✅ JSON v8r 21 0 15.46s
⚠️ MARKDOWN markdownlint 312 0 230 7.51s
✅ MARKDOWN markdown-link-check 312 0 5.83s
✅ MARKDOWN markdown-table-formatter 312 0 0 21.7s
✅ OPENAPI spectral 1 0 1.64s
⚠️ PYTHON bandit 185 54 2.51s
✅ PYTHON black 185 0 0 5.01s
✅ PYTHON flake8 185 0 2.33s
✅ PYTHON isort 185 0 0 0.91s
✅ PYTHON mypy 185 0 9.11s
✅ PYTHON pylint 185 0 13.69s
⚠️ PYTHON pyright 185 251 20.81s
✅ PYTHON ruff 185 0 0 0.49s
✅ REPOSITORY checkov yes no 39.19s
✅ REPOSITORY git_diff yes no 0.42s
✅ REPOSITORY secretlint yes no 15.63s
✅ REPOSITORY trivy yes no 37.45s
✅ SPELL cspell 753 0 29.16s
✅ SPELL misspell 572 0 0 1.06s
✅ XML xmllint 3 0 0 0.44s
✅ YAML prettier 81 0 0 4.2s
✅ YAML v8r 23 0 75.17s
✅ YAML yamllint 82 0 1.38s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@Kurt-von-Laven Kurt-von-Laven changed the title Ensure ESLint actually runs (#1572) Ensure ESLint actually runs in project mode (#1572) Mar 12, 2023
@nvuillam
Copy link
Member

nvuillam commented Mar 12, 2023

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ BASH bash-exec 6 0 0.01s
✅ BASH shellcheck 6 0 0.13s
✅ BASH shfmt 6 0 0 0.05s
✅ COPYPASTE jscpd yes no 2.8s
✅ DOCKERFILE hadolint 116 0 14.01s
✅ JSON eslint-plugin-jsonc 21 0 0 1.77s
✅ JSON jsonlint 19 0 0.17s
✅ JSON npm-package-json-lint yes no 0.66s
✅ JSON v8r 21 0 13.2s
⚠️ MARKDOWN markdownlint 312 2 230 5.83s
✅ MARKDOWN markdown-link-check 312 0 5.05s
✅ MARKDOWN markdown-table-formatter 312 2 0 15.55s
✅ OPENAPI spectral 1 0 1.33s
⚠️ PYTHON bandit 185 54 2.46s
✅ PYTHON black 185 0 0 3.3s
✅ PYTHON flake8 185 0 1.84s
✅ PYTHON isort 185 0 0 0.41s
✅ PYTHON mypy 185 0 6.95s
✅ PYTHON pylint 185 0 10.36s
⚠️ PYTHON pyright 185 251 15.4s
✅ PYTHON ruff 185 0 0 0.12s
✅ REPOSITORY checkov yes no 29.89s
⚠️ REPOSITORY devskim yes 61 1.23s
✅ REPOSITORY dustilock yes no 1.18s
✅ REPOSITORY git_diff yes no 0.08s
✅ REPOSITORY secretlint yes no 7.49s
✅ REPOSITORY syft yes no 0.93s
✅ REPOSITORY trivy yes no 21.53s
✅ SPELL cspell 753 0 17.74s
✅ SPELL misspell 572 2 0 0.43s
✅ XML xmllint 3 0 0 0.03s
✅ YAML prettier 81 0 0 2.36s
✅ YAML v8r 23 0 65.39s
✅ YAML yamllint 82 0 1.17s

See detailed report in MegaLinter reports

You could have same capabilities but better runtime performances if you request a new MegaLinter flavor.

MegaLinter is graciously provided by OX Security

In project mode, ESLint succeeds without doing anything when called
without any files, so pass it the current directory.
@Kurt-von-Laven
Copy link
Collaborator Author

@nvuillam, please let me know if you have any feedback on this one.

@nvuillam
Copy link
Member

nvuillam commented Apr 4, 2023

Are you sure eslint needs a folder when in project mode ?
If yes, ok :)

Copy link
Member

@nvuillam nvuillam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch :)

@Kurt-von-Laven
Copy link
Collaborator Author

Kurt-von-Laven commented Apr 4, 2023

Yeah, I ran it via npx to confirm that the directory was needed. It seems like a bug that it silently succeeds without any file paths.

@nvuillam nvuillam merged commit e48717a into main Apr 4, 2023
123 checks passed
@nvuillam nvuillam deleted the eslint branch April 4, 2023 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue in TYPESCRIPT-ES when using mega-lint-runner
2 participants