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

Support eslint #55

Closed
massongit opened this issue Sep 27, 2021 · 3 comments
Closed

Support eslint #55

massongit opened this issue Sep 27, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@massongit
Copy link

I think supporting eslint as well as shellcheck makes it easier to inspect code written using actions/github-script.

@rhysd rhysd added the enhancement New feature or request label Oct 1, 2021
@rhysd
Copy link
Owner

rhysd commented Oct 1, 2021

Thanks for the suggestion.

The idea that providing a check for actions/github-script basically makes sense to me. However I think there are some challenges if we adopt eslint.

  • eslint is not globally installed usually. It is installed as dependency of local project and usually not installed in $PATH directory. actionlint cannot know where the eslint command exists. And asking non-JS users to install eslint globally only for actionlint is hard.
  • eslint usually requires a config file eslintrc otherwise eslint checks nothing. User needs to write up their configuration. It's hard to write up and maintain eslint config only for checking GitHub Actions workflows (especially for non-JS people).
  • eslint is not designed for linting a small code snippet. It is designed for linting (possibly large) JavaScript project. I think the design does not fit to actionlint's usage. Many code style checks are not useful for small snippets and some false positives would be reported (for example, github-script defines github variable implicitly).

For above reasons, I think it's hard to support github-script linting with eslint.

@massongit
Copy link
Author

I understand that it is difficult to support eslint and actions/github-script.
I close this issue.

@nomeata
Copy link

nomeata commented Dec 14, 2023

Would it be possible to support this with implicitly wrapping the body in the right function declaration, roughly like in https://github.com/actions/github-script#use-scripts-with-jsdoc-support?

Having some kind of syntax and ideally type checking locally would avoid so many problems I had :-]

Maybe using the type script compiler instead of eslint if that's more suitable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants