Skip to content

Commit

Permalink
update tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Oct 20, 2016
1 parent 3112b0d commit c2d3f16
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/auto-complete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, any
[`${prefixCls}-show-search`]: true,
});

const options = children || (dataSource ? dataSource.map((item, index) => {
const options = children || (dataSource ? dataSource.map((item) => {
switch (typeof item) {
case 'string':
return <Option key={item}>{item}</Option>;
Expand Down
6 changes: 3 additions & 3 deletions components/breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface BreadcrumbProps {
style?: React.CSSProperties;
};

function getBreadcrumbName(route, params, routes) {
function getBreadcrumbName(route, params) {
if (!route.breadcrumbName) {
return null;
}
Expand All @@ -32,7 +32,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
separator: '/',
itemRender: (route, params, routes, paths) => {
const isLastItem = routes.indexOf(route) === routes.length - 1;
const name = getBreadcrumbName(route, params, routes);
const name = getBreadcrumbName(route, params);
return isLastItem
? <span>{name}</span>
: <a href={`#/${paths.join('/')}`}>{name}</a>;
Expand Down Expand Up @@ -65,7 +65,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
const { separator, prefixCls, routes, params, children, itemRender } = this.props;
if (routes && routes.length > 0) {
const paths = [];
crumbs = routes.map((route, i) => {
crumbs = routes.map((route) => {
route.path = route.path || '';
let path = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => {
Expand Down
2 changes: 1 addition & 1 deletion components/date-picker/createPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function createPicker(TheCalendar) {
let calendarHandler: Object = {
onOk: this.handleChange,
// fix https://github.com/ant-design/ant-design/issues/1902
onSelect: (value, cause) => {
onSelect: (value) => {
if (!('value' in this.props)) {
this.setState({ value });
}
Expand Down
6 changes: 3 additions & 3 deletions components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ export default class Table extends React.Component<TableProps, any> {
})));
}

renderSelectionRadio = (value, record, index) => {
renderSelectionRadio = (_value, record, index) => {
let rowIndex = this.getRecordKey(record, index); // 从 1 开始
const props = this.getCheckboxPropsByItem(record);
let checked;
Expand All @@ -537,7 +537,7 @@ export default class Table extends React.Component<TableProps, any> {
);
}

renderSelectionCheckBox = (value, record, index) => {
renderSelectionCheckBox = (_value, record, index) => {
let rowIndex = this.getRecordKey(record, index); // 从 1 开始
let checked;
if (this.state.selectionDirty) {
Expand Down Expand Up @@ -803,7 +803,7 @@ export default class Table extends React.Component<TableProps, any> {
// 当数据量少于等于每页数量时,直接设置数据
// 否则进行读取分页数据
if (data.length > pageSize || pageSize === Number.MAX_VALUE) {
data = data.filter((item, i) => {
data = data.filter((_item, i) => {
return i >= (current - 1) * pageSize && i < current * pageSize;
});
}
Expand Down
2 changes: 1 addition & 1 deletion components/tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class Tag extends React.Component<TagProps, any> {
});
}

animationEnd = (key, existed) => {
animationEnd = (_key, existed) => {
if (!existed && !this.state.closed) {
this.setState({
closed: true,
Expand Down
2 changes: 1 addition & 1 deletion components/upload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default class Upload extends React.Component<UploadProps, any> {
}
}

autoUpdateProgress(percent, file) {
autoUpdateProgress(_percent, file) {
const getPercent = genPercentAdd();
let curPercent = 0;
this.progressTimer = setInterval(() => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@
"start": "bisheng start -c ./site/bisheng.config.js --no-livereload",
"site": "bisheng build -c ./site/bisheng.config.js",
"deploy": "npm run clean && bisheng gh-pages -c ./site/bisheng.config.js",
"lint": "npm run tslint && tsc && npm run srclint && npm run demolint && npm run lesshint",
"lint": "npm run tslint && npm run srclint && npm run demolint && npm run lesshint",
"srclint": "RUN_ENV=SRC eslint test site scripts ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx,.tsx' --ignore-pattern '!.eslintrc.js'",
"tslint": "antd-tools run ts-lint",
"tslint": "antd-tools run ts-lint && npm run compile && rm -rf lib",
"demolint": "RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md'",
"lesshint": "lesshint components -r scripts/lesshint-report.js",
"eslint-fix": "eslint --fix test site scripts ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx,.tsx' --ignore-pattern '!.eslintrc.js' && eslint-tinker ./components/*/demo/*.md",
Expand Down

0 comments on commit c2d3f16

Please sign in to comment.