Skip to content

Commit 4d60ccc

Browse files
committed
Replace JSCS and JSHint with ESLint
1 parent c934e1f commit 4d60ccc

16 files changed

+5622
-8687
lines changed

.eslintrc.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
env:
2+
browser: true
3+
commonjs: true
4+
node: true
5+
extends: 'eslint:recommended'
6+
globals:
7+
afterEach: false
8+
beforeEach: false
9+
define: false
10+
describe: false
11+
expect: false
12+
it: false
13+
jasmine: false
14+
ES6Promise: false
15+
Promise: false
16+
SourceMap: false
17+
StackFrame: false
18+
StackTrace: false
19+
StackTraceGPS: false
20+
parserOptions:
21+
ecmaVersion: 5
22+
rules:
23+
indent:
24+
- error
25+
- 4
26+
linebreak-style:
27+
- error
28+
- unix
29+
quotes:
30+
- error
31+
- single
32+
semi:
33+
- error
34+
- always
35+
no-console:
36+
- error
37+
- allow:
38+
- error

.jscsrc

-28
This file was deleted.

.jshintignore

-1
This file was deleted.

.jshintrc

-50
This file was deleted.

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ addons:
1414
services:
1515
- xvfb
1616
before_install:
17-
- export CHROME_BIN=chromium-browser
18-
- export DISPLAY=:99.0
17+
- export CHROME_BIN=chromium-browser
18+
- export DISPLAY=:99.0
1919
before_script:
20-
- npm install
20+
- npm install
2121
script:
22-
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then gulp ci; else gulp pr; fi
22+
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run lint && npm run test-ci; else npm run test-pr; fi

dist/stacktrace-with-promises-and-json-polyfills.js

+24-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace-with-promises-and-json-polyfills.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace.js

+24-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

+2-47
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
var browserify = require('browserify');
22
var concat = require('gulp-concat');
3-
var coveralls = require('gulp-coveralls');
43
var del = require('del');
54
var gulp = require('gulp');
6-
var jshint = require('gulp-jshint');
7-
var karma = require('karma');
8-
var path = require('path');
95
var rename = require('gulp-rename');
106
var runSequence = require('run-sequence');
117
var sourcemaps = require('gulp-sourcemaps');
@@ -20,37 +16,6 @@ var polyfills = [
2016
];
2117
var sources = 'stacktrace.js';
2218

23-
gulp.task('lint', function() {
24-
return gulp.src(sources)
25-
.pipe(jshint())
26-
.pipe(jshint.reporter('default'))
27-
.pipe(jshint.reporter('fail'));
28-
});
29-
30-
gulp.task('test', function(done) {
31-
var server = new karma.Server({
32-
configFile: __dirname + '/karma.conf.js',
33-
singleRun: true
34-
}, done);
35-
server.start();
36-
});
37-
38-
gulp.task('test-pr', ['dist'], function(done) {
39-
new karma.Server({
40-
configFile: __dirname + '/karma.conf.js',
41-
browsers: ['Firefox', 'Chrome_Travis'],
42-
singleRun: true
43-
}, done).start();
44-
});
45-
46-
gulp.task('test-ci', ['dist'], function(done) {
47-
var server = new karma.Server({
48-
configFile: __dirname + '/karma.conf.ci.js',
49-
singleRun: true
50-
}, done);
51-
server.start();
52-
});
53-
5419
gulp.task('dist', function() {
5520
browserify({
5621
entries: sources,
@@ -82,18 +47,8 @@ gulp.task('dist', function() {
8247
.pipe(gulp.dest('dist'));
8348
});
8449

85-
gulp.task('clean', del.bind(null, ['build', 'coverage', 'dist']));
86-
87-
gulp.task('pr', ['lint', 'test-pr'], function() {
88-
gulp.src('./coverage/**/lcov.info')
89-
.pipe(coveralls());
90-
});
91-
92-
gulp.task('ci', ['lint', 'test-ci'], function() {
93-
gulp.src('./coverage/**/lcov.info')
94-
.pipe(coveralls());
95-
});
50+
gulp.task('clean', del.bind(null, ['build', 'dist']));
9651

9752
gulp.task('default', ['clean'], function(cb) {
98-
runSequence('lint', 'dist', 'test', cb);
53+
runSequence('dist', 'test', cb);
9954
});

karma.conf.ci.js

+19-75
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,7 @@ module.exports = function(config) {
55
process.exit(1);
66
}
77

8-
// Commented some of these out just so CI doesn't take forever.
9-
// Check out https://saucelabs.com/platforms for all browser/platform combos
108
var customLaunchers = {
11-
slIOS9: {
12-
appiumVersion: '1.6.3',
13-
base: 'SauceLabs',
14-
browserName: 'Safari',
15-
deviceName: 'iPhone 6s Simulator',
16-
deviceOrientation: 'portrait',
17-
platformName: 'iOS',
18-
platformVersion: '9.3'
19-
},
20-
slIOS10: {
21-
appiumVersion: '1.6.3',
22-
base: 'SauceLabs',
23-
browserName: 'Safari',
24-
deviceName: 'iPhone 7 Simulator',
25-
deviceOrientation: 'portrait',
26-
platformName: 'iOS',
27-
platformVersion: '10.2'
28-
},
29-
slAndroid4: {
30-
base: 'SauceLabs',
31-
browserName: 'Android',
32-
platform: 'Linux',
33-
version: '4.4'
34-
},
35-
slAndroid5: {
36-
base: 'SauceLabs',
37-
browserName: 'Android',
38-
platform: 'Linux',
39-
version: '5.1'
40-
},
41-
slAndroid6: {
42-
base: 'SauceLabs',
43-
browserName: 'Android',
44-
platform: 'Linux',
45-
version: '6.0'
46-
},
479
slChrome: {
4810
base: 'SauceLabs',
4911
browserName: 'chrome',
@@ -59,35 +21,22 @@ module.exports = function(config) {
5921
browserName: 'firefox',
6022
version: 'latest'
6123
},
62-
slSafari8: {
24+
slFirefoxBeta: {
6325
base: 'SauceLabs',
64-
browserName: 'safari',
65-
platform: 'OS X 10.10',
66-
version: '8.0'
67-
},
68-
slSafari9: {
69-
base: 'SauceLabs',
70-
browserName: 'safari',
71-
platform: 'OS X 10.11',
72-
version: '9.0'
26+
browserName: 'firefox',
27+
version: 'beta'
7328
},
74-
slSafari10: {
29+
slSafari: {
7530
base: 'SauceLabs',
7631
browserName: 'safari',
77-
platform: 'macOS 10.12',
78-
version: '10.0'
79-
},
80-
slEdge14: {
81-
base: 'SauceLabs',
82-
browserName: 'microsoftedge',
83-
platform: 'Windows 10',
84-
version: '14.14393'
32+
platform: 'OS X 10.14',
33+
version: 'latest'
8534
},
86-
slEdge13: {
35+
slEdge: {
8736
base: 'SauceLabs',
8837
browserName: 'microsoftedge',
8938
platform: 'Windows 10',
90-
version: '13.10586'
39+
version: 'latest'
9140
},
9241
slIE11: {
9342
base: 'SauceLabs',
@@ -98,28 +47,23 @@ module.exports = function(config) {
9847
slIE10: {
9948
base: 'SauceLabs',
10049
browserName: 'internet explorer',
101-
platform: 'Windows 8',
50+
platform: 'Windows 7',
10251
version: '10'
10352
},
10453
slIE9: {
10554
base: 'SauceLabs',
10655
browserName: 'internet explorer',
10756
platform: 'Windows 7',
108-
version: '9.0'
57+
version: '10',
58+
'x-ua-compatible': 'IE=EmulateIE9'
59+
},
60+
slIE8: {
61+
base: 'SauceLabs',
62+
browserName: 'internet explorer',
63+
platform: 'Windows 7',
64+
version: '10',
65+
'x-ua-compatible': 'IE=EmulateIE8'
10966
}
110-
// Too unreliable on Sauce :(
111-
// slIE8: {
112-
// base: 'SauceLabs',
113-
// browserName: 'internet explorer',
114-
// platform: 'Windows XP',
115-
// version: '8.0'
116-
// }
117-
//slIE7: {
118-
// base: 'SauceLabs',
119-
// browserName: 'internet explorer',
120-
// platform: 'Windows XP',
121-
// version: '7'
122-
//}
12367
};
12468

12569
config.set({
@@ -155,7 +99,7 @@ module.exports = function(config) {
15599
},
156100
customLaunchers: customLaunchers,
157101
browsers: Object.keys(customLaunchers),
158-
reporters: ['progress', 'saucelabs', 'coverage'],
102+
reporters: ['progress', 'saucelabs', 'coverage', 'coveralls'],
159103
preprocessors: {
160104
'stacktrace.js': 'coverage'
161105
},

karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function(config) {
2424
}
2525
},
2626
//browsers: ['ChromeCanary', 'Firefox'],
27-
browsers: ['PhantomJS2'],
27+
browsers: ['PhantomJS'],
2828
singleRun: false
2929
});
3030
};

0 commit comments

Comments
 (0)