Skip to content

Commit 889024a

Browse files
authored
chore(eslint): Turn on quotes rules (#4671)
> Enforces the consistent use of either backticks, double, or single quotes. https://eslint.org/docs/rules/quotes Enforces single quotes - which matches our prettier conventions.
1 parent 98d296f commit 889024a

File tree

26 files changed

+49
-44
lines changed

26 files changed

+49
-44
lines changed

packages/browser/src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ export function injectReportDialog(options: ReportDialogOptions = {}): void {
193193

194194
if (!options.eventId) {
195195
if (isDebugBuild()) {
196-
logger.error(`Missing eventId option in showReportDialog call`);
196+
logger.error('Missing eventId option in showReportDialog call');
197197
}
198198
return;
199199
}
200200

201201
if (!options.dsn) {
202202
if (isDebugBuild()) {
203-
logger.error(`Missing dsn option in showReportDialog call`);
203+
logger.error('Missing dsn option in showReportDialog call');
204204
}
205205
return;
206206
}

packages/browser/src/integrations/dedupe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Dedupe implements Integration {
2828
// Juuust in case something goes wrong
2929
try {
3030
if (_shouldDropEvent(currentEvent, self._previousEvent)) {
31-
logger.warn(`Event dropped due to being a duplicate of previously captured event.`);
31+
logger.warn('Event dropped due to being a duplicate of previously captured event.');
3232
return null;
3333
}
3434
} catch (_oO) {

packages/browser/src/stack-parsers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const gecko: StackLineParser = line => {
7272

7373
if (subMatch) {
7474
// throw out eval line/column and use top-most line number
75-
parts[1] = parts[1] || `eval`;
75+
parts[1] = parts[1] || 'eval';
7676
parts[3] = subMatch[1];
7777
parts[4] = subMatch[2];
7878
parts[5] = ''; // no column when eval

packages/browser/src/transports/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function getNativeFetchImplementation(): FetchImpl {
5858
const document = global.document;
5959
let fetchImpl = global.fetch;
6060
// eslint-disable-next-line deprecation/deprecation
61-
if (document && typeof document.createElement === `function`) {
61+
if (document && typeof document.createElement === 'function') {
6262
try {
6363
const sandbox = document.createElement('iframe');
6464
sandbox.hidden = true;

packages/browser/test/package/npm-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ webpack(
4141

4242
function runTests() {
4343
const bundlePath = path.join(__dirname, 'tmp.js');
44-
const { window } = new JSDOM(``, { runScripts: 'dangerously' });
44+
const { window } = new JSDOM('', { runScripts: 'dangerously' });
4545

4646
window.onerror = function () {
4747
console.error('ERROR thrown in manual test:');

packages/browser/test/unit/tracekit/safari.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ describe('Tracekit - Safari Tests', () => {
149149

150150
it('should parse exceptions for safari-extension with frames-only stack', () => {
151151
const SAFARI_EXTENSION_EXCEPTION = {
152-
message: `undefined is not an object (evaluating 'e.groups.includes')`,
153-
name: `TypeError`,
152+
message: "undefined is not an object (evaluating 'e.groups.includes')",
153+
name: 'TypeError',
154154
stack: `isClaimed@safari-extension://com.grammarly.safari.extension.ext2-W8F64X92K3/ee7759dd/Grammarly.js:2:929865
155155
safari-extension://com.grammarly.safari.extension.ext2-W8F64X92K3/ee7759dd/Grammarly.js:2:1588410
156156
promiseReactionJob@[native code]`,
@@ -219,8 +219,8 @@ describe('Tracekit - Safari Tests', () => {
219219

220220
it('should parse exceptions for safari-web-extension with frames-only stack', () => {
221221
const SAFARI_EXTENSION_EXCEPTION = {
222-
message: `undefined is not an object (evaluating 'e.groups.includes')`,
223-
name: `TypeError`,
222+
message: "undefined is not an object (evaluating 'e.groups.includes')",
223+
name: 'TypeError',
224224
stack: `p_@safari-web-extension://46434E60-F5BD-48A4-80C8-A422C5D16897/scripts/content-script.js:29:33314
225225
safari-web-extension://46434E60-F5BD-48A4-80C8-A422C5D16897/scripts/content-script.js:29:56027
226226
promiseReactionJob@[native code]`,

packages/core/src/transports/noop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class NoopTransport implements Transport {
88
*/
99
public sendEvent(_: Event): PromiseLike<Response> {
1010
return resolvedSyncPromise({
11-
reason: `NoopTransport: Event has been skipped because no Dsn is configured.`,
11+
reason: 'NoopTransport: Event has been skipped because no Dsn is configured.',
1212
status: 'skipped',
1313
});
1414
}

packages/core/test/lib/request.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const api = initAPIDetails(ingestDsn, {
1414
sdk: {
1515
integrations: ['AWSLambda'],
1616
name: 'sentry.javascript.browser',
17-
version: `12.31.12`,
18-
packages: [{ name: 'npm:@sentry/browser', version: `12.31.12` }],
17+
version: '12.31.12',
18+
packages: [{ name: 'npm:@sentry/browser', version: '12.31.12' }],
1919
},
2020
});
2121

@@ -77,8 +77,8 @@ describe('eventToSentryRequest', () => {
7777
sdk: {
7878
integrations: ['AWSLambda'],
7979
name: 'sentry.javascript.browser',
80-
version: `12.31.12`,
81-
packages: [{ name: 'npm:@sentry/browser', version: `12.31.12` }],
80+
version: '12.31.12',
81+
packages: [{ name: 'npm:@sentry/browser', version: '12.31.12' }],
8282
},
8383
}),
8484
);
@@ -88,7 +88,7 @@ describe('eventToSentryRequest', () => {
8888
event.sdk = {
8989
integrations: ['Clojure'],
9090
name: 'foo',
91-
packages: [{ name: 'npm:@sentry/clj', version: `12.31.12` }],
91+
packages: [{ name: 'npm:@sentry/clj', version: '12.31.12' }],
9292
version: '1337',
9393
};
9494

@@ -101,8 +101,8 @@ describe('eventToSentryRequest', () => {
101101
integrations: ['Clojure', 'AWSLambda'],
102102
name: 'foo',
103103
packages: [
104-
{ name: 'npm:@sentry/clj', version: `12.31.12` },
105-
{ name: 'npm:@sentry/browser', version: `12.31.12` },
104+
{ name: 'npm:@sentry/clj', version: '12.31.12' },
105+
{ name: 'npm:@sentry/browser', version: '12.31.12' },
106106
],
107107
version: '1337',
108108
},

packages/eslint-config-sdk/src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,7 @@ module.exports = {
254254
// `.filter` and `.reduce`. If we are not, we should be using
255255
// `.forEach()` or an explicit for loop.
256256
'array-callback-return': ['error', { allowImplicit: true }],
257+
258+
quotes: ['error', 'single', { avoidEscape: true }],
257259
},
258260
};

packages/integrations/src/dedupe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Dedupe implements Integration {
2828
// Juuust in case something goes wrong
2929
try {
3030
if (_shouldDropEvent(currentEvent, self._previousEvent)) {
31-
logger.warn(`Event dropped due to being a duplicate of previously captured event.`);
31+
logger.warn('Event dropped due to being a duplicate of previously captured event.');
3232
return null;
3333
}
3434
} catch (_oO) {

0 commit comments

Comments
 (0)