Skip to content

Commit a0a50a7

Browse files
author
David Silva
committed
Added .eslint, sass files
1 parent dcfeb6b commit a0a50a7

Some content is hidden

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

71 files changed

+9429
-185
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build
2+
node_modules
3+
coverage
4+
webpack.*.js
5+
*server.js

.eslintrc

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
{
2+
"parser": "babel-eslint", // https://github.com/babel/babel-eslint
3+
"env": {
4+
"browser": true,
5+
"node": true,
6+
"mocha": true,
7+
"jest": true
8+
},
9+
"globals": {
10+
"expect": true,
11+
"sinon": true,
12+
"__DEV__": true
13+
},
14+
"ecmaFeatures": {
15+
"arrowFunctions": true,
16+
"blockBindings": true,
17+
"classes": true,
18+
"defaultParams": true,
19+
"destructuring": true,
20+
"forOf": true,
21+
"generators": false,
22+
"modules": true,
23+
"objectLiteralComputedProperties": true,
24+
"objectLiteralDuplicateProperties": false,
25+
"objectLiteralShorthandMethods": true,
26+
"objectLiteralShorthandProperties": true,
27+
"spread": true,
28+
"superInFunctions": true,
29+
"templateStrings": true,
30+
"jsx": true
31+
},
32+
"rules": {
33+
"no-var": 2, // http://eslint.org/docs/rules/no-var
34+
"prefer-const": 2, // http://eslint.org/docs/rules/prefer-const
35+
36+
/**
37+
* Variables
38+
*/
39+
"no-shadow": 2, // http://eslint.org/docs/rules/no-shadow
40+
"no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names
41+
"no-undef": 2, // http://eslint.org/docs/rules/no-undef
42+
"no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars
43+
"vars": "local",
44+
"args": "after-used"
45+
}],
46+
"no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define
47+
48+
/**
49+
* Possible errors
50+
*/
51+
"no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign
52+
"no-console": 0, // http://eslint.org/docs/rules/no-console
53+
"no-debugger": 1, // http://eslint.org/docs/rules/no-debugger
54+
"no-alert": 1, // http://eslint.org/docs/rules/no-alert
55+
"no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition
56+
"no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys
57+
"no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case
58+
"no-empty": 2, // http://eslint.org/docs/rules/no-empty
59+
"no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign
60+
"no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast
61+
"no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi
62+
"no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign
63+
"no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations
64+
"no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp
65+
"no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace
66+
"no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls
67+
"no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays
68+
"no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable
69+
"use-isnan": 2, // http://eslint.org/docs/rules/use-isnan
70+
"block-scoped-var": 2, // http://eslint.org/docs/rules/block-scoped-var
71+
72+
/**
73+
* Best practices
74+
*/
75+
"consistent-return": 2, // http://eslint.org/docs/rules/consistent-return
76+
"curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly
77+
"default-case": 2, // http://eslint.org/docs/rules/default-case
78+
"dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation
79+
"allowKeywords": true
80+
}],
81+
"eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq
82+
"guard-for-in": 2, // http://eslint.org/docs/rules/guard-for-in
83+
"no-caller": 2, // http://eslint.org/docs/rules/no-caller
84+
"no-else-return": 2, // http://eslint.org/docs/rules/no-else-return
85+
"no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null
86+
"no-eval": 2, // http://eslint.org/docs/rules/no-eval
87+
"no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native
88+
"no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind
89+
"no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough
90+
"no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal
91+
"no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval
92+
"no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks
93+
"no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func
94+
"no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str
95+
"no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign
96+
"no-new": 2, // http://eslint.org/docs/rules/no-new
97+
"no-new-func": 2, // http://eslint.org/docs/rules/no-new-func
98+
"no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers
99+
"no-octal": 2, // http://eslint.org/docs/rules/no-octal
100+
"no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape
101+
"no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign
102+
"no-proto": 2, // http://eslint.org/docs/rules/no-proto
103+
"no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare
104+
"no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign
105+
"no-script-url": 2, // http://eslint.org/docs/rules/no-script-url
106+
"no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare
107+
"no-sequences": 2, // http://eslint.org/docs/rules/no-sequences
108+
"no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal
109+
"no-with": 2, // http://eslint.org/docs/rules/no-with
110+
"radix": 2, // http://eslint.org/docs/rules/radix
111+
"vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top
112+
"yoda": 2, // http://eslint.org/docs/rules/yoda
113+
114+
/**
115+
* Style
116+
*/
117+
"indent": [
118+
2,
119+
4,
120+
{ "SwitchCase": 1 }
121+
], // http://eslint.org/docs/rules/indent
122+
"brace-style": [
123+
2,
124+
"1tbs", {
125+
"allowSingleLine": true
126+
}
127+
], // http://eslint.org/docs/rules/brace-style
128+
"quotes": [
129+
2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes
130+
],
131+
"camelcase": [2, { // http://eslint.org/docs/rules/camelcase
132+
"properties": "never"
133+
}],
134+
"comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing
135+
"before": false,
136+
"after": true
137+
}],
138+
"comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style
139+
"eol-last": 2, // http://eslint.org/docs/rules/eol-last
140+
"func-names": 1, // http://eslint.org/docs/rules/func-names
141+
"key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing
142+
"beforeColon": false,
143+
"afterColon": true
144+
}],
145+
"new-cap": [0, { // http://eslint.org/docs/rules/new-cap
146+
"newIsCap": true
147+
}],
148+
"no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines
149+
"max": 2
150+
}],
151+
"no-nested-ternary": 2, // http://eslint.org/docs/rules/no-nested-ternary
152+
"no-new-object": 2, // http://eslint.org/docs/rules/no-new-object
153+
"no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func
154+
"no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces
155+
"no-extra-parens": [2, "functions"], // http://eslint.org/docs/rules/no-extra-parens
156+
"no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle
157+
"one-var": [2, "never"], // http://eslint.org/docs/rules/one-var
158+
"padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks
159+
"semi": [2, "always"], // http://eslint.org/docs/rules/semi
160+
"semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing
161+
"before": false,
162+
"after": true
163+
}],
164+
"space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks
165+
"space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren
166+
"space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops
167+
"spaced-comment": [2, "always", {// http://eslint.org/docs/rules/spaced-comment
168+
"exceptions": ["-", "+"],
169+
"markers": ["=", "!"] // space here to support sprockets directives
170+
}],
171+
// React
172+
"jsx-quotes": [2, "prefer-double"],
173+
"react/display-name": 0,
174+
"react/jsx-boolean-value": 1,
175+
"react/jsx-no-undef": 2,
176+
"react/jsx-sort-prop-types": 0,
177+
"react/jsx-sort-props": 0,
178+
"react/jsx-uses-react": 1,
179+
"react/jsx-uses-vars": 1,
180+
"react/no-did-mount-set-state": [2],
181+
"react/no-did-update-set-state": 2,
182+
"react/no-multi-comp": 2,
183+
"react/no-unknown-property": 2,
184+
"react/prop-types": 2,
185+
"react/react-in-jsx-scope": 2,
186+
"react/self-closing-comp": 2,
187+
"react/sort-comp": 2,
188+
"react/jsx-wrap-multilines": 2
189+
},
190+
"plugins": [
191+
"react"
192+
]
193+
}

config-overrides.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
'use strict';
2+
3+
const path = require('path');
4+
5+
module.exports = (config) => {
6+
config.module.loaders.push(
7+
{
8+
enforce: 'pre',
9+
test: /\.js?$/,
10+
exclude: /node_modules/,
11+
loader: 'eslint-loader',
12+
options: {
13+
configFile: '.eslintrc',
14+
failOnWarning: false,
15+
failOnError: false
16+
}
17+
},
18+
{
19+
test: /\.scss/,
20+
use: [
21+
{
22+
loader: 'style-loader'
23+
},
24+
{
25+
loader: 'css-loader',
26+
options: {
27+
modules: true,
28+
localIdentName: 'assets/[name]---[local]---[hash:base64:5]',
29+
}
30+
},
31+
{
32+
loader: 'sass-loader',
33+
options: {
34+
data: `@import "${path.join(__dirname, 'app/styles/_mixins.scss')}";`
35+
}
36+
}
37+
]
38+
},
39+
{
40+
test: /\.css$/,
41+
use: [ 'style-loader', 'css-loader' ]
42+
},
43+
{ test: /\.woff(2)?(\?[a-z0-9#=&.]+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
44+
{ test: /\.(ttf|eot|svg)(\?[a-z0-9#=&.]+)?$/, loader: 'file-loader?name=assets/fonts/[name].[ext]' },
45+
{ test: /\.(gif|jpg|png)(\?[a-z0-9#=&.]+)?$/, loader: 'file-loader?name=assets/images/[name].[ext]' }
46+
);
47+
return config;
48+
};

0 commit comments

Comments
 (0)