Skip to content

Conversation

@redallen
Copy link
Contributor

@redallen redallen commented Aug 27, 2019

What:

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

Closes #2362

cc @mturley

Additional issues:

@patternfly-build
Copy link
Collaborator

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

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

@mturley mturley left a comment

Choose a reason for hiding this comment

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

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
Collaborator

Choose a reason for hiding this comment

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

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
Collaborator

Choose a reason for hiding this comment

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

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
Collaborator

Choose a reason for hiding this comment

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

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
Collaborator

Choose a reason for hiding this comment

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

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

@mturley
Copy link
Collaborator

mturley commented Aug 30, 2019

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 mturley dismissed their stale review August 30, 2019 14:37

Some rules seem to be ignored

@mturley
Copy link
Collaborator

mturley commented Aug 30, 2019

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

Copy link
Collaborator

@mturley mturley left a comment

Choose a reason for hiding this comment

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

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

@mturley
Copy link
Collaborator

mturley commented Aug 30, 2019

Merging this after discussion with @redallen and @dgutride 👍

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