Skip to content

chore(various): Autoformat JS files #4726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 17, 2022
11 changes: 10 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ module.exports = {
ecmaVersion: 2018,
},
extends: ['@sentry-internal/sdk'],
ignorePatterns: ['coverage/**', 'build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**', 'test/manual/**'],
ignorePatterns: [
'coverage/**',
'build/**',
'dist/**',
'esm/**',
'examples/**',
'scripts/**',
'test/manual/**',
'types/**',
],
overrides: [
{
files: ['*.ts', '*.tsx', '*.d.ts'],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ package. Please refer to the README and instructions of those SDKs for more deta
- [`@sentry/node`](https://github.com/getsentry/sentry-javascript/tree/master/packages/node): SDK for Node, including
integrations for Express, Koa, Loopback, Sails and Connect
- [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular): browser SDK with Angular integration enabled
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): browser SDK with React integration enabled
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): browser SDK with React integration enabled
- [`@sentry/ember`](https://github.com/getsentry/sentry-javascript/tree/master/packages/ember): browser SDK with Ember integration enabled
- [`@sentry/vue`](https://github.com/getsentry/sentry-javascript/tree/master/packages/vue): browser SDK with Vue integration enabled
- [`@sentry/gatsby`](https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby): SDK for Gatsby
Expand Down
4 changes: 4 additions & 0 deletions packages/browser/test/integration/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"arrowParens": "avoid",
"printWidth": 120,
"proseWrap": "always",
"singleQuote": true,
"trailingComma": "es5"
}
140 changes: 70 additions & 70 deletions packages/browser/test/integration/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,83 +3,83 @@

module.exports = {
bs_android_4: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy Note 4",
os: "android",
os_version: "4.4",
base: 'BrowserStack',
browser: 'Android Browser',
device: 'Samsung Galaxy Note 4',
os: 'android',
os_version: '4.4',
real_mobile: true,
browser_version: null,
},
bs_android_5: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy S6",
os: "android",
os_version: "5.0",
base: 'BrowserStack',
browser: 'Android Browser',
device: 'Samsung Galaxy S6',
os: 'android',
os_version: '5.0',
real_mobile: true,
browser_version: null,
},
bs_android_6: {
base: "BrowserStack",
browser: "Android Browser",
device: "Google Nexus 6",
os: "android",
os_version: "6.0",
base: 'BrowserStack',
browser: 'Android Browser',
device: 'Google Nexus 6',
os: 'android',
os_version: '6.0',
real_mobile: true,
browser_version: null,
},
bs_android_7: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy Note 8",
os: "android",
os_version: "7.1",
base: 'BrowserStack',
browser: 'Android Browser',
device: 'Samsung Galaxy Note 8',
os: 'android',
os_version: '7.1',
real_mobile: true,
browser_version: null,
},
bs_android_8: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy Note 9",
os: "android",
os_version: "8.1",
base: 'BrowserStack',
browser: 'Android Browser',
device: 'Samsung Galaxy Note 9',
os: 'android',
os_version: '8.1',
real_mobile: true,
browser_version: null,
},
bs_android_9: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy Note 10 Plus",
os: "android",
os_version: "9.0",
base: 'BrowserStack',
browser: 'Android Browser',
device: 'Samsung Galaxy Note 10 Plus',
os: 'android',
os_version: '9.0',
real_mobile: true,
browser_version: null,
},
bs_android_10: {
base: "BrowserStack",
browser: "Android Browser",
device: "Google Pixel 4 XL",
os: "android",
os_version: "10.0",
base: 'BrowserStack',
browser: 'Android Browser',
device: 'Google Pixel 4 XL',
os: 'android',
os_version: '10.0',
real_mobile: true,
browser_version: null,
},
bs_ios_12: {
base: "BrowserStack",
browser: "Mobile Safari",
device: "iPhone XS",
os: "ios",
os_version: "12",
base: 'BrowserStack',
browser: 'Mobile Safari',
device: 'iPhone XS',
os: 'ios',
os_version: '12',
real_mobile: true,
browser_version: null,
},
bs_ios_13: {
base: "BrowserStack",
browser: "Mobile Safari",
device: "iPhone 11",
os: "ios",
os_version: "13",
base: 'BrowserStack',
browser: 'Mobile Safari',
device: 'iPhone 11',
os: 'ios',
os_version: '13',
real_mobile: true,
browser_version: null,
},
Expand All @@ -94,47 +94,47 @@ module.exports = {
// real_mobile: null,
// },
bs_ie11: {
base: "BrowserStack",
browser: "IE",
browser_version: "11.0",
os: "Windows",
os_version: "10",
base: 'BrowserStack',
browser: 'IE',
browser_version: '11.0',
os: 'Windows',
os_version: '10',
device: null,
real_mobile: null,
},
bs_safari: {
base: "BrowserStack",
browser: "Safari",
browser_version: "latest",
os: "OS X",
os_version: "Catalina",
base: 'BrowserStack',
browser: 'Safari',
browser_version: 'latest',
os: 'OS X',
os_version: 'Catalina',
device: null,
real_mobile: null,
},
bs_edge: {
base: "BrowserStack",
browser: "Edge",
browser_version: "latest",
os: "Windows",
os_version: "10",
base: 'BrowserStack',
browser: 'Edge',
browser_version: 'latest',
os: 'Windows',
os_version: '10',
device: null,
real_mobile: null,
},
bs_firefox: {
base: "BrowserStack",
browser: "Firefox",
browser_version: "latest",
os: "Windows",
os_version: "10",
base: 'BrowserStack',
browser: 'Firefox',
browser_version: 'latest',
os: 'Windows',
os_version: '10',
device: null,
real_mobile: null,
},
bs_chrome: {
base: "BrowserStack",
browser: "Chrome",
browser_version: "latest",
os: "Windows",
os_version: "10",
base: 'BrowserStack',
browser: 'Chrome',
browser_version: 'latest',
os: 'Windows',
os_version: '10',
device: null,
real_mobile: null,
},
Expand Down
35 changes: 12 additions & 23 deletions packages/browser/test/integration/common/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,44 @@ var breadcrumbHints = [];
// Oh dear IE10...
var dsn =
document.location.protocol +
"//public@" +
'//public@' +
document.location.hostname +
(document.location.port ? ":" + document.location.port : "") +
"/1";
(document.location.port ? ':' + document.location.port : '') +
'/1';

function initSDK() {
Sentry.init({
dsn: dsn,
integrations: [new Sentry.Integrations.Dedupe()],
attachStacktrace: true,
ignoreErrors: ["ignoreErrorTest"],
denyUrls: ["foo.js"],
beforeSend: function(event, eventHint) {
ignoreErrors: ['ignoreErrorTest'],
denyUrls: ['foo.js'],
beforeSend: function (event, eventHint) {
events.push(event);
eventHints.push(eventHint);
return event;
},
beforeBreadcrumb: function(breadcrumb, breadcrumbHint) {
beforeBreadcrumb: function (breadcrumb, breadcrumbHint) {
// Filter console logs as we use them for debugging *a lot* and they are not *that* important
// But allow then if we explicitly say so (for one of integration tests)
if (
breadcrumb.category === "console" &&
!window.allowConsoleBreadcrumbs
) {
if (breadcrumb.category === 'console' && !window.allowConsoleBreadcrumbs) {
return null;
}

// One of the tests use manually created breadcrumb without eventId and we want to let it through
if (
breadcrumb.category.indexOf("sentry") === 0 &&
breadcrumb.event_id &&
!window.allowSentryBreadcrumbs
) {
if (breadcrumb.category.indexOf('sentry') === 0 && breadcrumb.event_id && !window.allowSentryBreadcrumbs) {
return null;
}

if (
breadcrumb.type === "http" &&
(breadcrumb.data.url.indexOf("test.js") !== -1 ||
breadcrumb.data.url.indexOf("frame.html") !== -1)
breadcrumb.type === 'http' &&
(breadcrumb.data.url.indexOf('test.js') !== -1 || breadcrumb.data.url.indexOf('frame.html') !== -1)
) {
return null;
}

// Filter "refresh" like navigation which occurs in Mocha when testing on Android 4
if (
breadcrumb.category === "navigation" &&
breadcrumb.data.to === breadcrumb.data.from
) {
if (breadcrumb.category === 'navigation' && breadcrumb.data.to === breadcrumb.data.from) {
return null;
}

Expand Down
10 changes: 5 additions & 5 deletions packages/browser/test/integration/common/triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ function foo2() {

function throwNonError() {
try {
throw { foo: "bar" };
throw { foo: 'bar' };
} catch (o_O) {
Sentry.captureException(o_O);
}
}

function throwError(message) {
// eslint-disable-next-line no-param-reassign
message = message || "foo";
message = message || 'foo';
try {
throw new Error(message);
} catch (o_O) {
Expand All @@ -34,7 +34,7 @@ function throwError(message) {

function throwRandomError() {
try {
throw new Error("Exception no " + (Date.now() + Math.random()));
throw new Error('Exception no ' + (Date.now() + Math.random()));
} catch (o_O) {
Sentry.captureException(o_O);
}
Expand All @@ -47,12 +47,12 @@ function throwSameConsecutiveErrors(message) {

function captureMessage(message) {
// eslint-disable-next-line no-param-reassign
message = message || "message";
message = message || 'message';
Sentry.captureMessage(message);
}

function captureRandomMessage() {
Sentry.captureMessage("Message no " + (Date.now() + Math.random()));
Sentry.captureMessage('Message no ' + (Date.now() + Math.random()));
}

function captureSameConsecutiveMessages(message) {
Expand Down
Loading