Skip to content

Commit f5184d7

Browse files
committed
Dev infrastructure improvements
- Converted build to npm scripts - Converted to ESLint and fixed issues - Updated dev dependencies to remove all security alerts
1 parent f58b4f6 commit f5184d7

15 files changed

+3934
-10131
lines changed

.eslintrc.yml

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

.jscsrc

-28
This file was deleted.

.jshintrc

-41
This file was deleted.

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
language: node_js
22
sudo: required
33
dist: xenial
4-
node_js:
5-
- 8
4+
node_js: 8
65
addons:
76
sauce_connect: true
87
firefox: latest
@@ -19,4 +18,4 @@ before_install:
1918
before_script:
2019
- npm install
2120
script:
22-
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then gulp ci; else gulp test-pr; fi
21+
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run lint && npm run test-ci; else npm run test-pr; fi

dist/error-stack-parser.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
}(this, function ErrorStackParser(StackFrame) {
1414
'use strict';
1515

16-
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+\:\d+/;
17-
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+\:\d+|\(native\))/m;
18-
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code\])?$/;
16+
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
17+
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
18+
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
1919

2020
return {
2121
/**
@@ -43,8 +43,8 @@
4343
return [urlLike];
4444
}
4545

46-
var regExp = /(.+?)(?:\:(\d+))?(?:\:(\d+))?$/;
47-
var parts = regExp.exec(urlLike.replace(/[\(\)]/g, ''));
46+
var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
47+
var parts = regExp.exec(urlLike.replace(/[()]/g, ''));
4848
return [parts[1], parts[2] || undefined, parts[3] || undefined];
4949
},
5050

@@ -56,7 +56,7 @@
5656
return filtered.map(function(line) {
5757
if (line.indexOf('(eval ') > -1) {
5858
// Throw away eval information until we implement stacktrace.js/stackframe#8
59-
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^\()]*)|(\)\,.*$)/g, '');
59+
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
6060
}
6161
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
6262

@@ -91,7 +91,7 @@
9191
return filtered.map(function(line) {
9292
// Throw away eval information until we implement stacktrace.js/stackframe#8
9393
if (line.indexOf(' > eval') > -1) {
94-
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g, ':$1');
94+
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
9595
}
9696

9797
if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {
@@ -179,11 +179,11 @@
179179
var locationParts = this.extractLocation(tokens.pop());
180180
var functionCall = (tokens.shift() || '');
181181
var functionName = functionCall
182-
.replace(/<anonymous function(: (\w+))?>/, '$2')
183-
.replace(/\([^\)]*\)/g, '') || undefined;
182+
.replace(/<anonymous function(: (\w+))?>/, '$2')
183+
.replace(/\([^)]*\)/g, '') || undefined;
184184
var argsRaw;
185-
if (functionCall.match(/\(([^\)]*)\)/)) {
186-
argsRaw = functionCall.replace(/^[^\(]+\(([^\)]*)\)$/, '$1');
185+
if (functionCall.match(/\(([^)]*)\)/)) {
186+
argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1');
187187
}
188188
var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?
189189
undefined : argsRaw.split(',');

dist/error-stack-parser.min.js

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

dist/error-stack-parser.min.js.map

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

error-stack-parser.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
}(this, function ErrorStackParser(StackFrame) {
1414
'use strict';
1515

16-
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+\:\d+/;
17-
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+\:\d+|\(native\))/m;
18-
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code\])?$/;
16+
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
17+
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
18+
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
1919

2020
return {
2121
/**
@@ -43,8 +43,8 @@
4343
return [urlLike];
4444
}
4545

46-
var regExp = /(.+?)(?:\:(\d+))?(?:\:(\d+))?$/;
47-
var parts = regExp.exec(urlLike.replace(/[\(\)]/g, ''));
46+
var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
47+
var parts = regExp.exec(urlLike.replace(/[()]/g, ''));
4848
return [parts[1], parts[2] || undefined, parts[3] || undefined];
4949
},
5050

@@ -56,7 +56,7 @@
5656
return filtered.map(function(line) {
5757
if (line.indexOf('(eval ') > -1) {
5858
// Throw away eval information until we implement stacktrace.js/stackframe#8
59-
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^\()]*)|(\)\,.*$)/g, '');
59+
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
6060
}
6161
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
6262

@@ -91,7 +91,7 @@
9191
return filtered.map(function(line) {
9292
// Throw away eval information until we implement stacktrace.js/stackframe#8
9393
if (line.indexOf(' > eval') > -1) {
94-
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g, ':$1');
94+
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
9595
}
9696

9797
if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {
@@ -179,11 +179,11 @@
179179
var locationParts = this.extractLocation(tokens.pop());
180180
var functionCall = (tokens.shift() || '');
181181
var functionName = functionCall
182-
.replace(/<anonymous function(: (\w+))?>/, '$2')
183-
.replace(/\([^\)]*\)/g, '') || undefined;
182+
.replace(/<anonymous function(: (\w+))?>/, '$2')
183+
.replace(/\([^)]*\)/g, '') || undefined;
184184
var argsRaw;
185-
if (functionCall.match(/\(([^\)]*)\)/)) {
186-
argsRaw = functionCall.replace(/^[^\(]+\(([^\)]*)\)$/, '$1');
185+
if (functionCall.match(/\(([^)]*)\)/)) {
186+
argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1');
187187
}
188188
var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?
189189
undefined : argsRaw.split(',');

gulpfile.js

-68
This file was deleted.

0 commit comments

Comments
 (0)