Skip to content

Commit 23835e3

Browse files
committed
feat(project): trade JSHint + JSCS for ESLint
1 parent 7e921b5 commit 23835e3

File tree

6 files changed

+298
-59
lines changed

6 files changed

+298
-59
lines changed

templates/app/.eslintrc

Lines changed: 251 additions & 0 deletions
Large diffs are not rendered by default.

templates/app/.jscsrc

Lines changed: 0 additions & 46 deletions
This file was deleted.

templates/app/_package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@
6363
<%_ /* END CLIENT */ _%>
6464
"autoprefixer": "^6.0.0",
6565
"babel-core": "^6.6.5",
66+
"babel-eslint": "^6.0.4",
6667
"babel-register": "^6.6.5",
6768
<%_ if(filters.flow) { -%>
6869
"flow-bin": "^0.27.0",
6970
"babel-plugin-syntax-flow": "^6.8.0",
7071
"babel-plugin-transform-flow-comments": "^6.8.0",<% } %>
7172
"babel-plugin-transform-class-properties": "^6.6.0",
7273
"babel-plugin-transform-runtime": "^6.6.0",
73-
"babel-preset-es2015": "^6.6.0",<% if(filters.gulp) { %>
74+
"babel-preset-es2015": "^6.6.0",
75+
"eslint": "^2.12.0",<% if(filters.gulp) { %>
7476
"del": "^2.0.2",
7577
"gulp": "^3.9.1",
7678
"gulp-add-src": "^0.2.0",
@@ -84,14 +86,12 @@
8486
"gulp-cache": "^0.4.2",
8587
"gulp-concat": "^2.6.0",
8688
"gulp-env": "^0.4.0",
89+
"gulp-eslint": "^2.0.0",
8790
"gulp-filter": "^4.0.0",
8891
"gulp-imagemin": "^2.2.1",
8992
"gulp-inject": "^4.0.0",
9093
"gulp-istanbul": "~0.10.3",
9194
"gulp-istanbul-enforcer": "^1.0.3",
92-
"gulp-jscs": "^3.0.2",
93-
"gulp-jshint": "^2.0.0",
94-
"jshint": "2.9.2",
9595
"gulp-livereload": "^3.8.0",
9696
"gulp-load-plugins": "^1.0.0-rc.1",
9797
"gulp-clean-css": "^2.0.6",
@@ -133,7 +133,6 @@
133133
"grunt-contrib-copy": "^1.0.0",
134134
"grunt-contrib-cssmin": "^1.0.0",
135135
"grunt-contrib-imagemin": "^1.0.0",
136-
"grunt-contrib-jshint": "^1.0.0",
137136
"grunt-contrib-uglify": "^1.0.0",
138137
"grunt-contrib-watch": "^1.0.0",<% if(filters.jade) { %>
139138
"grunt-contrib-jade": "^1.0.0",<% } %><% if(filters.less) { %>
@@ -143,7 +142,6 @@
143142
"grunt-typings": "~0.1.4",
144143
"grunt-tslint": "~3.1.0",<% } %>
145144
"grunt-google-cdn": "~0.4.0",
146-
"grunt-jscs": "^2.1.0",
147145
"grunt-newer": "^1.1.1",
148146
"grunt-ng-annotate": "^2.0.1",
149147
"grunt-ng-constant": "^2.0.1",
@@ -201,7 +199,6 @@
201199
<%_ /* END WEBPACK */ _%>
202200
"through2": "^2.0.1",
203201
"open": "~0.0.4",
204-
"jshint-stylish": "^2.2.0",
205202
"connect-livereload": "^0.5.3",
206203
"istanbul": "~0.4.1",
207204
"chai": "^3.2.0",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../.eslintrc",
3+
"env": {
4+
"browser": true,
5+
"commonjs": true
6+
}
7+
}

templates/app/gulpfile.babel(gulp).js

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,42 @@ function whenServerReady(cb) {
102102
********************/
103103

104104
let lintClientScripts = lazypipe()<% if(filters.babel) { %>
105-
.pipe(plugins.jshint, `${clientPath}/.jshintrc`)
106-
.pipe(plugins.jshint.reporter, 'jshint-stylish');<% } %><% if(filters.ts) { %>
105+
.pipe(plugins.eslint, `${clientPath}/.eslintrc`)
106+
.pipe(plugins.eslint.format);<% } %><% if(filters.ts) { %>
107107
.pipe(plugins.tslint, require(`./${clientPath}/tslint.json`))
108108
.pipe(plugins.tslint.report, 'verbose', {emitError: false});<% } %>
109109

110+
const lintClientTestScripts = lazypipe()
111+
<%_ if(filters.babel) { -%>
112+
.pipe(plugins.eslint, {
113+
configFile: `${clientPath}/.eslintrc`,
114+
envs: [
115+
'browser',
116+
'es6',
117+
'mocha'
118+
]
119+
})
120+
.pipe(plugins.eslint.format);
121+
<%_ } -%>
122+
<%_ if(filters.ts) { -%>
123+
.pipe(plugins.tslint, require(`./${clientPath}/tslint.json`))
124+
.pipe(plugins.tslint.report, 'verbose', {emitError: false});
125+
<%_ } -%>
126+
110127
let lintServerScripts = lazypipe()
111-
.pipe(plugins.jshint, `${serverPath}/.jshintrc`)
112-
.pipe(plugins.jshint.reporter, 'jshint-stylish');
128+
.pipe(plugins.eslint, `${serverPath}/.eslintrc`)
129+
.pipe(plugins.eslint.format);
113130

114131
let lintServerTestScripts = lazypipe()
115-
.pipe(plugins.jshint, `${serverPath}/.jshintrc-spec`)
116-
.pipe(plugins.jshint.reporter, 'jshint-stylish');
132+
.pipe(plugins.eslint, {
133+
configFile: `${serverPath}/.eslintrc`,
134+
envs: [
135+
'node',
136+
'es6',
137+
'mocha'
138+
]
139+
})
140+
.pipe(plugins.eslint.format);
117141

118142
let transpileServer = lazypipe()
119143
.pipe(plugins.sourcemaps.init)

templates/app/server/.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../.eslintrc",
3+
"env": {
4+
"node": true
5+
}
6+
}

0 commit comments

Comments
 (0)