diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..d9ec7523 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,22 @@ +const base = require('@umijs/fabric/dist/eslint'); + +module.exports = { + ...base, + rules: { + ...base.rules, + 'react/sort-comp': 0, + 'react/no-array-index-key': 0, + 'react/no-access-state-in-setstate': 0, + 'no-plusplus': 0, + 'no-param-reassign': 0, + 'react/require-default-props': 0, + 'react/require-default-props': 0, + 'no-underscore-dangle': 0, + 'react/no-find-dom-node': 0, + 'no-mixed-operators': 0, + 'prefer-destructuring': 0, + 'react/no-unused-prop-types': 0, + 'max-len': 0, + 'brace-style': 0, + }, +}; diff --git a/.fatherrc.js b/.fatherrc.js new file mode 100644 index 00000000..81cd0147 --- /dev/null +++ b/.fatherrc.js @@ -0,0 +1,8 @@ +export default { + cjs: "babel", + esm: { type: "babel", importLibToEs: true }, + preCommit: { + eslint: true, + prettier: true + } +}; diff --git a/.gitignore b/.gitignore index 7ff37080..7cd61296 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.storybook *.iml *.log *.log.* diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..84d393d1 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,14 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100, + "proseWrap": "never", + "overrides": [ + { + "files": ".prettierrc", + "options": { + "parser": "json" + } + } + ] +} diff --git a/.travis.yml b/.travis.yml index 8d424325..b50415fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ notifications: - hust2012jiangkai@gmail.com node_js: -- 6.0.0 +- 10 before_install: - | @@ -30,11 +30,6 @@ env: - TEST_TYPE=lint - TEST_TYPE=test - TEST_TYPE=coverage - - TEST_TYPE=saucelabs global: - secure: S1VwbaPzLnSH/IUT/wlJulxAX5VHRIDmSt53h/ycHcZsszUpWcLCJRQAe0fTVB2dAx5MdBbSZ+o+tr3tRwVB5TRAYm0oTCsYAkOZaWOB28RuUQtdGt3wf9xxTG1UiPiaLLUW3waX9zAaf3yqKBcJGf1op0RD8dksxbCFw/7xVbU= - secure: EBEDg8k///IlEsnx0AE8X3mbFl0QE5+xGKbG4AxXlGZda12uTIPUSMKJzdZQ2hVbZXduTzf1cQl9rcu9nGoSnkL/DWnIax9cvHi+1orx5+YPlxPHNWAwWByTnHosBn2MJhfy1s5paJfHC9cUzmmEL6x4fYthWxjsPUo+irEZH6E= - -matrix: - allow_failures: - - env: "TEST_TYPE=saucelabs" diff --git a/examples/activeKey.html b/examples/activeKey.html deleted file mode 100755 index b3a42524..00000000 --- a/examples/activeKey.html +++ /dev/null @@ -1 +0,0 @@ -placeholder \ No newline at end of file diff --git a/examples/activeKey.js b/examples/activeKey.js index cc93c853..424fe9ca 100755 --- a/examples/activeKey.js +++ b/examples/activeKey.js @@ -1,13 +1,16 @@ -/* eslint react/no-multi-comp:0, no-console:0, react/prop-types:0 */ -import 'rc-tabs/assets/index.less'; +/* eslint-disable no-console,react/button-has-type */ +import '../assets/index.less'; import React from 'react'; -import ReactDOM from 'react-dom'; -import Tabs, { TabPane } from 'rc-tabs'; -import TabContent from 'rc-tabs/lib/SwipeableTabContent'; -import ScrollableInkTabBar from 'rc-tabs/lib/ScrollableInkTabBar'; +import Tabs, { TabPane } from '../src'; +import TabContent from '../src/SwipeableTabContent'; +import ScrollableInkTabBar from '../src/ScrollableInkTabBar'; const PanelContent = ({ id }) => ( -
{id}
)}{id}
+ ))} +{content}
; - }); + const content = new Array(Math.round(100 * Math.random()) + 4).join(` ${this.props.id}`); + const els = count.map((c, i) =>{content}
); return+ const count = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; // new Array(4) skip forEach .... + const els = count.map((c, i) => ( +
current: {this.state.tabKey}
{this.props.id}
; - }); + const count = [1, 1, 1, 1]; // new Array(4) skip forEach .... + const els = count.map((c, i) =>{this.props.id}
); return{content}
; - }); + const content = new Array(Math.round(100 * Math.random()) + 4).join(` ${this.props.id}`); + const els = count.map((c, i) =>{content}
); return