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 rule for requiring ts-ignore descriptions #3584

Merged

Conversation

dimitropoulos
Copy link
Contributor

@dimitropoulos dimitropoulos commented Jun 10, 2020

Summary

closes #3580

This PR enables a lint rule that requires descriptions following ts-ignore usages. To accomplish this, some linting dependencies were also updated.

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in IE11 and Firefox
- [ ] Props have proper autodocs
- [ ] Added documentation
- [ ] Checked Code Sandbox works for the any docs examples
- [ ] Added or updated jest tests

  • Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
    - [ ] A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@dimitropoulos dimitropoulos changed the title Ts comment allow with description Lint rule for requiring ts-ignore descriptions Jun 10, 2020
this used to be required to get a behavior that has since been filpped to always work the 'as const' way, so this is no longer necessary (hence the lint rule complaining)
interface-name-prefix was replaced by naming-convention in @typescript-eslint v3
some simply just needed to be removed (mostly due to ignores for files that didn't used to have types but now do)
@dimitropoulos dimitropoulos force-pushed the ts-comment-allow-with-description branch from 129f290 to 98ea46b Compare June 10, 2020 01:50
@dimitropoulos dimitropoulos marked this pull request as ready for review June 10, 2020 01:57
@dimitropoulos
Copy link
Contributor Author

I was able to clean up the majority of them and although the lint rule is satisfied, I'd like someone from the EUI team to do at the remaining 35 instances that are missing any notation. I tried to tackle all of the most obvious ones (or ones I was already familiar with). You can quickly/easily find them by searching for @ts-ignore TODO: Needs Description.

After that we should be ready to merge.

@chandlerprall chandlerprall self-requested a review June 10, 2020 19:36
@chandlerprall
Copy link
Contributor

Created a PR for you dimitropoulos#1

@dimitropoulos
Copy link
Contributor Author

That's very diplomatic of you! haha. I wouldn't have minded if you just committed but I appreciate the consideration.

Merged and all ready to go now, then.

@chandlerprall
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3584/

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Changes LGTM; Looked through the comment annotations and tested this locally

@chandlerprall chandlerprall merged commit e0f79ff into elastic:master Jun 11, 2020
phyolim pushed a commit to phyolim/eui that referenced this pull request Jun 11, 2020
* upgrades @typescript-eslint plugin and parser (removes deprecated rules)

as well as runs prettier on .eslintrc.js

* turns off new (unwanted) rules

* only allows ts-ignore and ts-expect-error with descriptions

* tweaks for new @typescript-eslint version

* clears error for 'prefer-as-const' lint rule

this used to be required to get a behavior that has since been filpped to always work the 'as const' way, so this is no longer necessary (hence the lint rule complaining)

* removes disable for rule that no longer exists

interface-name-prefix was replaced by naming-convention in @typescript-eslint v3

* removes ts-ignore-next-line usages (that's not a thing)

* use  for sort Direction

* uses  for all ts-ignores that need it

* solves simplest ts-ignore cases

some simply just needed to be removed (mostly due to ignores for files that didn't used to have types but now do)

* Clean up ts-ignore todos

Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
@dimitropoulos dimitropoulos deleted the ts-comment-allow-with-description branch June 11, 2020 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consider using new allow-with-description options for ts-ignore and ts-expect-error
3 participants