Skip to content

Commit 5386d88

Browse files
committed
first commit
0 parents commit 5386d88

File tree

148 files changed

+118776
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+118776
-0
lines changed

.babelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
"es2015",
4+
"react",
5+
"stage-0",
6+
"stage-2",
7+
"flow"
8+
],
9+
"plugins": [
10+
"react-hot-loader/babel"
11+
],
12+
"env": {
13+
"production": {
14+
"presets": ["react-optimize"]
15+
}
16+
}
17+
}

.eslintrc

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
{
2+
"parser": "babel-eslint",
3+
"env": {
4+
"browser": true,
5+
"node": true,
6+
"es6": true,
7+
"mocha": true
8+
},
9+
10+
"plugins": ["react"],
11+
12+
"ecmaFeatures": {
13+
"arrowFunctions": true,
14+
"binaryLiterals": true,
15+
"blockBindings": true,
16+
"classes": true,
17+
"defaultParams": true,
18+
"destructuring": true,
19+
"forOf": true,
20+
"generators": true,
21+
"modules": true,
22+
"objectLiteralComputedProperties": true,
23+
"objectLiteralDuplicateProperties": true,
24+
"objectLiteralShorthandMethods": true,
25+
"objectLiteralShorthandProperties": true,
26+
"octalLiterals": true,
27+
"regexUFlag": true,
28+
"regexYFlag": true,
29+
"spread": true,
30+
"superInFunctions": true,
31+
"templateStrings": true,
32+
"unicodeCodePointEscapes": true,
33+
"globalReturn": true,
34+
"jsx": true
35+
},
36+
37+
"rules": {
38+
39+
//
40+
//Possible Errors
41+
//
42+
// The following rules point out areas where you might have made mistakes.
43+
//
44+
"comma-dangle": 2, // disallow or enforce trailing commas
45+
"no-cond-assign": 2, // disallow assignment in conditional expressions
46+
"no-console": 1, // disallow use of console (off by default in the node environment)
47+
"no-constant-condition": 2, // disallow use of constant expressions in conditions
48+
"no-control-regex": 2, // disallow control characters in regular expressions
49+
"no-debugger": 2, // disallow use of debugger
50+
"no-dupe-args": 2, // disallow duplicate arguments in functions
51+
"no-dupe-keys": 2, // disallow duplicate keys when creating object literals
52+
"no-duplicate-case": 2, // disallow a duplicate case label.
53+
"no-empty": 2, // disallow empty statements
54+
"no-empty-character-class": 2, // disallow the use of empty character classes in regular expressions
55+
"no-ex-assign": 2, // disallow assigning to the exception in a catch block
56+
"no-extra-boolean-cast": 2, // disallow double-negation boolean casts in a boolean context
57+
"no-extra-parens": 0, // disallow unnecessary parentheses (off by default)
58+
"no-extra-semi": 2, // disallow unnecessary semicolons
59+
"no-func-assign": 2, // disallow overwriting functions written as function declarations
60+
"no-inner-declarations": 2, // disallow function or variable declarations in nested blocks
61+
"no-invalid-regexp": 2, // disallow invalid regular expression strings in the RegExp constructor
62+
"no-irregular-whitespace": 2, // disallow irregular whitespace outside of strings and comments
63+
"no-negated-in-lhs": 2, // disallow negation of the left operand of an in expression
64+
"no-obj-calls": 2, // disallow the use of object properties of the global object (Math and JSON) as functions
65+
"no-regex-spaces": 2, // disallow multiple spaces in a regular expression literal
66+
"no-sparse-arrays": 2, // disallow sparse arrays
67+
"no-unreachable": 2, // disallow unreachable statements after a return, throw, continue, or break statement
68+
"use-isnan": 2, // disallow comparisons with the value NaN
69+
"valid-jsdoc": 2, // Ensure JSDoc comments are valid (off by default)
70+
"valid-typeof": 2, // Ensure that the results of typeof are compared against a valid string
71+
72+
//
73+
// Best Practices
74+
//
75+
// These are rules designed to prevent you from making mistakes.
76+
// They either prescribe a better way of doing something or help you avoid footguns.
77+
//
78+
"prefer-const": ["error", { "destructuring": "any", "ignoreReadBeforeAssign": false }],
79+
"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
80+
"complexity": 0, // specify the maximum cyclomatic complexity allowed in a program (off by default)
81+
"consistent-return": 2, // require return statements to either always or never specify values
82+
"curly": 2, // specify curly brace conventions for all control statements
83+
"default-case": 2, // require default case in switch statements (off by default)
84+
"dot-notation": 2, // encourages use of dot notation whenever possible
85+
"eqeqeq": 2, // require the use of === and !==
86+
"guard-for-in": 2, // make sure for-in loops have an if statement (off by default)
87+
"no-alert": 2, // disallow the use of alert, confirm, and prompt
88+
"no-caller": 2, // disallow use of arguments.caller or arguments.callee
89+
"no-div-regex": 2, // disallow division operators explicitly at beginning of regular expression (off by default)
90+
//"no-else-return": 2, // disallow else after a return in an if (off by default)
91+
//"no-empty-label": 2, // disallow use of labels for anything other then loops and switches
92+
"no-eq-null": 2, // disallow comparisons to null without a type-checking operator (off by default)
93+
"no-eval": 2, // disallow use of eval()
94+
"no-extend-native": 2, // disallow adding to native types
95+
"no-extra-bind": 2, // disallow unnecessary function binding
96+
"no-fallthrough": 2, // disallow fallthrough of case statements
97+
"no-floating-decimal": 2, // disallow the use of leading or trailing decimal points in numeric literals (off by default)
98+
"no-implied-eval": 2, // disallow use of eval()-like methods
99+
"no-iterator": 2, // disallow usage of __iterator__ property
100+
"no-labels": 2, // disallow use of labeled statements
101+
"no-lone-blocks": 2, // disallow unnecessary nested blocks
102+
"no-loop-func": 2, // disallow creation of functions within loops
103+
"no-multi-spaces": 0, // disallow use of multiple spaces
104+
"no-multi-str": 2, // disallow use of multiline strings
105+
"no-native-reassign": 2, // disallow reassignments of native objects
106+
"no-new": 2, // disallow use of new operator when not part of the assignment or comparison
107+
"no-new-func": 2, // disallow use of new operator for Function object
108+
"no-new-wrappers": 2, // disallows creating new instances of String,Number, and Boolean
109+
"no-octal": 2, // disallow use of octal literals
110+
"no-octal-escape": 2, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
111+
"no-param-reassign": 2, // disallow reassignment of function parameters (off by default)
112+
"no-process-env": 2, // disallow use of process.env (off by default)
113+
"no-proto": 2, // disallow usage of __proto__ property
114+
"no-redeclare": 2, // disallow declaring the same variable more then once
115+
"no-return-assign": 2, // disallow use of assignment in return statement
116+
"no-script-url": 2, // disallow use of javascript: urls.
117+
"no-self-compare": 2, // disallow comparisons where both sides are exactly the same (off by default)
118+
"no-sequences": 2, // disallow use of comma operator
119+
"no-throw-literal": 2, // restrict what can be thrown as an exception (off by default)
120+
"no-unused-expressions": 2, // disallow usage of expressions in statement position
121+
"no-void": 2, // disallow use of void operator (off by default)
122+
"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)
123+
"no-with": 2, // disallow use of the with statement
124+
"radix": 2, // require use of the second argument for parseInt() (off by default)
125+
"vars-on-top": 2, // requires to declare all vars on top of their containing scope (off by default)
126+
"wrap-iife": 2, // require immediate function invocation to be wrapped in parentheses (off by default)
127+
"yoda": 2, // require or disallow Yoda conditions
128+
129+
//
130+
// Strict Mode
131+
//
132+
// These rules relate to using strict mode.
133+
//
134+
"strict": 0, // controls location of Use Strict Directives. 0: required by `babel-eslint`
135+
136+
//
137+
// Variables
138+
//
139+
// These rules have to do with variable declarations.
140+
//
141+
"no-catch-shadow": 2, // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
142+
"no-delete-var": 2, // disallow deletion of variables
143+
"no-label-var": 2, // disallow labels that share a name with a variable
144+
"no-shadow": 2, // disallow declaration of variables already declared in the outer scope
145+
"no-shadow-restricted-names": 2, // disallow shadowing of names such as arguments
146+
"no-undef": 2, // disallow use of undeclared variables unless mentioned in a /*global */ block
147+
"no-undef-init": 2, // disallow use of undefined when initializing variables
148+
"no-undefined": 2, // disallow use of undefined variable (off by default)
149+
"no-unused-vars": 2, // disallow declaration of variables that are not used in the code
150+
"no-use-before-define": ["error", { "functions": false, "classes": true }], // disallow use of variables before they are defined
151+
152+
//
153+
//Stylistic Issues
154+
//
155+
// These rules are purely matters of style and are quite subjective.
156+
//
157+
"indent": [1, 2], // this option sets a specific tab width for your code (off by default)
158+
"brace-style": 1, // enforce one true brace style (off by default)
159+
"camelcase": 1, // require camel case names
160+
"comma-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after comma
161+
"comma-style": [1, "last"], // enforce one true comma style (off by default)
162+
"consistent-this": [1, "_this"], // enforces consistent naming when capturing the current execution context (off by default)
163+
"eol-last": 1, // enforce newline at the end of file, with no multiple empty lines
164+
"func-names": 0, // require function expressions to have a name (off by default)
165+
"func-style": 0, // enforces use of function declarations or expressions (off by default)
166+
167+
"max-nested-callbacks": [1, 3], // specify the maximum depth callbacks can be nested (off by default)
168+
"new-cap": [1, {"newIsCap": true, "capIsNew": false}], // require a capital letter for constructors
169+
"new-parens": 1, // disallow the omission of parentheses when invoking a constructor with no arguments
170+
"newline-after-var": 0, // allow/disallow an empty newline after var statement (off by default)
171+
"no-array-constructor": 1, // disallow use of the Array constructor
172+
"no-inline-comments": 0, // disallow comments inline after code (off by default)
173+
"no-lonely-if": 1, // disallow if as the only statement in an else block (off by default)
174+
"no-mixed-spaces-and-tabs": 1, // disallow mixed spaces and tabs for indentation
175+
"no-multiple-empty-lines": [1, {"max": 2}], // disallow multiple empty lines (off by default)
176+
"no-nested-ternary": 1, // disallow nested ternary expressions (off by default)
177+
"no-new-object": 1, // disallow use of the Object constructor
178+
"no-spaced-func": 1, // disallow space between function identifier and application
179+
"no-ternary": 0, // disallow the use of ternary operators (off by default)
180+
//"no-trailing-spaces": 1, // disallow trailing whitespace at the end of lines
181+
//"no-underscore-dangle": 1, // disallow dangling underscores in identifiers
182+
"one-var": [1, "never"], // allow just one var statement per function (off by default)
183+
"operator-assignment": [1, "never"], // require assignment operator shorthand where possible or prohibit it entirely (off by default)
184+
"padded-blocks": [1, "never"], // enforce padding within blocks (off by default)
185+
186+
"quotes": [1, "single"], // specify whether double or single quotes should be used
187+
"semi": [1, "always"], // require or disallow use of semicolons instead of ASI
188+
"semi-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after semicolons
189+
"sort-vars": 0, // sort variables within the same declaration block (off by default)
190+
// "space-after-keywords": [1, "always"], // require a space after certain keywords (off by default)
191+
"space-before-blocks": [1, "always"], // require or disallow space before blocks (off by default)
192+
"space-before-function-paren": [1, {"anonymous": "always", "named": "never"}], // require or disallow space before function opening parenthesis (off by default)
193+
//"space-in-brackets": [1, "never"], // require or disallow spaces inside brackets (off by default)
194+
"space-in-parens": [1, "never"], // require or disallow spaces inside parentheses (off by default)
195+
"space-unary-ops": [1, {"words": true, "nonwords": false}], // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
196+
"spaced-comment": [1, "always"], // require or disallow a space immediately following the // in a line comment (off by default)
197+
"wrap-regex": 0, // require regex literals to be wrapped in parentheses (off by default)
198+
199+
//
200+
// ECMAScript 6
201+
//
202+
// These rules are only relevant to ES6 environments and are off by default.
203+
//
204+
"no-var": 2, // require let or const instead of var (off by default)
205+
"generator-star-spacing": [2, "before"], // enforce the spacing around the * in generator functions (off by default)
206+
207+
//
208+
// Legacy
209+
//
210+
// The following rules are included for compatibility with JSHint and JSLint.
211+
// While the names of the rules may not match up with the JSHint/JSLint counterpart,
212+
// the functionality is the same.
213+
//
214+
"max-depth": [2, 3], // specify the maximum depth that blocks can be nested (off by default)
215+
"max-len": [2, 300, 2], // specify the maximum length of a line in your program (off by default)
216+
"max-params": [2, 5], // limits the number of parameters that can be used in the function declaration. (off by default)
217+
"max-statements": 0, // specify the maximum number of statement allowed in a function (off by default)
218+
"no-bitwise": 0, // disallow use of bitwise operators (off by default)
219+
"no-plusplus": 2, // disallow use of unary operators, ++ and -- (off by default)
220+
221+
//
222+
// eslint-plugin-react
223+
//
224+
// React specific linting rules for ESLint
225+
//
226+
"react/display-name": 0, // Prevent missing displayName in a React component definition
227+
//"react/jsx-quotes": [2, "double", "avoid-escape"], // Enforce quote style for JSX attributes
228+
"jsx-quotes": [
229+
2, "prefer-double"
230+
],
231+
// "react/jsx-quotes": 0,
232+
"react/jsx-no-undef": 2, // Disallow undeclared variables in JSX
233+
"react/jsx-sort-props": 0, // Enforce props alphabetical sorting
234+
"react/jsx-uses-react": 2, // Prevent React to be incorrectly marked as unused
235+
"react/jsx-uses-vars": 2, // Prevent variables used in JSX to be incorrectly marked as unused
236+
// "react/no-did-mount-set-state": [2, "allow-in-func"], // Prevent usage of setState in componentDidMount
237+
// "react/no-did-update-set-state": 2, // Prevent usage of setState in componentDidUpdate
238+
"react/no-multi-comp": 0, // Prevent multiple component definition per file
239+
"react/no-unknown-property": 2, // Prevent usage of unknown DOM property
240+
"react/prop-types": 2, // Prevent missing props validation in a React component definition
241+
"react/react-in-jsx-scope": 2, // Prevent missing React when using JSX
242+
"react/self-closing-comp": 2, // Prevent extra closing tags for components without children
243+
"react/wrap-multilines": 2 // Prevent missing parentheses around multilines JSX
244+
}
245+
}

.flowconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[ignore]
2+
3+
[include]
4+
5+
[libs]
6+
./interfaces/global.js
7+
8+
[options]
9+
module.name_mapper='.*\(.css\)' -> 'CSSModule'
10+
module.system=haste
11+
strip_root=true
12+
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules/
2+
.idea/
3+
*.log
4+
5+
build/
6+
dist/
7+
public/assets/
8+
/coverage
9+
/.nyc_output
10+
11+
.DS_Store

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
language: node_js
3+
node_js:
4+
- 6
5+
- 7
6+
sudo: false
7+
cache:
8+
directories:
9+
- node_modules
10+
before_install:
11+
- export DISPLAY=:99.0
12+
- sh -e /etc/init.d/xvfb start
13+
before_script:
14+
- npm install
15+
after_success: npm run coverage

.vscode/launch.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Launch minimalist prod like server",
8+
"program": "${workspaceRoot}/src/server/index.js"
9+
},
10+
{
11+
"type": "node",
12+
"request": "launch",
13+
"name": "Launch hot reload server",
14+
"program": "${workspaceRoot}/server.hot.reload.js"
15+
},
16+
{
17+
"type": "chrome",
18+
"request": "launch",
19+
"name": "Launch Chrome (for dev/prod bundles)",
20+
"url": "http://localhost:8081",
21+
"webRoot": "${workspaceRoot}"
22+
},
23+
{
24+
"type": "chrome",
25+
"request": "launch",
26+
"name": "Launch Chrome (for hot reload)",
27+
"url": "http://localhost:3000",
28+
"webRoot": "${workspaceRoot}"
29+
}
30+
]
31+
}

0 commit comments

Comments
 (0)