Skip to content

Commit 23d971c

Browse files
committed
add react router 4 route components
1 parent 5eae4e9 commit 23d971c

File tree

16 files changed

+960
-339
lines changed

16 files changed

+960
-339
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ root = true
44
indent_style = space
55
indent_size = 2
66
insert_final_newline = true
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintrc

Lines changed: 162 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
{
2+
"root": true,
23
"parser": "babel-eslint",
34
"env": {
45
"browser": true,
56
"node": true,
67
"es6": true,
7-
"mocha": true
8+
"mocha": true,
9+
"jest": true
810
},
9-
"plugins": ["react"],
11+
"plugins": [
12+
"react",
13+
"mocha"
14+
],
1015
"extends": [
11-
"plugin:react/recommended"
16+
"plugin:react/recommended"
1217
],
1318
// eslint > 2.x
1419
"parserOptions": {
@@ -37,34 +42,32 @@
3742
"jsx": true
3843
}
3944
},
40-
// eslint 1.x
41-
"ecmaFeatures": {
42-
"arrowFunctions": true,
43-
"binaryLiterals": true,
44-
"blockBindings": true,
45-
"classes": true,
46-
"defaultParams": true,
47-
"destructuring": true,
48-
"forOf": true,
49-
"generators": true,
50-
"modules": true,
51-
"objectLiteralComputedProperties": true,
52-
"objectLiteralDuplicateProperties": true,
53-
"objectLiteralShorthandMethods": true,
54-
"objectLiteralShorthandProperties": true,
55-
"octalLiterals": true,
56-
"regexUFlag": true,
57-
"regexYFlag": true,
58-
"spread": true,
59-
"superInFunctions": true,
60-
"templateStrings": true,
61-
"unicodeCodePointEscapes": true,
62-
"globalReturn": true,
63-
"jsx": true
64-
},
65-
45+
// // eslint 1.x (deprecated):
46+
// "ecmaFeatures": {
47+
// "arrowFunctions": true,
48+
// "binaryLiterals": true,
49+
// "blockBindings": true,
50+
// "classes": true,
51+
// "defaultParams": true,
52+
// "destructuring": true,
53+
// "forOf": true,
54+
// "generators": true,
55+
// "modules": true,
56+
// "objectLiteralComputedProperties": true,
57+
// "objectLiteralDuplicateProperties": true,
58+
// "objectLiteralShorthandMethods": true,
59+
// "objectLiteralShorthandProperties": true,
60+
// "octalLiterals": true,
61+
// "regexUFlag": true,
62+
// "regexYFlag": true,
63+
// "spread": true,
64+
// "superInFunctions": true,
65+
// "templateStrings": true,
66+
// "unicodeCodePointEscapes": true,
67+
// "globalReturn": true,
68+
// "jsx": true
69+
// },
6670
"rules": {
67-
6871
//
6972
//Possible Errors
7073
//
@@ -97,14 +100,12 @@
97100
"use-isnan": 2, // disallow comparisons with the value NaN
98101
"valid-jsdoc": 2, // Ensure JSDoc comments are valid (off by default)
99102
"valid-typeof": 2, // Ensure that the results of typeof are compared against a valid string
100-
101103
//
102104
// Best Practices
103105
//
104106
// These are rules designed to prevent you from making mistakes.
105107
// They either prescribe a better way of doing something or help you avoid footguns.
106108
//
107-
"prefer-const": ["error", { "destructuring": "any", "ignoreReadBeforeAssign": false }],
108109
"block-scoped-var": 0, // treat var statements as if they were block scoped (off by default). 0: deep destructuring is not compatible https://github.com/eslint/eslint/issues/1863
109110
"complexity": 0, // specify the maximum cyclomatic complexity allowed in a program (off by default)
110111
"consistent-return": 2, // require return statements to either always or never specify values
@@ -148,20 +149,27 @@
148149
"no-throw-literal": 2, // restrict what can be thrown as an exception (off by default)
149150
"no-unused-expressions": 2, // disallow usage of expressions in statement position
150151
"no-void": 2, // disallow use of void operator (off by default)
151-
"no-warning-comments": [0, {"terms": ["todo", "fixme"], "location": "start"}], // disallow usage of configurable warning terms in comments": 2, // e.g. TODO or FIXME (off by default)
152+
"no-warning-comments": [
153+
0,
154+
{
155+
"terms": [
156+
"todo",
157+
"fixme"
158+
],
159+
"location": "start"
160+
}
161+
], // disallow usage of configurable warning terms in comments": 2, // e.g. TODO or FIXME (off by default)
152162
"no-with": 2, // disallow use of the with statement
153163
"radix": 2, // require use of the second argument for parseInt() (off by default)
154164
"vars-on-top": 2, // requires to declare all vars on top of their containing scope (off by default)
155165
"wrap-iife": 2, // require immediate function invocation to be wrapped in parentheses (off by default)
156166
"yoda": 2, // require or disallow Yoda conditions
157-
158167
//
159168
// Strict Mode
160169
//
161170
// These rules relate to using strict mode.
162171
//
163172
"strict": 0, // controls location of Use Strict Directives. 0: required by `babel-eslint`
164-
165173
//
166174
// Variables
167175
//
@@ -176,94 +184,179 @@
176184
"no-undef-init": 2, // disallow use of undefined when initializing variables
177185
"no-undefined": 2, // disallow use of undefined variable (off by default)
178186
"no-unused-vars": 2, // disallow declaration of variables that are not used in the code
179-
"no-use-before-define": ["error", { "functions": false, "classes": true }], // disallow use of variables before they are defined
180-
187+
"no-use-before-define": [
188+
"error",
189+
{
190+
"functions": false,
191+
"classes": true
192+
}
193+
], // disallow use of variables before they are defined
181194
//
182195
//Stylistic Issues
183196
//
184197
// These rules are purely matters of style and are quite subjective.
185198
//
186-
"indent": [1, 2], // this option sets a specific tab width for your code (off by default)
199+
"indent": [
200+
1,
201+
2
202+
], // this option sets a specific tab width for your code (off by default)
187203
"brace-style": 1, // enforce one true brace style (off by default)
188204
"camelcase": 1, // require camel case names
189-
"comma-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after comma
190-
"comma-style": [1, "last"], // enforce one true comma style (off by default)
191-
"consistent-this": [1, "_this"], // enforces consistent naming when capturing the current execution context (off by default)
205+
"comma-spacing": [
206+
1,
207+
{
208+
"before": false,
209+
"after": true
210+
}
211+
], // enforce spacing before and after comma
212+
"comma-style": [
213+
1,
214+
"last"
215+
], // enforce one true comma style (off by default)
216+
"consistent-this": [
217+
1,
218+
"_this"
219+
], // enforces consistent naming when capturing the current execution context (off by default)
192220
"eol-last": 1, // enforce newline at the end of file, with no multiple empty lines
193221
"func-names": 0, // require function expressions to have a name (off by default)
194222
"func-style": 0, // enforces use of function declarations or expressions (off by default)
195-
196-
"max-nested-callbacks": [1, 3], // specify the maximum depth callbacks can be nested (off by default)
197-
"new-cap": [1, {"newIsCap": true, "capIsNew": false}], // require a capital letter for constructors
223+
"max-nested-callbacks": [
224+
1,
225+
3
226+
], // specify the maximum depth callbacks can be nested (off by default)
227+
"new-cap": [
228+
1,
229+
{
230+
"newIsCap": true,
231+
"capIsNew": false
232+
}
233+
], // require a capital letter for constructors
198234
"new-parens": 1, // disallow the omission of parentheses when invoking a constructor with no arguments
199235
"newline-after-var": 0, // allow/disallow an empty newline after var statement (off by default)
200236
"no-array-constructor": 1, // disallow use of the Array constructor
201237
"no-inline-comments": 0, // disallow comments inline after code (off by default)
202238
"no-lonely-if": 1, // disallow if as the only statement in an else block (off by default)
203239
"no-mixed-spaces-and-tabs": 1, // disallow mixed spaces and tabs for indentation
204-
"no-multiple-empty-lines": [1, {"max": 2}], // disallow multiple empty lines (off by default)
240+
"no-multiple-empty-lines": [
241+
1,
242+
{
243+
"max": 2
244+
}
245+
], // disallow multiple empty lines (off by default)
205246
"no-nested-ternary": 1, // disallow nested ternary expressions (off by default)
206247
"no-new-object": 1, // disallow use of the Object constructor
207248
"no-spaced-func": 1, // disallow space between function identifier and application
208249
"no-ternary": 0, // disallow the use of ternary operators (off by default)
209250
//"no-trailing-spaces": 1, // disallow trailing whitespace at the end of lines
210251
//"no-underscore-dangle": 1, // disallow dangling underscores in identifiers
211-
"one-var": [1, "never"], // allow just one var statement per function (off by default)
212-
"operator-assignment": [1, "never"], // require assignment operator shorthand where possible or prohibit it entirely (off by default)
213-
"padded-blocks": [1, "never"], // enforce padding within blocks (off by default)
214-
215-
"quotes": [1, "single"], // specify whether double or single quotes should be used
216-
"semi": [1, "always"], // require or disallow use of semicolons instead of ASI
217-
"semi-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after semicolons
252+
"one-var": [
253+
1,
254+
"never"
255+
], // allow just one var statement per function (off by default)
256+
"operator-assignment": [
257+
1,
258+
"never"
259+
], // require assignment operator shorthand where possible or prohibit it entirely (off by default)
260+
"padded-blocks": [
261+
1,
262+
"never"
263+
], // enforce padding within blocks (off by default)
264+
"quotes": [
265+
1,
266+
"single"
267+
], // specify whether double or single quotes should be used
268+
"semi": [
269+
1,
270+
"always"
271+
], // require or disallow use of semicolons instead of ASI
272+
"semi-spacing": [
273+
1,
274+
{
275+
"before": false,
276+
"after": true
277+
}
278+
], // enforce spacing before and after semicolons
218279
"sort-vars": 0, // sort variables within the same declaration block (off by default)
219280
// "space-after-keywords": [1, "always"], // require a space after certain keywords (off by default)
220-
"space-before-blocks": [1, "always"], // require or disallow space before blocks (off by default)
221-
"space-before-function-paren": [1, {"anonymous": "always", "named": "never"}], // require or disallow space before function opening parenthesis (off by default)
281+
"space-before-blocks": [
282+
1,
283+
"always"
284+
], // require or disallow space before blocks (off by default)
285+
"space-before-function-paren": [
286+
1,
287+
{
288+
"anonymous": "always",
289+
"named": "never"
290+
}
291+
], // require or disallow space before function opening parenthesis (off by default)
222292
//"space-in-brackets": [1, "never"], // require or disallow spaces inside brackets (off by default)
223-
"space-in-parens": [1, "never"], // require or disallow spaces inside parentheses (off by default)
224-
"space-unary-ops": [1, {"words": true, "nonwords": false}], // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
225-
"spaced-comment": [1, "always"], // require or disallow a space immediately following the // in a line comment (off by default)
293+
"space-in-parens": [
294+
1,
295+
"never"
296+
], // require or disallow spaces inside parentheses (off by default)
297+
"space-unary-ops": [
298+
1,
299+
{
300+
"words": true,
301+
"nonwords": false
302+
}
303+
], // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
304+
"spaced-comment": [
305+
1,
306+
"always"
307+
], // require or disallow a space immediately following the // in a line comment (off by default)
226308
"wrap-regex": 0, // require regex literals to be wrapped in parentheses (off by default)
227-
228309
//
229310
// ECMAScript 6
230311
//
231312
// These rules are only relevant to ES6 environments and are off by default.
232313
//
233314
"no-var": 2, // require let or const instead of var (off by default)
234-
"generator-star-spacing": [2, "before"], // enforce the spacing around the * in generator functions (off by default)
235-
315+
"generator-star-spacing": [
316+
2,
317+
"before"
318+
], // enforce the spacing around the * in generator functions (off by default)
236319
//
237320
// Legacy
238321
//
239322
// The following rules are included for compatibility with JSHint and JSLint.
240323
// While the names of the rules may not match up with the JSHint/JSLint counterpart,
241324
// the functionality is the same.
242325
//
243-
"max-depth": [2, 3], // specify the maximum depth that blocks can be nested (off by default)
244-
"max-len": [2, 300, 2], // specify the maximum length of a line in your program (off by default)
245-
"max-params": [2, 5], // limits the number of parameters that can be used in the function declaration. (off by default)
326+
"max-depth": [
327+
2,
328+
3
329+
], // specify the maximum depth that blocks can be nested (off by default)
330+
"max-len": [
331+
2,
332+
300,
333+
2
334+
], // specify the maximum length of a line in your program (off by default)
335+
"max-params": [
336+
2,
337+
5
338+
], // limits the number of parameters that can be used in the function declaration. (off by default)
246339
"max-statements": 0, // specify the maximum number of statement allowed in a function (off by default)
247340
"no-bitwise": 0, // disallow use of bitwise operators (off by default)
248341
"no-plusplus": 2, // disallow use of unary operators, ++ and -- (off by default)
249-
250342
//
251343
// eslint-plugin-react
252344
//
253345
// React specific linting rules for ESLint
254346
//
255347
"react/display-name": 0, // Prevent missing displayName in a React component definition
256348
//"react/jsx-quotes": [2, "double", "avoid-escape"], // Enforce quote style for JSX attributes
257-
"jsx-quotes": [
258-
2, "prefer-double"
259-
],
349+
"jsx-quotes": [
350+
2,
351+
"prefer-double"
352+
],
260353
// "react/jsx-quotes": 0,
261354
"react/jsx-no-undef": 2, // Disallow undeclared variables in JSX
262355
"react/jsx-sort-props": 0, // Enforce props alphabetical sorting
263356
"react/jsx-uses-react": 2, // Prevent React to be incorrectly marked as unused
264357
"react/jsx-uses-vars": 2, // Prevent variables used in JSX to be incorrectly marked as unused
265-
// "react/no-did-mount-set-state": [2, "allow-in-func"], // Prevent usage of setState in componentDidMount
266-
// "react/no-did-update-set-state": 2, // Prevent usage of setState in componentDidUpdate
358+
"react/no-did-mount-set-state": 2, // Prevent usage of setState in componentDidMount
359+
"react/no-did-update-set-state": 2, // Prevent usage of setState in componentDidUpdate
267360
"react/no-multi-comp": 0, // Prevent multiple component definition per file
268361
"react/no-unknown-property": 2, // Prevent usage of unknown DOM property
269362
"react/prop-types": 2, // Prevent missing props validation in a React component definition

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ React + React-Router + Redux + ImmutableJS + Bootstrap with with Server side ren
2626
- animate.css ([github :link:](https://github.com/daneden/animate.css))
2727
- classnames ([github :link:](https://github.com/JedWatson/classnames))
2828
- react-motion ([github :link:](https://github.com/chenglou/react-motion))
29-
- Webpack 2.x ([github :link:](https://github.com/webpack/webpack))
29+
- Webpack 3.x ([github :link:](https://github.com/webpack/webpack))
3030
- babel 6+ ([github :link:](https://github.com/babel/babel))
3131
- axios ([github :link:](https://github.com/mzabriskie/axios))
3232

docs/public/assets/app.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/public/assets/app.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/public/assets/app.vendor.bundle.js

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/public/assets/app.vendor.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)