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

chore(package): Add ts-lint for typings #1156

Merged
merged 14 commits into from
Jan 17, 2017
Merged

chore(package): Add ts-lint for typings #1156

merged 14 commits into from
Jan 17, 2017

Conversation

layershifter
Copy link
Member

When I was working on #1155, I realized that the need to add linter for typings.
This PR adds tslint for its.

@codecov-io
Copy link

codecov-io commented Jan 13, 2017

Current coverage is 95.88% (diff: 100%)

Merging #1156 into master will not change coverage

@@             master      #1156   diff @@
==========================================
  Files           879        879          
  Lines          4882       4882          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           4681       4681          
  Misses          201        201          
  Partials          0          0          

Powered by Codecov. Last update ff68268...41f1dee

Copy link
Member

@levithomason levithomason left a comment

Choose a reason for hiding this comment

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

Awesome, I was really wanting to get this done! Thanks much 👍 One change request.

"tsd": "cpx './src/**/*.d.ts' dist/commonjs"
"tsd": "cpx './src/**/*.d.ts' dist/commonjs",
"tsd:lint": "tslint './src/**/*.d.ts'",
"tsd:lint:fix": "npm run tsd:lint -- --fix"
Copy link
Member

Choose a reason for hiding this comment

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

Let's silence the extra NPM error blocks this would produce on a failure:

-npm run tsd:lint -- --fix
+npm run -s tsd:lint -- --fix

@@ -47,7 +47,7 @@ export interface InputProps {
label?: any;

/** A Label can appear outside an Input on the left or right. */
labelPosition?: 'left', 'right', 'left corner', 'right corner';
labelPosition?: 'left' | 'right' | 'left corner' | 'right corner';
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed type definition.

@@ -58,7 +58,7 @@ export interface InputProps {
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and proposed value.
*/
onChange?: (e: React.SyntheticEvent<HTMLInputElement>, {...InputProps, value: string}) => void;
onChange?: (event: React.SyntheticEvent<HTMLInputElement>, data: onChangeData) => void;
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed type definition.

@layershifter
Copy link
Member Author

Rebased to master, fixed conficticts.

@levithomason
Copy link
Member

I just fixed the new conflicts after merging the other ts PRs. Will merge this on pass.

@layershifter
Copy link
Member Author

I'll fix lint issues immediately.

…React into chore/ts-lint

# Conflicts:
#	src/elements/Container/index.d.ts
#	src/elements/Divider/index.d.ts
#	src/elements/Header/index.d.ts
#	src/elements/Icon/index.d.ts
@layershifter
Copy link
Member Author

I'll solve merge conflicts, too 😄

…React into chore/ts-lint

# Conflicts:
#	src/elements/Flag/index.d.ts
#	src/elements/Image/index.d.ts
#	src/modules/Checkbox/index.d.ts
@layershifter
Copy link
Member Author

Okay, we can try to merge after tests pass 👍

@levithomason
Copy link
Member

Thanks much, will do. I'll make a release following as well.

@levithomason levithomason merged commit 99a9cf8 into master Jan 17, 2017
@levithomason levithomason deleted the chore/ts-lint branch January 17, 2017 20:11
@levithomason
Copy link
Member

Released in [email protected].

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.

3 participants