Skip to content

Commit

Permalink
fix(example): Linting errors (react-boilerplate#978)
Browse files Browse the repository at this point in the history
* fix(example): Linting errors

fixes react-boilerplate#975

* enforece arrow-parens
  • Loading branch information
peter-mouland authored and mxstbr committed Sep 12, 2016
1 parent d38ab17 commit 6b2e987
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 22 deletions.
15 changes: 9 additions & 6 deletions app/components/A/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ import React, { PropTypes } from 'react';

import styles from './styles.css';

function A(props) {
function A({ ...props }) {
const { className, children, href, target, ...rest } = props;
return (
<a
className={
props.className || styles.link
}
{...props}
/>
href={href}
target={target}
className={className || styles.link}
{...rest}
>
{ children }
</a>
);
}

Expand Down
2 changes: 1 addition & 1 deletion app/containers/LanguageProvider/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
/**
* Direct selector to the languageToggle state domain
*/
const selectLanguage = () => state => state.get('language');
const selectLanguage = () => (state) => state.get('language');

/**
* Select the language locale
Expand Down
2 changes: 1 addition & 1 deletion app/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import createSagaMiddleware from 'redux-saga';
import createReducer from './reducers';

const sagaMiddleware = createSagaMiddleware();
const devtools = window.devToolsExtension || (() => noop => noop);
const devtools = window.devToolsExtension || (() => (noop) => noop);

export default function configureStore(initialState = {}, history) {
// Create the store with two middlewares
Expand Down
4 changes: 2 additions & 2 deletions internals/generators/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
name: 'name',
message: 'What should it be called?',
default: 'Button',
validate: value => {
validate: (value) => {
if ((/.+/).test(value)) {
return componentExists(value) ? 'A component or container with this name already exists' : true;
}
Expand All @@ -35,7 +35,7 @@ module.exports = {
default: true,
message: 'Do you want i18n messages (i.e. will this component use text)?',
}],
actions: data => {
actions: (data) => {
// Generate index.js and index.test.js
const actions = [{
type: 'add',
Expand Down
4 changes: 2 additions & 2 deletions internals/generators/container/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
name: 'name',
message: 'What should it be called?',
default: 'Form',
validate: value => {
validate: (value) => {
if ((/.+/).test(value)) {
return componentExists(value) ? 'A component or container with this name already exists' : true;
}
Expand Down Expand Up @@ -44,7 +44,7 @@ module.exports = {
default: true,
message: 'Do you want i18n messages (i.e. will this component use text)?',
}],
actions: data => {
actions: (data) => {
// Generate index.js and index.test.js
const actions = [{
type: 'add',
Expand Down
2 changes: 1 addition & 1 deletion internals/generators/language/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
name: 'language',
message: 'What is the language you want to add i18n support for (e.g. "fr", "de")?',
default: 'fr',
validate: value => {
validate: (value) => {
if ((/.+/).test(value) && value.length === 2) {
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions internals/generators/route/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = {
type: 'input',
name: 'component',
message: 'Which component should the route show?',
validate: value => {
validate: (value) => {
if ((/.+/).test(value)) {
return componentExists(value) ? true : `"${value}" doesn't exist.`;
}
Expand All @@ -45,7 +45,7 @@ module.exports = {
name: 'path',
message: 'Enter the path of the route.',
default: '/about',
validate: value => {
validate: (value) => {
if ((/.+/).test(value)) {
return true;
}
Expand All @@ -56,7 +56,7 @@ module.exports = {

// Add the route to the routes.js file above the error route
// TODO smarter route adding
actions: data => {
actions: (data) => {
const actions = [];
if (reducerExists(data.component)) {
data.useSagas = sagasExists(data.component); // eslint-disable-line no-param-reassign
Expand Down
2 changes: 1 addition & 1 deletion internals/templates/languageProvider/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
/**
* Direct selector to the languageToggle state domain
*/
const selectLanguage = () => state => state.get('language');
const selectLanguage = () => (state) => state.get('language');

/**
* Select the language locale
Expand Down
2 changes: 1 addition & 1 deletion internals/templates/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import createSagaMiddleware from 'redux-saga';
import createReducer from './reducers';

const sagaMiddleware = createSagaMiddleware();
const devtools = window.devToolsExtension || (() => noop => noop);
const devtools = window.devToolsExtension || (() => (noop) => noop);

export default function configureStore(initialState = {}, history) {
// Create the store with two middlewares
Expand Down
2 changes: 1 addition & 1 deletion internals/webpack/webpack.dev.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function templateContent() {
const body = doc.find('body');
const dllNames = !dllPlugin.dlls ? ['reactBoilerplateDeps'] : Object.keys(dllPlugin.dlls);

dllNames.forEach(dllName => body.append(`<script data-dll='true' src='/${dllName}.dll.js'></script>`));
dllNames.forEach((dllName) => body.append(`<script data-dll='true' src='/${dllName}.dll.js'></script>`));

return doc.toString();
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
}
},
"rules": {
"arrow-parens": ["error", "always"],
"arrow-body-style": [
2,
"as-needed"
Expand Down Expand Up @@ -136,6 +137,9 @@
"no-console": 1,
"no-use-before-define": 0,
"prefer-template": 2,
"class-methods-use-this": 0,
"react/forbid-prop-types": 0,
"react/jsx-first-prop-new-line": [2, "multiline"],
"react/jsx-filename-extension": 0,
"react/jsx-no-target-blank": 0,
"react/require-extension": 0,
Expand Down Expand Up @@ -243,10 +247,10 @@
"css-loader": "0.25.0",
"enzyme": "2.4.1",
"eslint": "3.5.0",
"eslint-config-airbnb": "10.0.1",
"eslint-config-airbnb": "11.1.0",
"eslint-import-resolver-webpack": "0.5.1",
"eslint-plugin-import": "1.14.0",
"eslint-plugin-jsx-a11y": "2.2.1",
"eslint-plugin-jsx-a11y": "2.2.2",
"eslint-plugin-react": "6.2.0",
"eventsource-polyfill": "0.9.6",
"expect": "1.20.2",
Expand Down
2 changes: 1 addition & 1 deletion server/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const divider = chalk.gray('\n-----------------------------------');
const logger = {

// Called whenever there's an error on the server we want to print
error: err => {
error: (err) => {
console.error(chalk.red(err));
},

Expand Down

0 comments on commit 6b2e987

Please sign in to comment.