mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-28 00:49:46 +03:00
Fix lint errors
This commit is contained in:
parent
5df216fc61
commit
e81ee2cf5d
|
@ -16,18 +16,16 @@ export default class Footer extends Component {
|
||||||
filter: PropTypes.string.isRequired,
|
filter: PropTypes.string.isRequired,
|
||||||
onClearMarked: PropTypes.func.isRequired,
|
onClearMarked: PropTypes.func.isRequired,
|
||||||
onShow: PropTypes.func.isRequired
|
onShow: PropTypes.func.isRequired
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<footer className='footer'>
|
<footer className='footer'>
|
||||||
{this.renderTodoCount()}
|
{this.renderTodoCount()}
|
||||||
<ul className='filters'>
|
<ul className='filters'>
|
||||||
{[SHOW_ALL, SHOW_UNMARKED, SHOW_MARKED].map(filter =>
|
{[SHOW_ALL, SHOW_UNMARKED, SHOW_MARKED].map(filter => (
|
||||||
<li key={filter}>
|
<li key={filter}>{this.renderFilterLink(filter)}</li>
|
||||||
{this.renderFilterLink(filter)}
|
))}
|
||||||
</li>
|
|
||||||
)}
|
|
||||||
</ul>
|
</ul>
|
||||||
{this.renderClearButton()}
|
{this.renderClearButton()}
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -64,10 +62,7 @@ export default class Footer extends Component {
|
||||||
const { markedCount, onClearMarked } = this.props;
|
const { markedCount, onClearMarked } = this.props;
|
||||||
if (markedCount > 0) {
|
if (markedCount > 0) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button className='clear-completed' onClick={onClearMarked}>
|
||||||
className='clear-completed'
|
|
||||||
onClick={onClearMarked}
|
|
||||||
>
|
|
||||||
Clear completed
|
Clear completed
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
|
|
|
@ -39,18 +39,15 @@ export default class MainSection extends Component {
|
||||||
const { filter } = this.state;
|
const { filter } = this.state;
|
||||||
|
|
||||||
const filteredTodos = todos.filter(TODO_FILTERS[filter]);
|
const filteredTodos = todos.filter(TODO_FILTERS[filter]);
|
||||||
const markedCount = todos.reduce((count, todo) =>
|
const markedCount = todos.reduce((count, todo) => (todo.marked ? count + 1 : count), 0);
|
||||||
(todo.marked ? count + 1 : count),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className='main'>
|
<section className='main'>
|
||||||
{this.renderToggleAll(markedCount)}
|
{this.renderToggleAll(markedCount)}
|
||||||
<ul className='todo-list'>
|
<ul className='todo-list'>
|
||||||
{filteredTodos.map(todo =>
|
{filteredTodos.map(todo => (
|
||||||
<TodoItem key={todo.id} todo={todo} {...actions} />
|
<TodoItem key={todo.id} todo={todo} {...actions} />
|
||||||
)}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
{this.renderFooter(markedCount)}
|
{this.renderFooter(markedCount)}
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -4,32 +4,12 @@
|
||||||
"description": "TodoMVC example for redux",
|
"description": "TodoMVC example for redux",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack-dev-server",
|
"start": "../../node_modules/.bin/webpack-dev-server",
|
||||||
"build": "webpack --config webpack.config.prod.js"
|
"build": "../../node_modules/.bin/webpack --config webpack.config.prod.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/calesce/redux-slider-monitor.git"
|
"url": "https://github.com/calesce/redux-slider-monitor.git"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"dependencies": {
|
|
||||||
"classnames": "^2.1.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"babel-cli": "^6.24.1",
|
|
||||||
"babel-core": "^6.24.1",
|
|
||||||
"babel-loader": "^6.4.1",
|
|
||||||
"babel-preset-es2015": "^6.24.1",
|
|
||||||
"babel-preset-react": "^6.24.1",
|
|
||||||
"babel-preset-stage-0": "^6.24.1",
|
|
||||||
"node-libs-browser": "^0.5.2",
|
|
||||||
"raw-loader": "^0.5.1",
|
|
||||||
"react-hot-loader": "^3.0.0-beta.6",
|
|
||||||
"redux-devtools-dock-monitor": "^1.0.1",
|
|
||||||
"redux-devtools-log-monitor": "^1.0.1",
|
|
||||||
"style-loader": "^0.16.1",
|
|
||||||
"todomvc-app-css": "^2.0.1",
|
|
||||||
"webpack": "^2.2.1",
|
|
||||||
"webpack-dev-server": "^2.4.1"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,7 @@ module.exports = {
|
||||||
plugins: [new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin()],
|
plugins: [new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'redux-slider-monitor': path.join(__dirname, '..', '..', 'src/SliderMonitor'),
|
'redux-slider-monitor': path.join(__dirname, '..', '..', 'src/SliderMonitor')
|
||||||
react: path.join(__dirname, '../../../../node_modules', 'react'),
|
|
||||||
'react-dom': path.join(__dirname, '../../../../node_modules', 'react-dom'),
|
|
||||||
'redux-devtools': path.join(__dirname, '../../..', 'redux-devtools')
|
|
||||||
},
|
},
|
||||||
extensions: ['.js']
|
extensions: ['.js']
|
||||||
},
|
},
|
||||||
|
@ -36,12 +33,15 @@ module.exports = {
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
use: ['babel-loader'],
|
use: ['babel-loader'],
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
include: [__dirname, path.join(__dirname, '..', '..', 'src')]
|
include: [__dirname, path.join(__dirname, '../../src')]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css?$/,
|
test: /\.css?$/,
|
||||||
use: ['style-loader', 'raw-loader'],
|
use: ['style-loader', 'raw-loader'],
|
||||||
include: __dirname
|
include: [
|
||||||
|
__dirname,
|
||||||
|
path.join(__dirname, '../../../../node_modules/todomvc-app-css')
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -26,16 +26,26 @@
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-es2015": "^6.24.1",
|
||||||
"babel-preset-react": "^6.24.1",
|
"babel-preset-react": "^6.24.1",
|
||||||
"babel-preset-stage-0": "^6.24.1",
|
"babel-preset-stage-0": "^6.24.1",
|
||||||
"eslint": "^3.19.0",
|
"classnames": "^2.1.2",
|
||||||
|
"eslint": "^5.0.0",
|
||||||
"eslint-config-airbnb": "^14.1.0",
|
"eslint-config-airbnb": "^14.1.0",
|
||||||
"eslint-plugin-import": "^2.2.0",
|
"eslint-plugin-import": "^2.2.0",
|
||||||
"eslint-plugin-jsx-a11y": "^4.0.0",
|
"eslint-plugin-jsx-a11y": "^4.0.0",
|
||||||
"eslint-plugin-react": "^6.10.3",
|
"eslint-plugin-react": "^7.4.0",
|
||||||
|
"raw-loader": "^0.5.1",
|
||||||
"react": "^16.7.0",
|
"react": "^16.7.0",
|
||||||
"react-dom": "^16.7.0",
|
"react-dom": "^16.7.0",
|
||||||
"react-redux": "^6.0.0",
|
"react-redux": "^6.0.0",
|
||||||
|
"react-hot-loader": "^3.0.0-beta.6",
|
||||||
"redux": "^4.0.0",
|
"redux": "^4.0.0",
|
||||||
"rimraf": "^2.3.4"
|
"redux-devtools-dock-monitor": "^1.0.1",
|
||||||
|
"redux-devtools-log-monitor": "^1.0.1",
|
||||||
|
"redux-devtools": "^3.5.0",
|
||||||
|
"rimraf": "^2.3.4",
|
||||||
|
"style-loader": "^0.16.1",
|
||||||
|
"todomvc-app-css": "^2.0.1",
|
||||||
|
"webpack": "^2.2.1",
|
||||||
|
"webpack-dev-server": "^2.4.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^0.14.0 || ^15.0.0 || ^16.0.0-0",
|
"react": "^0.14.0 || ^15.0.0 || ^16.0.0-0",
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default class SliderButton extends (PureComponent || Component) {
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
onClick: PropTypes.func
|
onClick: PropTypes.func
|
||||||
}
|
};
|
||||||
|
|
||||||
iconStyle() {
|
iconStyle() {
|
||||||
return {
|
return {
|
||||||
|
@ -28,11 +28,10 @@ export default class SliderButton extends (PureComponent || Component) {
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
theme={this.props.theme}
|
theme={this.props.theme}
|
||||||
>
|
>
|
||||||
<svg
|
<svg viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet' style={this.iconStyle()}>
|
||||||
viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet'
|
<g>
|
||||||
style={this.iconStyle()}
|
<path d='M8 5v14l11-7z' />
|
||||||
>
|
</g>
|
||||||
<g><path d='M8 5v14l11-7z' /></g>
|
|
||||||
</svg>
|
</svg>
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
@ -46,20 +45,19 @@ export default class SliderButton extends (PureComponent || Component) {
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
theme={this.props.theme}
|
theme={this.props.theme}
|
||||||
>
|
>
|
||||||
<svg
|
<svg viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet' style={this.iconStyle()}>
|
||||||
viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet'
|
<g>
|
||||||
style={this.iconStyle()}
|
<path d='M6 19h4V5H6v14zm8-14v14h4V5h-4z' />
|
||||||
>
|
</g>
|
||||||
<g><path d='M6 19h4V5H6v14zm8-14v14h4V5h-4z' /></g>
|
|
||||||
</svg>
|
</svg>
|
||||||
</Button>
|
</Button>
|
||||||
)
|
);
|
||||||
|
|
||||||
renderStepButton = (direction) => {
|
renderStepButton = (direction) => {
|
||||||
const isLeft = direction === 'left';
|
const isLeft = direction === 'left';
|
||||||
const d = isLeft ?
|
const d = isLeft
|
||||||
'M15.41 16.09l-4.58-4.59 4.58-4.59-1.41-1.41-6 6 6 6z' :
|
? 'M15.41 16.09l-4.58-4.59 4.58-4.59-1.41-1.41-6 6 6 6z'
|
||||||
'M8.59 16.34l4.58-4.59-4.58-4.59 1.41-1.41 6 6-6 6z';
|
: 'M8.59 16.34l4.58-4.59-4.58-4.59 1.41-1.41 6 6-6 6z';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
|
@ -69,15 +67,14 @@ export default class SliderButton extends (PureComponent || Component) {
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
theme={this.props.theme}
|
theme={this.props.theme}
|
||||||
>
|
>
|
||||||
<svg
|
<svg viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet' style={this.iconStyle()}>
|
||||||
viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet'
|
<g>
|
||||||
style={this.iconStyle()}
|
<path d={d} />
|
||||||
>
|
</g>
|
||||||
<g><path d={d} /></g>
|
|
||||||
</svg>
|
</svg>
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
switch (this.props.type) {
|
switch (this.props.type) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user