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
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ machine:
test:
pre:
- npm run lint
- npm run tsd:lint
post:
- bash <(curl -s https://codecov.io/bash)
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"pretest": "npm run build:dll",
"test": "cross-env NODE_ENV=test karma start",
"test:watch": "npm run test --silent -- --watch",
"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

},
"repository": {
"type": "git",
Expand Down Expand Up @@ -72,8 +74,8 @@
"chai-enzyme": "^0.6.1",
"connect-history-api-fallback": "^1.2.0",
"copy-to-clipboard": "^3.0.5",
"cross-env": "^3.1.4",
"cpx": "^1.5.0",
"cross-env": "^3.1.4",
"css-loader": "^0.26.0",
"del": "^2.2.2",
"dirty-chai": "^1.2.2",
Expand Down Expand Up @@ -125,6 +127,9 @@
"style-loader": "^0.13.1",
"ta-scripts": "^2.5.2",
"through2": "^2.0.2",
"tslint": "^4.3.1",
"tslint-config-typings": "^0.3.1",
"typescript": "^2.1.5",
"watch": "^1.0.1",
"webpack": "^1.12.14",
"webpack-dev-middleware": "^1.5.1",
Expand Down
2 changes: 1 addition & 1 deletion src/addons/Confirm/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ interface ConfirmProps {
open?: boolean;
}

export const Confirm: React.ComponentClass<ConfirmProps>
export const Confirm: React.ComponentClass<ConfirmProps>;
6 changes: 2 additions & 4 deletions src/collections/Breadcrumb/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ReactMouseEvents, SemanticSIZES } from '../..';
import * as React from 'react';

interface BreadcrumbProps extends ReactMouseEvents<HTMLElement> {

/** An element type to render as (string or function). */
as?: any;

Expand All @@ -16,7 +15,8 @@ interface BreadcrumbProps extends ReactMouseEvents<HTMLElement> {
divider?: any;

/** For use with the sections prop. Render as an `Icon` component with `divider` class instead of a `div` in
* Breadcrumb.Divider. */
* Breadcrumb.Divider.
*/
icon?: any;

/** Shorthand array of props for Breadcrumb.Section. */
Expand All @@ -34,7 +34,6 @@ interface BreadcrumbClass extends React.ComponentClass<BreadcrumbProps> {
export const Breadcrumb: BreadcrumbClass;

interface BreadcrumbDividerProps {

/** An element type to render as (string or function). */
as?: any;

Expand All @@ -51,7 +50,6 @@ interface BreadcrumbDividerProps {
export const BreadcrumbDivider: React.ComponentClass<BreadcrumbDividerProps>;

interface BreadcrumbSectionProps {

/** Style as the currently active section. */
active?: boolean;

Expand Down
9 changes: 1 addition & 8 deletions src/collections/Form/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { DropdownProps } from '../../modules/Dropdown/index';


interface FormProps {
method?: 'get' | 'post'
method?: 'get' | 'post';

/** An element type to render as (string or function). */
as?: any;
Expand Down Expand Up @@ -72,7 +72,6 @@ interface FormClass extends React.ComponentClass<FormProps> {
export const Form: FormClass;

interface FormFieldProps {

/** An element type to render as (string or function). */
as?: any;

Expand Down Expand Up @@ -128,7 +127,6 @@ interface FormButtonProps extends ButtonProps {
export const FormButton: React.ComponentClass<FormButtonProps>;

interface FormCheckboxProps {

/** An element type to render as (string or function). */
as?: any;
control?: any;
Expand All @@ -141,7 +139,6 @@ interface FormCheckboxProps {
export const FormCheckbox: React.ComponentClass<FormCheckboxProps>;

interface FormDropdownProps extends DropdownProps {

/** An element type to render as (string or function). */
as?: any;

Expand All @@ -155,7 +152,6 @@ interface FormDropdownProps extends DropdownProps {
export const FormDropdown: React.ComponentClass<FormDropdownProps>;

interface FormGroupProps {

/** An element type to render as (string or function). */
as?: any;

Expand Down Expand Up @@ -183,7 +179,6 @@ interface FormInputProps extends InputProps, ReactFormEvents<HTMLInputElement>,
export const FormInput: React.ComponentClass<FormInputProps>;

interface FormRadioProps {

/** An element type to render as (string or function). */
as?: any;
checked?: boolean;
Expand All @@ -200,7 +195,6 @@ interface FormRadioProps {
export const FormRadio: React.ComponentClass<FormRadioProps>;

interface FormSelectProps extends ReactFormEvents<HTMLSelectElement>, ReactFocusEvents<HTMLSelectElement> {

/** An element type to render as (string or function). */
as?: any;

Expand All @@ -219,7 +213,6 @@ interface FormSelectProps extends ReactFormEvents<HTMLSelectElement>, ReactFocus
export const FormSelect: React.ComponentClass<FormSelectProps>;

export interface FormTextAreaProps extends ReactFormEvents<HTMLTextAreaElement>, ReactFocusEvents<HTMLTextAreaElement> {

/** An element type to render as (string or function). */
as?: any;

Expand Down
13 changes: 5 additions & 8 deletions src/collections/Grid/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import {
} from '../..';
import * as React from 'react';

export type GridPropReversed = 'computer' | 'computer vertically' | 'mobile' | 'mobile vertically' | 'tablet' | 'tablet vertically'
export type GridPropReversed = 'computer' | 'computer vertically' | 'mobile' | 'mobile vertically' | 'tablet' | 'tablet vertically';
export interface GridProps {

/** An element type to render as (string or function). */
as?: any;

Expand Down Expand Up @@ -43,7 +42,7 @@ export interface GridProps {

/** A grid can specify that its columns should reverse order at different device sizes. */
reversed?: GridPropReversed;

/** A grid can have its columns stack on-top of each other after reaching mobile breakpoints. */
stackable?: boolean;

Expand All @@ -64,9 +63,8 @@ interface GridClass extends React.ComponentClass<GridProps> {

export const Grid: GridClass;

type GridPropOnly = 'computer' | 'large screen' | 'mobile' | 'tablet mobile' | 'tablet' | 'widescreen'
type GridPropOnly = 'computer' | 'large screen' | 'mobile' | 'tablet mobile' | 'tablet' | 'widescreen';
interface GridColumnProps {

/** An element type to render as (string or function). */
as?: any;

Expand Down Expand Up @@ -99,7 +97,7 @@ interface GridColumnProps {

/** A column can specify a width for a tablet device. */
tablet?: SemanticWIDTHSNUMBER | SemanticWIDTHSSTRING| number;

/** A row can specify its text alignment. */
textAlign?: SemanticTEXTALIGNMENTS;

Expand All @@ -113,10 +111,9 @@ interface GridColumnProps {
width?: SemanticWIDTHSNUMBER | SemanticWIDTHSSTRING| number;
}

export const GridColumn: React.ComponentClass<GridColumnProps>
export const GridColumn: React.ComponentClass<GridColumnProps>;

interface GridRowProps {

/** An element type to render as (string or function). */
as?: any;

Expand Down
27 changes: 13 additions & 14 deletions src/collections/Menu/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
ReactMouseEvents,
SemanticCOLORS,
SemanticFLOATS,
SemanticSIZES,
SemanticWIDTHSNUMBER,
SemanticWIDTHSSTRING
ReactMouseEvents,
SemanticCOLORS,
SemanticFLOATS,
SemanticSIZES,
SemanticWIDTHSNUMBER,
SemanticWIDTHSSTRING
} from '../..';
import * as React from 'react';

Expand All @@ -15,7 +15,7 @@ export type MenuPropsAttached = 'bottom' | 'top';

export interface MenuProps {
activeIndex?: number;

/** An element type to render as (string or function). */
as?: any;

Expand Down Expand Up @@ -65,7 +65,7 @@ export interface MenuProps {
* @param {object} data - All item props.
*/
onItemClick?: React.MouseEventHandler<HTMLDivElement>;

/** A pagination menu is specially formatted to present links to pages of content. */
pagination?: boolean;

Expand All @@ -77,7 +77,7 @@ export interface MenuProps {

/** A menu can vary in size. */
size?: SemanticSIZES; // TODO - remove medium and big.

/** A menu can stack at mobile resolutions. */
stackable?: boolean;

Expand All @@ -103,9 +103,9 @@ interface MenuClass extends React.ComponentClass<MenuProps> {
export const Menu: MenuClass;

interface MenuHeaderProps {

/** An element type to render as (string or function). */
as?: any;
as?: any;

/** Primary content. */
children?: React.ReactNode;
Expand All @@ -123,7 +123,7 @@ interface MenuItemProps extends ReactMouseEvents<HTMLElement> {
active?: boolean;

/** An element type to render as (string or function). */
as?: any;
as?: any;

/** Primary content. */
children?: React.ReactNode;
Expand Down Expand Up @@ -161,9 +161,8 @@ interface MenuItemProps extends ReactMouseEvents<HTMLElement> {
export const MenuItem: React.ComponentClass<MenuItemProps>;

interface MenuMenuProps {

/** An element type to render as (string or function). */
as?: any;
as?: any;

/** Primary content. */
children?: React.ReactNode;
Expand Down
7 changes: 1 addition & 6 deletions src/collections/Message/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { SemanticCOLORS, SemanticSIZES } from '../..';
import * as React from 'react';

interface MessageProps {

/** An element type to render as (string or function). */
as?: any;

Expand Down Expand Up @@ -53,7 +52,7 @@ interface MessageProps {
* Called when the user clicks the "x" icon. This also adds the "x" icon.
*/
onDismiss?: React.MouseEventHandler<HTMLDivElement>;

/** A message may be formatted to display a positive message. Same as `success`. */
positive?: boolean;

Expand All @@ -80,7 +79,6 @@ interface MessageClass extends React.ComponentClass<MessageProps> {
export const Message: MessageClass;

interface MessageContentProps {

/** An element type to render as (string or function). */
as?: any;

Expand All @@ -94,7 +92,6 @@ interface MessageContentProps {
export const MessageContent: React.ComponentClass<MessageContentProps>;

interface MessageHeaderProps {

/** An element type to render as (string or function). */
as?: any;

Expand All @@ -108,7 +105,6 @@ interface MessageHeaderProps {
export const MessageHeader: React.ComponentClass<MessageHeaderProps>;

interface MessageListProps {

/** An element type to render as (string or function). */
as?: any;

Expand All @@ -125,7 +121,6 @@ interface MessageListProps {
export const MessageList: React.ComponentClass<MessageListProps>;

interface MessageItemProps {

/** An element type to render as (string or function). */
as?: any;

Expand Down
Loading