forked from rsuite/rsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
6,390 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"presets": ["stage-0", "react", "es2015"] | ||
"presets": [ | ||
"stage-0", | ||
"react", | ||
"es2015" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
'use strict'; | ||
|
||
const OFF = 0; | ||
const WARNING = 1; | ||
const ERROR = 2; | ||
|
||
module.exports = { | ||
'extends': 'airbnb', | ||
'env': { | ||
'browser': true, | ||
'es6': true, | ||
'mocha': true | ||
}, | ||
'parser': 'babel-eslint', | ||
'plugins': [ | ||
'react', | ||
'babel' | ||
], | ||
'parserOptions': { | ||
'ecmaVersion': 6, | ||
'sourceType': 'module', | ||
'ecmaFeatures': { | ||
'jsx': true, | ||
'experimentalObjectRestSpread': true | ||
} | ||
}, | ||
'rules': { | ||
'indent': [ERROR, 2, { 'SwitchCase': 1 }], //规定代码的缩进方式:2个空格 | ||
'camelcase': ERROR, //强制驼峰法命名 | ||
'curly': ERROR, //必须使用 if(){} 中的{} | ||
'eqeqeq': ERROR, //必须使用全等 | ||
'brace-style': [ERROR, '1tbs'], //大括号风格 | ||
'quotes': [ERROR, 'single'], //引号类型 | ||
'semi': [ERROR, 'always'], //语句强制分号结尾 | ||
'space-infix-ops': ERROR, //中缀操作符周围要不要有空格 | ||
'no-param-reassign': OFF, //不允许对函数的形参进行赋值 | ||
'prefer-spread': ERROR, //首选展开运算 | ||
'comma-dangle': OFF, //不允许或强制在对象字面量或者数组属性的结尾使用逗号 | ||
'padded-blocks': OFF, //规定代码块前后是否要加空行 | ||
'prefer-const': OFF, | ||
'no-multi-spaces': ERROR, | ||
'no-var': OFF, | ||
'one-var': OFF, | ||
/** | ||
* https://github.com/airbnb/javascript/tree/master/react | ||
*/ | ||
'react/prefer-es6-class': [WARNING, 'always'], //使用 class extends React.Component | ||
'react/jsx-pascal-case': ERROR, //骆驼式命名 | ||
'react/jsx-closing-bracket-location': ERROR, //JSX语法缩进/格式 | ||
'react/jsx-curly-spacing': ERROR, //JSX {} 引用括号里两边加空格 | ||
'react/jsx-boolean-value': [ERROR, 'always'], //如果属性值为 true, 可以直接省略 | ||
'jsx-quotes': [ERROR, 'prefer-double'], //JSX属性值总是使用双引号(") | ||
'react/no-string-refs': ERROR, //Refs里使用回调函数 | ||
'react/jsx-wrap-multilines': ERROR, //多行的JSX标签写在 ()里 | ||
'react/self-closing-comp': ERROR, //没有子元素的标签来说总是自己关闭标签 | ||
'react/jsx-no-bind': ERROR, //当在 render() 里使用事件处理方法时,提前在构造函数里把 this 绑定上去 | ||
'react/no-is-mounted': ERROR, //不要再使用 isMounted | ||
'jsx-a11y/href-no-hash': OFF | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,3 @@ docs/assets | |
|
||
# custom | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
var webpackConfig = { | ||
output: { | ||
pathinfo: true | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
loaders: [ | ||
'babel?babelrc' | ||
], | ||
exclude: /node_modules/ | ||
}] | ||
}, | ||
devtool: 'eval' | ||
output: { | ||
pathinfo: true | ||
}, | ||
module: { | ||
rules: [{ | ||
test: /\.jsx?$/, | ||
use: [ | ||
'babel-loader' | ||
], | ||
exclude: /node_modules/ | ||
}] | ||
}, | ||
devtool: 'eval' | ||
}; | ||
|
||
module.exports = function (config) { | ||
const { env } = process; | ||
config.set({ | ||
basePath: '', | ||
files: ['test/index.js'], | ||
frameworks: [ | ||
'mocha', | ||
'sinon-chai' | ||
], | ||
colors: true, | ||
reporters: ['mocha'], | ||
const { env } = process; | ||
config.set({ | ||
basePath: '', | ||
files: ['test/index.js'], | ||
frameworks: [ | ||
'mocha', | ||
'sinon-chai' | ||
], | ||
colors: true, | ||
reporters: ['mocha'], | ||
|
||
logLevel: config.LOG_INFO, | ||
preprocessors: { | ||
'test/index.js': ['webpack'], | ||
}, | ||
webpack: webpackConfig, | ||
webpackMiddleware: { | ||
noInfo: true | ||
}, | ||
browsers: env.BROWSER ? env.BROWSER.split(',') : ['Chrome'], | ||
customLaunchers: { | ||
ChromeCi: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'], | ||
}, | ||
} | ||
}); | ||
logLevel: config.LOG_INFO, | ||
preprocessors: { | ||
'test/index.js': ['webpack'], | ||
}, | ||
webpack: webpackConfig, | ||
webpackMiddleware: { | ||
noInfo: true | ||
}, | ||
browsers: env.BROWSER ? env.BROWSER.split(',') : ['Chrome'], | ||
customLaunchers: { | ||
ChromeCi: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'], | ||
}, | ||
} | ||
}); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "rsuite", | ||
"version": "1.0.11", | ||
"version": "2.0.0", | ||
"description": "A suite of react components", | ||
"main": "lib/index.js", | ||
"directories": { | ||
|
@@ -9,13 +9,13 @@ | |
"scripts": { | ||
"build": "babel-node tools/build.js", | ||
"tdd": "karma start", | ||
"lint": "eslint src *.js", | ||
"lint": "eslint src *.js*", | ||
"test": "npm run lint && karma start --single-run" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"suite", | ||
"rsuite", | ||
"component", | ||
"react-component" | ||
], | ||
"author": "Simon Guo <[email protected]>", | ||
|
@@ -30,8 +30,9 @@ | |
], | ||
"dependencies": { | ||
"classnames": ">=2.0.0", | ||
"dom-lib": "0.0.16", | ||
"lodash": "^4.11.1" | ||
"dom-lib": "^0.2.3", | ||
"lodash": "^4.11.1", | ||
"rsuite-utils": "^0.0.1" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=0.14.0", | ||
|
@@ -51,16 +52,15 @@ | |
"colors": "^1.1.2", | ||
"css-loader": "^0.23.1", | ||
"es3ify-loader": "^0.2.0", | ||
"eslint": "^1.10.3", | ||
"eslint-config-airbnb": "^12.0.0", | ||
"eslint-plugin-babel": "^3.2.0", | ||
"eslint-plugin-import": "^2.0.1", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^5.0.1", | ||
"eslint": "^3.19.0", | ||
"eslint-config-airbnb": "^15.0.1", | ||
"eslint-plugin-babel": "^4.1.1", | ||
"eslint-plugin-import": "^2.6.1", | ||
"eslint-plugin-jsx-a11y": "^6.0.2", | ||
"eslint-plugin-react": "^7.1.0", | ||
"extract-text-webpack-plugin": "^1.0.1", | ||
"fs-promise": "^0.5.0", | ||
"glob": "^7.0.3", | ||
"highlight.js": "^9.4.0", | ||
"html-loader": "^0.4.3", | ||
"html-webpack-plugin": "^2.22.0", | ||
"karma": "^1.1.1", | ||
|
@@ -72,26 +72,24 @@ | |
"karma-mocha-reporter": "^2.0.4", | ||
"karma-sinon-chai": "^1.2.2", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^1.7.0", | ||
"karma-webpack": "2.0.3", | ||
"less": "^2.7.1", | ||
"less-loader": "^2.2.3", | ||
"markdown-loader": "^0.1.7", | ||
"marked": "^0.3.5", | ||
"mocha": "^2.5.3", | ||
"output-file-sync": "^1.1.1", | ||
"postcss-loader": "^0.9.1", | ||
"react": "^15.4.0", | ||
"react-dom": "^15.4.0", | ||
"react-hot-loader": "^1.3.0", | ||
"react-router": "2.0.1", | ||
"rimraf": "^2.5.2", | ||
"rsuite-form": "0.1.6", | ||
"rsuite-schema": "0.0.1-alpha.2", | ||
"sinon": "^1.17.4", | ||
"sinon-chai": "^2.8.0", | ||
"style-loader": "^0.13.1", | ||
"transform-loader": "^0.2.3", | ||
"webpack": "^1.13.1", | ||
"webpack-dev-server": "^1.14.1", | ||
"react": "^15.4.0", | ||
"react-dom": "^15.4.0" | ||
"webpack": "^3.0.0", | ||
"webpack-dev-server": "^2.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.