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

Fix lint warnings #1093

Closed
mayurkale22 opened this issue May 21, 2020 · 13 comments
Closed

Fix lint warnings #1093

mayurkale22 opened this issue May 21, 2020 · 13 comments
Labels
contribfest These small and isolated issues are suitable for Kubecon Contribfest good first issue Good for newcomers never-stale up-for-grabs Good for taking. Extra help will be provided by maintainers

Comments

@mayurkale22
Copy link
Member

After #892 is merged, we see many warnings in the lint build. It would be nice if we can exclude or fix them.

The current lint logs looks very noisy and taking care of a new lint issue can be a daunting task in the future, especially for the new contributors.

Screenshot:
Screen Shot 2020-05-21 at 10 26 09 AM

Link: https://app.circleci.com/pipelines/github/open-telemetry/opentelemetry-js/3706/workflows/82bf0bf2-c125-4663-a3b7-2396167d09cd/jobs/20435/parallel-runs/0/steps/0-105

/cc @OlivierAlbertini

@mayurkale22 mayurkale22 added the up-for-grabs Good for taking. Extra help will be provided by maintainers label May 21, 2020
@rezakrimi
Copy link
Contributor

I see that most of them aren't really fixable (like use of any or not using all parameters when implementing interfaces). Is it okay to just make eslint to ignore certain rules on those parts of the code?

@mayurkale22
Copy link
Member Author

I see that most of them aren't really fixable (like use of any or not using all parameters when implementing interfaces). Is it okay to just make eslint to ignore certain rules on those parts of the code?

Sounds reasonable to me. @dyladan WDYT?

@dyladan
Copy link
Member

dyladan commented Jun 24, 2020

I think that's fine in many cases. A lot of these rules have configs that allow you to ignore cases where the linting rules commonly fail also so that might be worth looking into.

@dyladan
Copy link
Member

dyladan commented Jun 24, 2020

The other option is to use the --silent option when running lint, which ignores warnings. The advantage of this over marking it as ignored is that it will still highlight issues in your editor, which can help you catch common mistakes. Think this might be a case-by-case decision type of task.

@rezakrimi
Copy link
Contributor

We can make eslint ignore specific rules as well. For instance, we can disable no-unused-vars rule like this:

/* eslint-disable @typescript-eslint/no-unused-vars */
... code that violates rule ...
/* eslint-enable @typescript-eslint/no-unused-vars */

This way we can still catch errors using the linter, even in the ignored section.

@AndrewGrachov
Copy link
Contributor

AndrewGrachov commented Aug 28, 2020

Regarding unused vars:

Actually, there are a lot of code which mocks real one, like NoopExporter and so on. These params are needed to not break consistency between components,
There could be a convention to omit such parameters, like prefixing them with underscore

https://eslint.org/docs/rules/no-unused-vars#argsignorepattern

@AndrewGrachov
Copy link
Contributor

have time to fix that

@svetlanabrennan
Copy link
Contributor

Should this issue remain open if the above prs fixed some lint warnings?

I do see about 65 lint warning (as of today) when I run it in main. Should we consider fixing those or are we accepting those lint warnings?

@legendecas
Copy link
Member

I think it is still valuable to fix the warnings.

@mannyistyping
Copy link

@dyladan 👋🏽 I am curious, will this issue remain forever-opened?

Running the lint script I see no issues/warnings popping up
Screen Shot 2023-07-12 at 10 48 26 PM

@legendecas
Copy link
Member

Lint warnings are not emitted when running with lerna. You can run lerna run --verbose lint to find all the warnings.

@mannyistyping
Copy link

Thank you for that guidance! I look forward to helping to reduce those warnings :)

@dyladan dyladan added the contribfest These small and isolated issues are suitable for Kubecon Contribfest label Nov 8, 2023
@dyladan
Copy link
Member

dyladan commented Nov 8, 2023

Closing in favor of #4258

@dyladan dyladan closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribfest These small and isolated issues are suitable for Kubecon Contribfest good first issue Good for newcomers never-stale up-for-grabs Good for taking. Extra help will be provided by maintainers
Projects
None yet
Development

No branches or pull requests

7 participants