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

TYPESCRIPT_STANDARD seems to use the vanilla js-standard instead of their recommended ts-standard, causing false positives etc #2736

Closed
janderssonse opened this issue Jun 10, 2023 · 7 comments
Labels
bug Something isn't working O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity

Comments

@janderssonse
Copy link
Contributor

Describe the bug
When enablling standard linter with typescript, megalinter seems to use the vanilla js(standard) flavour instead of their ts-standard flavour. This will work partially but have bugs for TS-linting, like false positives for no-unused-vars and other rules.

To Reproduce
Have a look in the https://standardjs.com/index.html#typescript which recommends the ts-standard, and then in the megalinter docker image which installs standard https://github.com/oxsecurity/megalinter/blob/f27a593354d8787fe2b130fe292f87a55c964088/linters/typescript_standard/Dockerfile#LL90C6-L90C6

For real life test of one these errors with megalinter, create a ts-project, an enum and use the enum variables in other imported classes. Lint with TYPESCRIPT_STANDARD, some things will work but you will get linting errors, as standard can't handle these /ts-standard can).

Expected behavior
When enabling TYPESCRIPT_STANDARD ts-standard will be used.

@janderssonse janderssonse added the bug Something isn't working label Jun 10, 2023
@nvuillam
Copy link
Member

It probably changed since the creation of MegaLinter :)

Would you like to make the upgrade PR ?

It's probably just cli_executable to force to ts-standard in Typescript descriptor :)

@janderssonse
Copy link
Contributor Author

janderssonse commented Jun 14, 2023

Yes, standard created a sublinter-project for the TS-variant due to the differences since then, https://github.com/standard/ts-standard. . So, started looking at it. it will have to be treated as a new linter basically (as that what it really is TYPESCRIPT_TS_STANDARD should be the natural convention for that take.

@janderssonse
Copy link
Contributor Author

Alrigthee, I had a go, see the pr. Should be a start at least!:)

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jul 15, 2023
@nvuillam
Copy link
Member

@janderssonse can we close the issue now ts-standard is here ? :)

@github-actions github-actions bot removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jul 25, 2023
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 25, 2023
@nvuillam
Copy link
Member

Plz reopen the issue if you think it deserves to be :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity
Projects
None yet
Development

No branches or pull requests

2 participants