update tslint

This commit is contained in:
yiminghe 2016-10-20 19:19:16 +08:00
parent 3112b0d7ca
commit c2d3f16dfb
7 changed files with 12 additions and 12 deletions

View File

@ -56,7 +56,7 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, any
[`${prefixCls}-show-search`]: true, [`${prefixCls}-show-search`]: true,
}); });
const options = children || (dataSource ? dataSource.map((item, index) => { const options = children || (dataSource ? dataSource.map((item) => {
switch (typeof item) { switch (typeof item) {
case 'string': case 'string':
return <Option key={item}>{item}</Option>; return <Option key={item}>{item}</Option>;

View File

@ -12,7 +12,7 @@ export interface BreadcrumbProps {
style?: React.CSSProperties; style?: React.CSSProperties;
}; };
function getBreadcrumbName(route, params, routes) { function getBreadcrumbName(route, params) {
if (!route.breadcrumbName) { if (!route.breadcrumbName) {
return null; return null;
} }
@ -32,7 +32,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
separator: '/', separator: '/',
itemRender: (route, params, routes, paths) => { itemRender: (route, params, routes, paths) => {
const isLastItem = routes.indexOf(route) === routes.length - 1; const isLastItem = routes.indexOf(route) === routes.length - 1;
const name = getBreadcrumbName(route, params, routes); const name = getBreadcrumbName(route, params);
return isLastItem return isLastItem
? <span>{name}</span> ? <span>{name}</span>
: <a href={`#/${paths.join('/')}`}>{name}</a>; : <a href={`#/${paths.join('/')}`}>{name}</a>;
@ -65,7 +65,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
const { separator, prefixCls, routes, params, children, itemRender } = this.props; const { separator, prefixCls, routes, params, children, itemRender } = this.props;
if (routes && routes.length > 0) { if (routes && routes.length > 0) {
const paths = []; const paths = [];
crumbs = routes.map((route, i) => { crumbs = routes.map((route) => {
route.path = route.path || ''; route.path = route.path || '';
let path = route.path.replace(/^\//, ''); let path = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => { Object.keys(params).forEach(key => {

View File

@ -72,7 +72,7 @@ export default function createPicker(TheCalendar) {
let calendarHandler: Object = { let calendarHandler: Object = {
onOk: this.handleChange, onOk: this.handleChange,
// fix https://github.com/ant-design/ant-design/issues/1902 // fix https://github.com/ant-design/ant-design/issues/1902
onSelect: (value, cause) => { onSelect: (value) => {
if (!('value' in this.props)) { if (!('value' in this.props)) {
this.setState({ value }); this.setState({ value });
} }

View File

@ -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 开始 let rowIndex = this.getRecordKey(record, index); // 从 1 开始
const props = this.getCheckboxPropsByItem(record); const props = this.getCheckboxPropsByItem(record);
let checked; let checked;
@ -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 rowIndex = this.getRecordKey(record, index); // 从 1 开始
let checked; let checked;
if (this.state.selectionDirty) { if (this.state.selectionDirty) {
@ -803,7 +803,7 @@ export default class Table extends React.Component<TableProps, any> {
// 当数据量少于等于每页数量时,直接设置数据 // 当数据量少于等于每页数量时,直接设置数据
// 否则进行读取分页数据 // 否则进行读取分页数据
if (data.length > pageSize || pageSize === Number.MAX_VALUE) { 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; return i >= (current - 1) * pageSize && i < current * pageSize;
}); });
} }

View File

@ -49,7 +49,7 @@ export default class Tag extends React.Component<TagProps, any> {
}); });
} }
animationEnd = (key, existed) => { animationEnd = (_key, existed) => {
if (!existed && !this.state.closed) { if (!existed && !this.state.closed) {
this.setState({ this.setState({
closed: true, closed: true,

View File

@ -120,7 +120,7 @@ export default class Upload extends React.Component<UploadProps, any> {
} }
} }
autoUpdateProgress(percent, file) { autoUpdateProgress(_percent, file) {
const getPercent = genPercentAdd(); const getPercent = genPercentAdd();
let curPercent = 0; let curPercent = 0;
this.progressTimer = setInterval(() => { this.progressTimer = setInterval(() => {

View File

@ -137,9 +137,9 @@
"start": "bisheng start -c ./site/bisheng.config.js --no-livereload", "start": "bisheng start -c ./site/bisheng.config.js --no-livereload",
"site": "bisheng build -c ./site/bisheng.config.js", "site": "bisheng build -c ./site/bisheng.config.js",
"deploy": "npm run clean && bisheng gh-pages -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'", "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'", "demolint": "RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md'",
"lesshint": "lesshint components -r scripts/lesshint-report.js", "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", "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",