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 5 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 -s tsd:lint -- --fix"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -71,8 +73,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 @@ -124,6 +126,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
13 changes: 6 additions & 7 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 Down Expand Up @@ -161,7 +161,6 @@ interface MenuItemProps extends ReactMouseEvents<HTMLElement> {
export const MenuItem: React.ComponentClass<MenuItemProps>;

interface MenuMenuProps {

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

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
25 changes: 10 additions & 15 deletions src/collections/Table/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import * as React from 'react';

interface TableProps {

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

Expand All @@ -33,13 +32,13 @@ interface TableProps {

/** A table can be given a color to distinguish it from other tables. */
color?: SemanticCOLORS;

/** A table can specify its column count to divide its content evenly. */
columns?: SemanticWIDTHSNUMBER | SemanticWIDTHSSTRING | number;

/** A table may sometimes need to be more compact to make more rows visible at a time. */
compact?: boolean | 'very';

/** A table may be formatted to emphasize a first column that defines a rows content. */
definition?: boolean;

Expand All @@ -65,22 +64,22 @@ interface TableProps {
* to be placed within Table.Body.
*/
renderBodyRow?: ()=>void; // TODO - check;

/** A table can have its rows appear selectable. */
selectable?: boolean;

/** A table can specify that its cell contents should remain on a single line and not wrap. */
singleLine?: boolean;

/** A table can also be small or large. */
size?: SemanticSIZES;

/** A table can specify how it stacks table content responsively. */
stackable?: boolean;

/** A table can stripe alternate rows of content with a darker color to increase contrast. */
striped?: boolean;

/** A table can be formatted to display complex structured data. */
structured?: boolean;

Expand All @@ -103,7 +102,6 @@ interface TableClass extends React.ComponentClass<TableProps> {
export const Table: TableClass;

interface TableBodyProps {

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

Expand Down Expand Up @@ -150,10 +148,10 @@ interface TableCellProps {

/** A cell may let a user know whether a value is good. */
positive ?: boolean;

/** A cell can be selectable. */
selectable?: boolean;

/** A cell can specify that its contents should remain on a single line and not wrap. */
singleLine ?: boolean;

Expand All @@ -173,15 +171,13 @@ interface TableCellProps {
export const TableCell: React.ComponentClass<TableCellProps>;

interface TableFooterProps {

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

export const TableFooter: React.ComponentClass<TableFooterProps>;

interface TableHeaderProps {

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

Expand All @@ -198,7 +194,6 @@ interface TableHeaderProps {
export const TableHeader: React.ComponentClass<TableHeaderProps>;

interface TableHeaderCellProps {

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