FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve linting by redallen · Pull Request #2787 · patternfly/patternfly-react · GitHub

Improve linting - #2787

Merged
mturley merged 5 commits into
patternfly:masterfrom
redallen:chore/formatting
Aug 30, 2019
Merged

Improve linting#2787
mturley merged 5 commits into
patternfly:masterfrom
redallen:chore/formatting

Conversation

redallen commented Aug 27, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

What:

  • Tweak tslint.json to be nicer
  • Fix autofixable errors using new tslint.json

Closes #2362

cc @mturley

Additional issues:

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://patternfly-react-pr-2787.surge.sh

redallen force-pushed the chore/formatting branch 2 times, most recently from d73cb41 to 3d246a8 Compare August 29, 2019 19:19
redallen changed the title Chore/formatting Improve linting Aug 29, 2019
mturley previously approved these changes Aug 30, 2019

mturley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Mostly this looks good, but there's still some weird indentation going on. I'll take a look at the config and come back to it. We can go ahead and merge now if you want, if so I'll address the indentation in another PR.

position: DropdownPosition.left,
onSelect: (_event: any): any => undefined,
onToggle: (_value: boolean): any => undefined,
"className": '',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is a bit weird, what rule added quotes to all of these defaultProps? I wonder why it didn't do the same to all the others?

isRead = false,
className = '',
children = '',
...props }: BadgeProps) => (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There's still some weird spacing going on here.

export interface CardHeaderProps extends React.HTMLProps<HTMLDivElement> {
/** Content rendered inside the Card Footer */
children?: React.ReactNode;
children?: React.ReactNode;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It's interesting that TSLint is ok with 4-space indentation here and 2-space indentation everywhere else. Maybe that's just something it can't automatically --fix?

}: ChipButtonProps) => {
return (
<Button variant="plain" aria-label={ariaLabel} onClick={onClick} className={className} {...props}>
{children}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hmm. Spacing here is still all messed up. I'll take a look at the config

mturley commented Aug 30, 2019

Copy link
Copy Markdown
Contributor

Yeah, weirdly enough we have "indent": [true, "spaces", 2], in the tslint.json, but tslint seems to be ignoring it.

yarn lint:ts | grep ChipButton
error Command failed with exit code 2.
ERROR: /Users/mturley/git/patternfly-react/packages/patternfly-4/react-core/src/components/ChipGroup/ChipButton.tsx:2:1 - Too many spaces after 'import'
ERROR: /Users/mturley/git/patternfly-react/packages/patternfly-4/react-core/src/components/ChipGroup/ChipButton.tsx:2:32 - Too many spaces before 'from'

mturley dismissed their stale review August 30, 2019 14:37

Some rules seem to be ignored

mturley commented Aug 30, 2019

Copy link
Copy Markdown
Contributor

Yikes. @redallen, this indent rule being broken is a bug that they just straight-up closed because TSLint is being deprecated. palantir/tslint#2814

Maybe that's reason enough to switch to tslint-plugin-prettier? at least until we switch to eslint

mturley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Approving, we'll fix these issues in the next one. Thanks @redallen!

mturley commented Aug 30, 2019

Copy link
Copy Markdown
Contributor

Merging this after discussion with @redallen and @dgutride 👍

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code style/formatting rules for TypeScript are not enforced by TSLint

6 participants


Back | FazBrowse Home | New Git URL