mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
style: update code style to please lint
This commit is contained in:
parent
fc86a4164d
commit
2830764a37
@ -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",
|
||||
|
@ -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';
|
||||
|
@ -9,13 +9,13 @@ 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>
|
||||
{
|
||||
jumper.length > 0 ?
|
||||
<section className="toc"><ul>{ jumper }</ul></section> :
|
||||
<section className="toc"><ul>{ jumper }</ul></section> :
|
||||
null
|
||||
}
|
||||
{ content.description.map(utils.objectToComponent) }
|
||||
|
@ -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';
|
||||
@ -24,7 +23,7 @@ export default class Demo extends React.Component {
|
||||
<pre>
|
||||
<code className="javascript" dangerouslySetInnerHTML={{
|
||||
__html: highlightedCode,
|
||||
}} />
|
||||
}} />
|
||||
</pre>
|
||||
</div>
|
||||
</Collapse.Panel>
|
||||
|
@ -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>
|
||||
);
|
||||
@ -27,7 +27,7 @@ export default class ReactComponents extends React.Component {
|
||||
<Row className="main-wrapper">
|
||||
<Col span="4">
|
||||
<Menu className="sidebar" mode="inline"
|
||||
defaultOpenKeys={['components']}>
|
||||
defaultOpenKeys={['components']}>
|
||||
<Menu.Item key="introduce">
|
||||
<Link to="/components/introduce">Ant Design of React</Link>
|
||||
</Menu.Item>
|
||||
|
Loading…
Reference in New Issue
Block a user