Skip to content
This repository was archived by the owner on Nov 13, 2020. It is now read-only.

Commit c8f78c0

Browse files
Berkeley MartinezBerkeley Martinez
Berkeley Martinez
authored and
Berkeley Martinez
committed
Add eslint and rules
closes #90
1 parent ceb9d8f commit c8f78c0

File tree

5 files changed

+249
-12
lines changed

5 files changed

+249
-12
lines changed

.eslintignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
assets
2+
components/icons/
3+
components/*.js
4+
style/*.js
5+
views/*.js
6+
vendor

.eslintrc

+234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"mocha": true,
5+
"node": true
6+
},
7+
"globals": {
8+
"window": true
9+
},
10+
"parser": "babel-eslint",
11+
"plugins": [
12+
"react"
13+
],
14+
"rules": {
15+
"indent": [2, 2, { "indentSwitchCase": true }],
16+
"no-comma-dangle": 2,
17+
"no-cond-assign": 2,
18+
"no-console": 0,
19+
"no-constant-condition": 2,
20+
"no-control-regex": 2,
21+
"no-debugger": 2,
22+
"no-dupe-keys": 2,
23+
"no-empty": 2,
24+
"no-empty-class": 2,
25+
"no-ex-assign": 2,
26+
"no-extra-boolean-cast": 2,
27+
"no-extra-parens": 0,
28+
"no-extra-semi": 2,
29+
"no-func-assign": 2,
30+
"no-inner-declarations": 2,
31+
"no-invalid-regexp": 2,
32+
"no-irregular-whitespace": 2,
33+
"no-negated-in-lhs": 2,
34+
"no-obj-calls": 2,
35+
"no-regex-spaces": 2,
36+
"no-reserved-keys": 0,
37+
"no-sparse-arrays": 2,
38+
"no-unreachable": 2,
39+
"use-isnan": 2,
40+
"valid-jsdoc": 2,
41+
"valid-typeof": 2,
42+
43+
"block-scoped-var": 0,
44+
"complexity": 0,
45+
"consistent-return": 0,
46+
"curly": 2,
47+
"default-case": 1,
48+
"dot-notation": 0,
49+
"eqeqeq": 1,
50+
"guard-for-in": 1,
51+
"no-alert": 1,
52+
"no-caller": 2,
53+
"no-div-regex": 2,
54+
"no-else-return": 0,
55+
"no-empty-label": 2,
56+
"no-eq-null": 1,
57+
"no-eval": 2,
58+
"no-extend-native": 2,
59+
"no-extra-bind": 2,
60+
"no-fallthrough": 2,
61+
"no-floating-decimal": 2,
62+
"no-implied-eval": 2,
63+
"no-iterator": 2,
64+
"no-labels": 2,
65+
"no-lone-blocks": 2,
66+
"no-loop-func": 0,
67+
"no-multi-spaces": 1,
68+
"no-multi-str": 2,
69+
"no-native-reassign": 2,
70+
"no-new": 2,
71+
"no-new-func": 2,
72+
"no-new-wrappers": 2,
73+
"no-octal": 2,
74+
"no-octal-escape": 2,
75+
"no-process-env": 0,
76+
"no-proto": 2,
77+
"no-redeclare": 1,
78+
"no-return-assign": 2,
79+
"no-script-url": 2,
80+
"no-self-compare": 2,
81+
"no-sequences": 2,
82+
"no-unused-expressions": 2,
83+
"no-void": 1,
84+
"no-warning-comments": [
85+
1,
86+
{
87+
"terms": [
88+
"fixme"
89+
],
90+
"location": "start"
91+
}
92+
],
93+
"no-with": 2,
94+
"radix": 2,
95+
"vars-on-top": 0,
96+
"wrap-iife": [2, "any"],
97+
"yoda": 0,
98+
99+
"strict": 0,
100+
101+
"no-catch-shadow": 2,
102+
"no-delete-var": 2,
103+
"no-label-var": 2,
104+
"no-shadow": 0,
105+
"no-shadow-restricted-names": 2,
106+
"no-undef": 2,
107+
"no-undef-init": 2,
108+
"no-undefined": 1,
109+
"no-unused-vars": 2,
110+
"no-use-before-define": 0,
111+
112+
"handle-callback-err": 2,
113+
"no-mixed-requires": 0,
114+
"no-new-require": 2,
115+
"no-path-concat": 2,
116+
"no-process-exit": 2,
117+
"no-restricted-modules": 0,
118+
"no-sync": 0,
119+
120+
"brace-style": [
121+
2,
122+
"1tbs",
123+
{ "allowSingleLine": true }
124+
],
125+
"camelcase": 1,
126+
"comma-spacing": [
127+
2,
128+
{
129+
"before": false,
130+
"after": true
131+
}
132+
],
133+
"comma-style": [
134+
2, "last"
135+
],
136+
"consistent-this": 0,
137+
"eol-last": 2,
138+
"func-names": 0,
139+
"func-style": 0,
140+
"key-spacing": [
141+
2,
142+
{
143+
"beforeColon": false,
144+
"afterColon": true
145+
}
146+
],
147+
"max-nested-callbacks": 0,
148+
"new-cap": 0,
149+
"new-parens": 2,
150+
"no-array-constructor": 2,
151+
"no-inline-comments": 1,
152+
"no-lonely-if": 1,
153+
"no-mixed-spaces-and-tabs": 2,
154+
"no-multiple-empty-lines": [
155+
1,
156+
{ "max": 2 }
157+
],
158+
"no-nested-ternary": 2,
159+
"no-new-object": 2,
160+
"no-space-before-semi": 2,
161+
"no-spaced-func": 2,
162+
"no-ternary": 0,
163+
"no-trailing-spaces": 1,
164+
"no-underscore-dangle": 0,
165+
"no-wrap-func": 2,
166+
"one-var": 0,
167+
"operator-assignment": 0,
168+
"padded-blocks": 0,
169+
"quote-props": 0,
170+
"quotes": [
171+
2,
172+
"single",
173+
"avoid-escape"
174+
],
175+
"semi": [
176+
2,
177+
"always"
178+
],
179+
"sort-vars": 0,
180+
"space-after-keywords": [
181+
2,
182+
"always",
183+
{ "checkFunctionKeyword": false }
184+
],
185+
"space-after-function-names": "never",
186+
"space-before-blocks": [
187+
2,
188+
"always"
189+
],
190+
"space-in-brackets": 0,
191+
"space-in-parens": 0,
192+
"space-infix-ops": 2,
193+
"space-return-throw-case": 2,
194+
"space-unary-ops": [
195+
1,
196+
{
197+
"words": true,
198+
"nonwords": false
199+
}
200+
],
201+
"spaced-line-comment": [
202+
2,
203+
"always",
204+
{ "exceptions": ["-"] }
205+
],
206+
"wrap-regex": 1,
207+
208+
"max-depth": 0,
209+
"max-len": [
210+
1,
211+
80,
212+
2
213+
],
214+
"max-params": 0,
215+
"max-statements": 0,
216+
"no-bitwise": 1,
217+
"no-plusplus": 0,
218+
219+
"react/display-name": 1,
220+
"react/jsx-boolean-value": 1,
221+
"react/jsx-quotes": [1, "single", "avoid-escape"],
222+
"react/jsx-no-undef": 1,
223+
"react/jsx-sort-props": 1,
224+
"react/jsx-uses-react": 1,
225+
"react/jsx-uses-vars": 1,
226+
"react/no-did-mount-set-state": 2,
227+
"react/no-did-update-set-state": 2,
228+
"react/no-multi-comp": 2,
229+
"react/prop-types": 2,
230+
"react/react-in-jsx-scope": 1,
231+
"react/self-closing-comp": 1,
232+
"react/wrap-multilines": 1
233+
}
234+
}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/*
2+
**/*.log
23
node_modules/*
34
*.iml
45
.DS_Store

gulpfile.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
'use strict';
22
var gulp = require('gulp'),
3-
react = require('gulp-react'),
43
babel = require('gulp-babel'),
5-
rimraf = require('gulp-rimraf'),
6-
gjslint = require('gulp-gjslint'),
4+
eslint = require('gulp-eslint'),
75
sync = require('browser-sync'),
86
merge = require('merge2'),
97
webpack = require('gulp-webpack');
@@ -19,7 +17,6 @@ var paths = {
1917
'./assets/bundle.js',
2018
'./assets/styles.css'
2119
]
22-
2320
};
2421

2522
gulp.task('transpile', function() {
@@ -71,11 +68,8 @@ gulp.task('watch', function() {
7168

7269
gulp.task('lint', function() {
7370
return gulp.src(paths.src)
74-
.pipe(react())
75-
.pipe(gulp.dest('./assets'))
76-
.pipe(gjslint({ flags: ['--nojsdoc'] }))
77-
.pipe(gjslint.reporter('console'))
78-
.pipe(rimraf());
71+
.pipe(eslint())
72+
.pipe(eslint.format());
7973
});
8074

8175
gulp.task('default', ['transpile', 'pack', 'sync', 'watch']);

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
],
77
"repository": "SanderSpies/react-material",
88
"scripts": {
9+
"lint": "eslint --ext=.js,.jsx .",
910
"prepublish": "gulp transpile"
1011
},
1112
"devDependencies": {
13+
"babel-eslint": "^3.1.9",
1214
"babel-loader": "4.0.0",
1315
"browser-sync": "^1.4.0",
1416
"css-loader": "^0.9.0",
17+
"eslint": "^0.21.2",
18+
"eslint-plugin-react": "^2.3.0",
1519
"file-loader": "^0.8.1",
1620
"gulp": "^3.8.8",
1721
"gulp-babel": "^4.0.0",
18-
"gulp-gjslint": "^0.1.2",
19-
"gulp-react": "^1.0.1",
20-
"gulp-rimraf": "^0.1.1",
22+
"gulp-eslint": "^0.12.0",
2123
"gulp-webpack": "^0.3.0",
2224
"html-loader": "0.2.3",
2325
"jsx-loader": "^0.12.0",

0 commit comments

Comments
 (0)