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

lint: fix deprecation warnings #8423

Closed
wants to merge 2 commits into from
Closed

Conversation

paul-marechal
Copy link
Member

@paul-marechal paul-marechal commented Aug 24, 2020

Signed-off-by: Paul Maréchal paul.marechal@ericsson.com

I went with the shotgun approach where I followed each warning as well as its suggested fix and tried to apply it everywhere possible. Some places I wasn't so sure if the modification would impact behavior, so I left it as is.

A lot of the changes had to do with deprecation warnings from mocha, about strict equality checks.

Fixes #8422

This PR has 2 commits:

  1. remove --verbose option from build command (unclutter build output)
  2. fix as much deprecation warnings as I could, and remove deprecated apis pre-1.4.0

How to test

  • yarn should build and lint without warnings.
  • yarn test should pass.
  • browser/electron example apps should show normal behavior.

Review checklist

Reminder for reviewers

@paul-marechal paul-marechal force-pushed the mp/fix-deprecations branch 2 times, most recently from b1d4fd2 to fd87982 Compare August 24, 2020 20:50
@vince-fugnitto vince-fugnitto added the quality issues related to code and application quality label Aug 24, 2020
@akosyakov
Copy link
Member

We should remove deprecated APIs which were deprecated before last release.

@paul-marechal
Copy link
Member Author

@akosyakov is there a place where I can see which needs to be removed?

Build output is cleaner without the verbose option. It was added in
order to get better feedback while building, but it turned out to just
clutter the terminal.

Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>
@paul-marechal paul-marechal force-pushed the mp/fix-deprecations branch 3 times, most recently from dacc2b2 to f8d4b16 Compare August 25, 2020 18:03
@paul-marechal paul-marechal force-pushed the mp/fix-deprecations branch 2 times, most recently from 45f2db6 to bade3b4 Compare August 26, 2020 13:55
Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I reviewed the code and provided my comments offline for which @marechal-p already amended.
I think others should take a look as well if they find the time.

@vince-fugnitto vince-fugnitto added the linting issues related to linting label Aug 26, 2020
@@ -261,6 +255,7 @@ export class KeybindingRegistry {
containsKeybindingInScope(binding: Keybinding, scope = KeybindingScope.USER): boolean {
const bindingKeySequence = this.resolveKeybinding(binding);
const collisions = this.getKeySequenceCollisions(this.keymaps[scope], bindingKeySequence)
// eslint-disable-next-line deprecation/deprecation
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need such comments? If there are still usages of deprecated APIs. We still should see it rather than hide.

Copy link
Member Author

@paul-marechal paul-marechal Aug 27, 2020

Choose a reason for hiding this comment

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

It's build noise, and using such comments is actually an act of handling it. If we want to get a list of suppressed deprecations we can still search for deprecation/deprecation. The alternative would be to get rid of the deprecated API indeed, but here I simply had to suppress the warning to say "this is expected".

The line you attached your comment to handles an old API. I didn't know enough about this API to remove it, but if you tell me that we really don't want to keep supporting context then let's remove it.

Copy link
Member

@akosyakov akosyakov Aug 28, 2020

Choose a reason for hiding this comment

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

I am fine with build noise if it is valid noise, let's remove comments to see usage of deprecated APIs.

Copy link
Member

Choose a reason for hiding this comment

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

Alternatively we should remove warnings completely from the build, but make sure that deprecation usages are highlighted as errors in the editor.

Copy link
Member Author

Choose a reason for hiding this comment

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

The warnings should help when writing new code and having to decide what to do with said warning: Change the code or suppress because we must handle the deprecated but not yet removed API?

It is possible to remove the eslint-disable comments and only have the warnings show in the editor, but it adds complexity to the repo setup. And I think it is much easier to do like what is done in this PR, without losing anything.

Copy link
Member Author

Choose a reason for hiding this comment

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

Regarding the code you highlighted, is it safe to remove this context attribute and only keep when on keybindings?

@kittaakos kittaakos removed their request for review September 11, 2020 13:05
@paul-marechal
Copy link
Member Author

Need to find a better way to do this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linting issues related to linting quality issues related to code and application quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lint: lot of eslint warnings (deprecations)
3 participants