Skip to content

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Oct 1, 2020

  • Removes every tslint override that (IMO) was bad except one
  • Adds a TODO for the unified-signatures override, because I felt addressing that would be a minefield of type changes.
  • fixes an issue with every that was uncovered by the removal of the prefer-const override, where we were not incrementing the index being passed to the predicate. Adds a test for that one.

Consequently, this change also removes all usage of Function, which I know @cartant hated passionately.

Other thoughts:

  • We should move to eslint soon.
  • Many of the linting issues were actually fixed during the refactor.
  • I couldn't get tslint to set up Array usage in a way that I personally agreed with, so that is still on
  • the variable-names bit is still on because it conflicts with the unused variables override of prefixing with an underscore.

Note that commits labelled as chore were mostly non-changes. Just deleting a rule or an irrelevant bit of code or test.

@benlesh benlesh requested a review from cartant October 1, 2020 19:40
Copy link
Collaborator

@cartant cartant left a comment

Choose a reason for hiding this comment

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

LGTM, but I'm pretty sure the changes to the jQuery signatures aren't quite right.

"max-classes-per-file": [true, 10],
"max-classes-per-file": [false, 1000],
// TODO: unified signatures not be disabled, but it will
// be a lot of work to verify the fixes don't mess something up.
"unified-signatures": [false],
Copy link
Collaborator

@cartant cartant Oct 2, 2020

Choose a reason for hiding this comment

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

thought: TBH, I don't agree with this rule anyway, so I'm happy to see it remain disabled. Sometimes separate signatures are clearer.

@@ -1,7 +1,7 @@
/** @prettier */
import { Subscription } from '../Subscription';

type AnimationFrameProvider = {
interface AnimationFrameProvider {
Copy link
Collaborator

Choose a reason for hiding this comment

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

thought: If this change from a type to an interface was effected by a lint rule, I would switch it off. Increasingly, types are able to due more and more. Personally, I would favour using interfaces only when they offer a feature that's not offered by a type. If it's a rule, I think it's a useless rule. Mostly because TypeScript has changed so much in the last few years.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm... for me this was about just homogenizing the approach. FWIW: I think if we're just defining an interface (like one for a provider) than it should probably be an interface. However, if we're defining some sort of argument type that could be more than one thing, or a function shape, then I guess I'd prefer a type. But I suppose it's all personal preference.

benlesh added 28 commits October 2, 2020 11:57
- Gets rid of `Function` and `Object` use throughout the project.
@benlesh benlesh force-pushed the refactor/fix-tslint-rules branch from 4db664b to cdd9f27 Compare October 2, 2020 16:59
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.

2 participants