style: update code style to please lint

This commit is contained in:
Benjy Cui 2016-02-29 14:34:51 +08:00
parent fc86a4164d
commit 2830764a37
5 changed files with 11 additions and 12 deletions

View File

@ -136,10 +136,10 @@
"deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy",
"just-deploy": "npm run site && node scripts/deploy.js",
"lint": "npm run srclint && npm run mdlint && npm run lesshint",
"srclint": "eslint components test index.js --ext '.js,.jsx'",
"srclint": "eslint components test site index.js --ext '.js,.jsx'",
"mdlint": "eslint components/*/demo/*.md --ext '.md' --global 'React,ReactDOM,mountNode' --rule 'no-console: 0, eol-last: 0, prefer-rest-params: 0'",
"lesshint": "lesshint style/ -e 'style/+(core|mixins)/+(base|iconfont|normalize|layouts|compatibility|grid).less'",
"eslint-fix": "eslint --fix components test index.js --ext '.js,.jsx' && eslint-tinker ./components/*/demo/*.md",
"eslint-fix": "eslint --fix components test site index.js --ext '.js,.jsx' && eslint-tinker ./components/*/demo/*.md",
"test": "npm run lint && webpack && npm run jest",
"jest": "jest",
"pub": "sh ./scripts/publish.sh",

View File

@ -2,7 +2,7 @@ import '../../style/index.less';
import './styles/tomorrow.less';
import './styles/common.less';
import './styles/markdown.less';
import './styles/toc.less'
import './styles/toc.less';
import './styles/font.less';
import './styles/resource.less';
import './styles/clearfix.less';

View File

@ -9,7 +9,7 @@ export default class Article extends React.Component {
}).map((node) => {
return <li key={node.children}><a href={`#${node.children}`}>{ node.children }</a></li>;
});
console.log(content.description);
return (
<article className="markdown">
<h1>{ content.meta.title }</h1>

View File

@ -1,5 +1,4 @@
import React from 'react';
import { Link } from 'react-router';
import { Collapse } from '../../../';
import * as utils from '../utils';
import hljs from 'highlight.js';

View File

@ -1,13 +1,13 @@
import React from 'react';
import { Route, Link } from 'react-router';
import { Link } from 'react-router';
import { Row, Col, Menu } from '../../../';
import componentsList from '../../../_site/data/components-list';
export default class ReactComponents extends React.Component {
render() {
const componentMenuItems = [];
['基本', '表单', '展示', '导航', '其它'].forEach((key) => {
const grandChildren = componentsList[key].map((item) => {
['基本', '表单', '展示', '导航', '其它'].forEach((category) => {
const grandChildren = componentsList[category].map((item) => {
const key = item.english.toLowerCase();
return (
<Menu.Item key={key}>
@ -17,7 +17,7 @@ export default class ReactComponents extends React.Component {
});
componentMenuItems.push(
<Menu.ItemGroup title={key} key={key} mode="vertical">
<Menu.ItemGroup title={category} key={category} mode="vertical">
{ grandChildren }
</Menu.ItemGroup>
);