Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

style(eslint): enable spaced-comment, @typescript-eslint/no-unused-vars #1261

Merged
merged 6 commits into from
May 2, 2019

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Apr 24, 2019

This PR enables following rules:

  • spaced-comment
  • @typescript-eslint/no-unused-vars

Please see #600 for more context.

@layershifter layershifter changed the title style(eslint): enable style(eslint): enable spaced-comment, @typescript-eslint/no-unused-vars & no-shadow Apr 24, 2019
@DustyTheBot
Copy link
Collaborator

Warnings
⚠️ There are no updates provided to CHANGELOG. Ensure there are no publicly visible changes introduced by this PR.

Generated by 🚫 dangerJS

Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

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

I don't agree with enabling no-shadow.
One of the purposes of scopes is to give you some level of encapsulation. Although it can sometimes lead to a better naming it often results in using misleading or artificial names and makes code more difficult to read.
One example:
image

}

private handleSelectedItemRemove(
e: React.SyntheticEvent,
item: ShorthandValue,
predefinedProps: DropdownSelectedItemProps,
DropdownSelectedItemProps: DropdownSelectedItemProps,
dropdownSelectedItemProps: DropdownSelectedItemProps,
Copy link
Member

Choose a reason for hiding this comment

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

👍

@layershifter
Copy link
Member Author

I don't agree with enabling no-shadow.

I can't agree with you there: yep, sometimes it will require changes in names, but in the most cases you will clearly understand what happens and it will save you from accidental bugs.

Actually, this case is noop and it will be removed in a future PR: https://github.com/stardust-ui/react/pull/1268/files#diff-ad7603568c43fa756c43f87b68b69161R82. However, if I will remove active (isActive) from the destruction the code will still work, but now it has completely different sense (active is still boolean, but comes from another scope).

@kuzhelov
Copy link
Contributor

kuzhelov commented May 2, 2019

speaking of no-shadow - I agree with both points expressed, however, I would rather vote for defer to introduce this lint rule for now.

The reason is because its value is not clearly seen at this moment. Ideally, I would want to see real issue (say, in app's logic) that this rule helps to prevent, before introducing it. Also, as a point towards deferring it is that it introduces some friction points in code, without clear value for our code seen at the moment

@layershifter layershifter changed the title style(eslint): enable spaced-comment, @typescript-eslint/no-unused-vars & no-shadow style(eslint): enable spaced-comment, @typescript-eslint/no-unused-vars May 2, 2019
@codecov
Copy link

codecov bot commented May 2, 2019

Codecov Report

Merging #1261 into master will not change coverage.
The diff coverage is 63.63%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1261   +/-   ##
=======================================
  Coverage   72.08%   72.08%           
=======================================
  Files         736      736           
  Lines        5627     5627           
  Branches     1646     1646           
=======================================
  Hits         4056     4056           
  Misses       1566     1566           
  Partials        5        5
Impacted Files Coverage Δ
...eact/src/lib/accessibility/FocusZone/FocusZone.tsx 87.36% <ø> (ø) ⬆️
...es/react/src/components/Popup/positioningHelper.ts 100% <ø> (ø) ⬆️
.../lib/accessibility/FocusHandling/FocusContainer.ts 100% <ø> (ø) ⬆️
...t/src/themes/teams/components/Label/labelStyles.ts 8.33% <ø> (ø) ⬆️
.../src/lib/accessibility/FocusZone/focusUtilities.ts 91.86% <ø> (ø) ⬆️
...hemes/teams/components/Divider/dividerVariables.ts 0% <ø> (ø) ⬆️
packages/react/src/components/Avatar/Avatar.tsx 100% <100%> (ø) ⬆️
...ackages/react/src/components/Dropdown/Dropdown.tsx 76.96% <33.33%> (ø) ⬆️
packages/react/src/components/Popup/Popup.tsx 68.29% <71.42%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f717dbc...2a1d8cd. Read the comment docs.

@layershifter layershifter merged commit ea53fb6 into master May 2, 2019
@delete-merged-branch delete-merged-branch bot deleted the chore/eslint-rules1 branch May 2, 2019 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants