Update dependencies, linter and rules
parent
10eebce665
commit
516a0a3c13
18
.eslintrc
18
.eslintrc
|
@ -32,7 +32,7 @@
|
|||
"comma-style": [2, "last"],
|
||||
"complexity": [0, 11],
|
||||
"constructor-super": [2],
|
||||
"consistent-return": [2],
|
||||
"consistent-return": [0],
|
||||
"consistent-this": [0, "that"],
|
||||
"curly": [2, "multi-line"],
|
||||
"default-case": [2],
|
||||
|
@ -44,7 +44,6 @@
|
|||
"func-names": [0],
|
||||
"func-style": [0, "declaration"],
|
||||
"generator-star-spacing": [2, "after"],
|
||||
"strict": [2, "always"],
|
||||
"guard-for-in": [0],
|
||||
"handle-callback-err": [0],
|
||||
"key-spacing": [2, {
|
||||
|
@ -79,7 +78,6 @@
|
|||
"no-else-return": [0],
|
||||
"no-empty": [2],
|
||||
"no-empty-character-class": [2],
|
||||
"no-empty-label": [2],
|
||||
"no-eq-null": [0],
|
||||
"no-eval": [2],
|
||||
"no-ex-assign": [2],
|
||||
|
@ -173,16 +171,9 @@
|
|||
"quote-props": [0],
|
||||
"radix": [0],
|
||||
"semi": [2],
|
||||
"semi-spacing": [2, {
|
||||
"before": false,
|
||||
"after": true
|
||||
}],
|
||||
"sort-vars": [0],
|
||||
"space-after-keywords": [2, "always"],
|
||||
"space-before-function-paren": [2, {
|
||||
"anonymous": "always",
|
||||
"named": "always"
|
||||
}],
|
||||
"keyword-spacing": [2, {"after": true}],
|
||||
"space-before-function-paren": [2, { "anonymous": "always", "named": "always" }],
|
||||
"space-before-blocks": [0, "always"],
|
||||
"space-in-brackets": [0, "never", {
|
||||
"singleValue": true,
|
||||
|
@ -194,7 +185,6 @@
|
|||
}],
|
||||
"space-in-parens": [2, "never"],
|
||||
"space-infix-ops": [2],
|
||||
"space-return-throw-case": [2],
|
||||
"space-unary-ops": [2, {
|
||||
"words": true,
|
||||
"nonwords": false
|
||||
|
@ -220,7 +210,7 @@
|
|||
"react/jsx-no-duplicate-props": 1,
|
||||
"react/jsx-no-undef": 1,
|
||||
"react/jsx-pascal-case": 1,
|
||||
"react/jsx-sort-prop-types": 1,
|
||||
"react/sort-prop-types": 1,
|
||||
"react/jsx-sort-props": 0,
|
||||
"react/jsx-uses-react": 1,
|
||||
"react/jsx-uses-vars": 1,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "4.2.1"
|
||||
- "4.3.2"
|
||||
script:
|
||||
- npm run lint
|
||||
- npm test
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { PropTypes } from 'react';
|
||||
import ClassNames from 'classnames';
|
||||
import Ripple from '../ripple';
|
||||
import style from './style';
|
||||
|
@ -11,6 +11,12 @@ const Check = ({checked, children, onMouseDown}) => {
|
|||
return <div data-react-toolbox='check' onMouseDown={onMouseDown} className={className}>{children}</div>;
|
||||
};
|
||||
|
||||
Check.propTypes = {
|
||||
checked: PropTypes.bool,
|
||||
children: PropTypes.any,
|
||||
onMouseDown: PropTypes.func
|
||||
};
|
||||
|
||||
export default Ripple({
|
||||
className: style.ripple,
|
||||
spread: 2.6,
|
||||
|
|
|
@ -34,7 +34,7 @@ class Checkbox extends React.Component {
|
|||
}
|
||||
|
||||
render () {
|
||||
const { onChange, ...others } = this.props;
|
||||
const { onChange, ...others } = this.props; //eslint-disable-line no-unused-vars
|
||||
const className = ClassNames(style.field, {
|
||||
[style.disabled]: this.props.disabled
|
||||
}, this.props.className);
|
||||
|
|
|
@ -52,7 +52,7 @@ class ListItem extends React.Component {
|
|||
}
|
||||
|
||||
render () {
|
||||
const {onMouseDown, to, onClick, ripple, ...other} = this.props;
|
||||
const {onMouseDown, to, onClick, ripple, ...other} = this.props; //eslint-disable-line no-unused-vars
|
||||
const children = this.groupChildren();
|
||||
const content = <ListItemLayout {...children} {...other}/>;
|
||||
let className = style.listItem;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { PropTypes } from 'react';
|
||||
import style from './style';
|
||||
|
||||
const ListItemAction = ({action}) => {
|
||||
|
@ -13,6 +13,7 @@ const ListItemAction = ({action}) => {
|
|||
};
|
||||
|
||||
ListItemAction.propTypes = {
|
||||
action: PropTypes.object
|
||||
};
|
||||
|
||||
ListItemAction.defaultProps = {
|
||||
|
|
|
@ -16,7 +16,7 @@ class ListItemContent extends React.Component {
|
|||
const {type, children, caption, legend} = this.props;
|
||||
|
||||
let count = React.Children.count(children);
|
||||
[caption, legend].forEach(s => count += s ? 1 : 0);
|
||||
[caption, legend].forEach(s => { count += s ? 1 : 0; });
|
||||
const typeIndex = Math.min(count, types.length);
|
||||
|
||||
return type || types[typeIndex];
|
||||
|
|
|
@ -125,7 +125,7 @@ class Menu extends React.Component {
|
|||
} else if (position === POSITION.BOTTOM_LEFT) {
|
||||
return { clip: `rect(${height}px 0 ${height}px 0)` };
|
||||
} else if (position === POSITION.TOP_LEFT) {
|
||||
return { clip: `rect(0 0 0 0)` };
|
||||
return { clip: 'rect(0 0 0 0)' };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { PropTypes } from 'react';
|
||||
import Ripple from '../ripple';
|
||||
import style from './style';
|
||||
|
||||
|
@ -7,6 +7,12 @@ const Radio = ({checked, children, onMouseDown}) => {
|
|||
return <div data-react-toolbox='radio' onMouseDown={onMouseDown} className={className}>{children}</div>;
|
||||
};
|
||||
|
||||
Radio.propTypes = {
|
||||
checked: PropTypes.bool,
|
||||
children: PropTypes.any,
|
||||
onMouseDown: PropTypes.func
|
||||
};
|
||||
|
||||
export default Ripple({
|
||||
className: style.ripple,
|
||||
spread: 2.6,
|
||||
|
|
|
@ -38,7 +38,7 @@ class RadioButton extends React.Component {
|
|||
|
||||
render () {
|
||||
const className = ClassNames(style[this.props.disabled ? 'disabled' : 'field'], this.props.className);
|
||||
const { onChange, ...others } = this.props;
|
||||
const { onChange, ...others } = this.props; //eslint-disable-line no-unused-vars
|
||||
|
||||
return (
|
||||
<label data-react-toolbox='radio-button' className={className}>
|
||||
|
|
|
@ -87,10 +87,10 @@ const Ripple = (options = {}) => {
|
|||
} else {
|
||||
const {
|
||||
children,
|
||||
ripple,
|
||||
ripple, //eslint-disable-line no-unused-vars
|
||||
rippleClassName: className,
|
||||
rippleCentered: centered,
|
||||
rippleSpread: spread,
|
||||
rippleCentered: centered, //eslint-disable-line no-unused-vars
|
||||
rippleSpread: spread, //eslint-disable-line no-unused-vars
|
||||
...other
|
||||
} = this.props;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class Switch extends React.Component {
|
|||
render () {
|
||||
let className = style[this.props.disabled ? 'disabled' : 'field'];
|
||||
const switchClassName = style[this.props.checked ? 'on' : 'off'];
|
||||
const { onChange, ...others } = this.props;
|
||||
const { onChange, ...others } = this.props; //eslint-disable-line no-unused-vars
|
||||
if (this.props.className) className += ` ${this.props.className}`;
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { PropTypes } from 'react';
|
||||
import Ripple from '../ripple';
|
||||
import style from './style';
|
||||
|
||||
|
@ -6,6 +6,10 @@ const Thumb = ({children, onMouseDown}) => (
|
|||
<span role='thumb' className={style.thumb} onMouseDown={onMouseDown}>{children}</span>
|
||||
);
|
||||
|
||||
Thumb.propTypes = {
|
||||
children: PropTypes.any
|
||||
};
|
||||
|
||||
export default Ripple({
|
||||
className: style.ripple,
|
||||
spread: 2.6,
|
||||
|
|
|
@ -28,6 +28,7 @@ TableHead.propTypes = {
|
|||
className: React.PropTypes.string,
|
||||
model: React.PropTypes.object,
|
||||
onSelect: React.PropTypes.func,
|
||||
selectable: React.PropTypes.bool,
|
||||
selected: React.PropTypes.bool
|
||||
};
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ const Tooltip = (ComposedComponent) => class extends React.Component {
|
|||
};
|
||||
|
||||
render () {
|
||||
const {children, className, tooltip, tooltipDelay, tooltipHideOnClick, ...other} = this.props;
|
||||
const {children, className, tooltip, tooltipDelay, tooltipHideOnClick, ...other} = this.props; //eslint-disable-line no-unused-vars
|
||||
const composedClassName = ClassNames(style.root, className);
|
||||
const tooltipClassName = ClassNames(style.tooltip, {
|
||||
[style.active]: this.state.active
|
||||
|
|
68
package.json
68
package.json
|
@ -39,62 +39,62 @@
|
|||
"classnames": "^2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^6.2.1",
|
||||
"babel-cli": "^6.3.17",
|
||||
"babel-core": "^6.3.26",
|
||||
"babel-eslint": "^5.0.0-beta4",
|
||||
"babel-loader": "^6.2.0",
|
||||
"babel-plugin-react-transform": "^2.0.0-beta1",
|
||||
"babel-polyfill": "^6.3.14",
|
||||
"babel-preset-es2015": "^6.3.13",
|
||||
"autoprefixer": "^6.3.6",
|
||||
"babel-cli": "^6.7.5",
|
||||
"babel-core": "^6.7.6",
|
||||
"babel-eslint": "^6.0.2",
|
||||
"babel-loader": "^6.2.4",
|
||||
"babel-plugin-react-transform": "^2.0.2",
|
||||
"babel-polyfill": "^6.7.4",
|
||||
"babel-preset-es2015": "^6.6.0",
|
||||
"babel-preset-react": "^6.3.13",
|
||||
"babel-preset-stage-0": "^6.3.13",
|
||||
"bluebird": "^3.1.1",
|
||||
"core-js": "^1.2.6",
|
||||
"cpx": "^1.2.1",
|
||||
"bluebird": "^3.3.4",
|
||||
"core-js": "^2.2.2",
|
||||
"cpx": "^1.3.1",
|
||||
"cross-env": "^1.0.5",
|
||||
"css-loader": "^0.23.1",
|
||||
"eslint": "^1.10.3",
|
||||
"eslint-plugin-babel": "^3.0.0",
|
||||
"eslint-plugin-react": "^3.12.0",
|
||||
"expect": "^1.13.4",
|
||||
"eslint": "^2.7.0",
|
||||
"eslint-plugin-babel": "^3.2.0",
|
||||
"eslint-plugin-react": "^4.3.0",
|
||||
"expect": "^1.16.0",
|
||||
"express": "^4.13.3",
|
||||
"extract-text-webpack-plugin": "^0.9.1",
|
||||
"glob": "^6.0.2",
|
||||
"karma": "^0.13.15",
|
||||
"karma-chrome-launcher": "^0.2.2",
|
||||
"extract-text-webpack-plugin": "^1.0.1",
|
||||
"glob": "^7.0.3",
|
||||
"karma": "^0.13.22",
|
||||
"karma-chrome-launcher": "^0.2.3",
|
||||
"karma-cli": "^0.1.2",
|
||||
"karma-mocha": "^0.2.1",
|
||||
"karma-phantomjs-launcher": "~0.2.1",
|
||||
"karma-mocha": "^0.2.2",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"karma-webpack": "^1.7.0",
|
||||
"mocha": "^2.3.4",
|
||||
"node-sass": "^3.4.2",
|
||||
"normalize.css": "^3.0.3",
|
||||
"phantomjs": "^1.9.19",
|
||||
"phantomjs-polyfill": "0.0.1",
|
||||
"postcss-loader": "^0.8.0",
|
||||
"normalize.css": "^4.0.0",
|
||||
"phantomjs": "^2.1.7",
|
||||
"phantomjs-polyfill": "0.0.2",
|
||||
"postcss-loader": "^0.8.2",
|
||||
"react": "^15.0.0",
|
||||
"react-addons-css-transition-group": "^15.0.0",
|
||||
"react-addons-test-utils": "^15.0.0",
|
||||
"react-docgen": "^2.4.0",
|
||||
"react-docgen": "^2.8.1",
|
||||
"react-dom": "^15.0.0",
|
||||
"react-transform-catch-errors": "^1.0.0",
|
||||
"react-transform-hmr": "^1.0.1",
|
||||
"react-transform-hmr": "^1.0.4",
|
||||
"redbox-react": "^1.2.3",
|
||||
"rimraf": "^2.5.0",
|
||||
"sass-loader": "^3.1.2",
|
||||
"sass-loader": "^3.2.0",
|
||||
"sinon": "git://github.com/sinonjs/sinon.git#b672042043517b9f84e14ed0fb8265126168778a",
|
||||
"style-loader": "^0.13.0",
|
||||
"style-loader": "^0.13.1",
|
||||
"toolbox-loader": "0.0.2",
|
||||
"webpack": "^1.12.9",
|
||||
"webpack-dev-middleware": "^1.4.0",
|
||||
"webpack-hot-middleware": "^2.6.0"
|
||||
"webpack": "^1.12.14",
|
||||
"webpack-dev-middleware": "^1.6.1",
|
||||
"webpack-hot-middleware": "^2.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"babel": "babel ./components --out-dir ./lib",
|
||||
"build": "cross-env NODE_ENV=production npm run babel && npm run sass",
|
||||
"clean": "rimraf ./lib",
|
||||
"lint": "eslint ./ --ext .js,.jsx",
|
||||
"lint": "eslint ./components --ext .js,.jsx",
|
||||
"patch": "bumped release patch",
|
||||
"prebuild": "npm run clean",
|
||||
"prepublish": "npm run build",
|
||||
|
@ -107,7 +107,7 @@
|
|||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"classnames": "^2.2.0",
|
||||
"normalize.css": "^3.0.3",
|
||||
"normalize.css": "^4.0.0",
|
||||
"react": "^0.14 || ^15.0.0",
|
||||
"react-addons-css-transition-group": "^0.14.0 || ^15.0.0",
|
||||
"react-dom": "^0.14.0 || ^15.0.0"
|
||||
|
|
|
@ -50,7 +50,7 @@ class ListTest extends React.Component {
|
|||
rightIcon='star'
|
||||
/>
|
||||
<ListItem
|
||||
avatar='https://pbs.twimg.com/profile_images/459485216499720192/ufS4YGOY_400x400.png'
|
||||
avatar='https://pbs.twimg.com/profile_images/693578804808278017/a5y4h8MN_400x400.png'
|
||||
caption='Javi Velasco'
|
||||
legend='Frontend engineer at Socialbro'
|
||||
rightIcon='star'
|
||||
|
@ -112,7 +112,7 @@ class ListTest extends React.Component {
|
|||
rightIcon='mail'
|
||||
/>
|
||||
<ListItem
|
||||
avatar='https://pbs.twimg.com/profile_images/459485216499720192/ufS4YGOY_400x400.png'
|
||||
avatar='https://pbs.twimg.com/profile_images/693578804808278017/a5y4h8MN_400x400.png'
|
||||
caption='Javi Velasco'
|
||||
rightIcon='mail'
|
||||
/>
|
||||
|
@ -149,7 +149,7 @@ class ListTest extends React.Component {
|
|||
<ListItem leftIcon='send' rightIcon='done' caption='Reference item'/>
|
||||
<ListItem rightIcon='done' caption='Item with custom left icons'>
|
||||
<FontIcon value='send' />
|
||||
<Avatar image='https://pbs.twimg.com/profile_images/459485216499720192/ufS4YGOY_400x400.png'/>
|
||||
<Avatar image='https://pbs.twimg.com/profile_images/693578804808278017/a5y4h8MN_400x400.png'/>
|
||||
</ListItem>
|
||||
<ListItem leftIcon='send'>
|
||||
<ListItemContent caption='custom right icons' legend='ListItemContent acts as a divider'/>
|
||||
|
@ -175,7 +175,7 @@ class ListTest extends React.Component {
|
|||
<ListItem caption='Item with overlayed click events' onClick={() => console.log('clicked row')}>
|
||||
<FontIcon value='send' onClick={() => console.log('clicked icon')}/>
|
||||
<Avatar
|
||||
image='https://pbs.twimg.com/profile_images/459485216499720192/ufS4YGOY_400x400.png'
|
||||
image='https://pbs.twimg.com/profile_images/693578804808278017/a5y4h8MN_400x400.png'
|
||||
onMouseDown={() => console.log('avatar mouse down, should see ripple')}
|
||||
onClick={() => console.log('clicked avatar')}
|
||||
/>
|
||||
|
|
|
@ -17,7 +17,8 @@ module.exports = {
|
|||
publicPath: '/build/'
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['', '.jsx', '.scss', '.js', '.json']
|
||||
extensions: ['', '.jsx', '.scss', '.js', '.json'],
|
||||
packageMains: ['browser', 'web', 'browserify', 'main', 'style']
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
|
|
|
@ -15,7 +15,8 @@ module.exports = {
|
|||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['', '.jsx', '.scss', '.js', '.json']
|
||||
extensions: ['', '.jsx', '.scss', '.js', '.json'],
|
||||
packageMains: ['browser', 'web', 'browserify', 'main', 'style']
|
||||
},
|
||||
watch: true,
|
||||
postcss: [autoprefixer],
|
||||
|
|
Loading…
Reference in New Issue