Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/browser/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export function shouldIgnoreOnError(): boolean {
*/
export function ignoreNextOnError(): void {
// onerror should trigger before setTimeout
ignoreOnError += 1;
ignoreOnError++;
setTimeout(() => {
ignoreOnError -= 1;
ignoreOnError--;
});
}

Expand Down
9 changes: 4 additions & 5 deletions packages/browser/test/integration/polyfills/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
observer.observe(node, { characterData: true });

return function () {
// eslint-disable-next-line no-plusplus
node.data = iterations = ++iterations % 2;
};
}
Expand Down Expand Up @@ -468,11 +467,11 @@

var id = 0;
function nextId() {
return (id += 1);
return ++id;
}

function makePromise(promise) {
promise[PROMISE_ID] = id += 1;
promise[PROMISE_ID] = ++id;
promise._state = undefined;
promise._result = undefined;
promise._subscribers = [];
Expand Down Expand Up @@ -535,7 +534,7 @@
if (_then === then && entry._state !== PENDING) {
this._settledAt(entry._state, i, entry._result);
} else if (typeof _then !== 'function') {
this._remaining -= 1;
this._remaining--;
this._result[i] = entry;
} else if (c === Promise$2) {
var promise = new c(noop);
Expand All @@ -562,7 +561,7 @@
var promise = this.promise;

if (promise._state === PENDING) {
this._remaining -= 1;
this._remaining--;

if (state === REJECTED) {
reject(promise, value);
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/baseclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,14 +714,14 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
* Occupies the client with processing and event
*/
protected _process<T>(promise: PromiseLike<T>): void {
this._numProcessing += 1;
this._numProcessing++;
void promise.then(
value => {
this._numProcessing -= 1;
this._numProcessing--;
return value;
},
reason => {
this._numProcessing -= 1;
this._numProcessing--;
return reason;
},
);
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/mocks/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export function makeFakeTransport(delay: number = 2000): {
let sentCount = 0;
const makeTransport = () =>
createTransport({ recordDroppedEvent: () => undefined, textEncoder: new TextEncoder() }, () => {
sendCalled += 1;
sendCalled++;
return new SyncPromise(async res => {
await sleep(delay);
sentCount += 1;
sentCount++;
res({});
});
});
Expand Down
3 changes: 0 additions & 3 deletions packages/eslint-config-sdk/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ module.exports = {
],

rules: {
// We want to prevent usage of unary operators outside of for loops
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],

// Disallow usage of console and alert
'no-console': 'error',
'no-alert': 'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/test/integration.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('useEffect', () => {
onClientEntry(undefined, {
beforeSend: (event: any) => {
expect(event).not.toBeUndefined();
calls += 1;
calls++;

return null;
},
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function getMultipleRequests(
function requestHandler(request: Request): void {
if (urlRgx.test(request.url())) {
try {
reqCount -= 1;
reqCount--;
requestData.push(requestParser(request));

if (reqCount === 0) {
Expand Down
4 changes: 2 additions & 2 deletions packages/integration-tests/utils/web-vitals/cls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function moveBy(elem: HTMLParagraphElement, percent: number): Promise<void
if (elem.getAttribute('id') === 'partial') {
const max = Number(elem.getAttribute('max-steps'));
let current = Number(elem.getAttribute('steps'));
current += 1;
current++;
if (current > max) {
return;
}
Expand All @@ -52,7 +52,7 @@ function howMany(desiredCls: number): { extraSteps: number; createParagraphs: nu
const extraSteps = Math.round((desiredCls - fullRuns * 0.095) / 0.005);
let create = fullRuns;
if (extraSteps > 0) {
create += 1;
create++;
}

return { extraSteps: extraSteps, createParagraphs: create };
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/integrations/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function _createWrappedRequestMethodFactory(

const transaction = parentSpan.transaction;
if (transaction) {
transaction.metadata.propagations += 1;
transaction.metadata.propagations++;
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/replay/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ module.exports = {
'@typescript-eslint/no-floating-promises': 'off',
// TODO (medium-prio): Re-enable this after migration
'jsdoc/require-jsdoc': 'off',
// TODO: Do we even want to turn this on? Why not enable ++?
'no-plusplus': 'off',
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions packages/tracing/src/browser/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export function fetchCallback(
options,
);

activeTransaction.metadata.propagations += 1;
activeTransaction.metadata.propagations++;
}
}
}
Expand Down Expand Up @@ -351,7 +351,7 @@ export function xhrCallback(
handlerData.xhr.setRequestHeader(BAGGAGE_HEADER_NAME, sentryBaggageHeader);
}

activeTransaction.metadata.propagations += 1;
activeTransaction.metadata.propagations++;
} catch (_) {
// Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/src/idletransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class IdleTransaction extends Transaction {
const heartbeatString = Object.keys(this.activities).join('');

if (heartbeatString === this._prevHeartbeatString) {
this._heartbeatCounter += 1;
this._heartbeatCounter++;
} else {
this._heartbeatCounter = 1;
}
Expand Down
1 change: 0 additions & 1 deletion packages/utils/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export function htmlTreeAsString(elem: unknown, keyAttrs?: string[]): string {
const sepLength = separator.length;
let nextStr;

// eslint-disable-next-line no-plusplus
while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
nextStr = _htmlElementAsString(currentElem, keyAttrs);
// bail out if
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ function instrumentDOM(): void {
originalAddEventListener.call(this, type, handler, options);
}

handlerForType.refCount += 1;
handlerForType.refCount++;
} catch (e) {
// Accessing dom properties is always fragile.
// Also allows us to skip `addEventListenrs` calls with no proper `this` context.
Expand Down Expand Up @@ -554,7 +554,7 @@ function instrumentDOM(): void {
const handlerForType = handlers[type];

if (handlerForType) {
handlerForType.refCount -= 1;
handlerForType.refCount--;
// If there are no longer any custom handlers of the current type on this element, we can remove ours, too.
if (handlerForType.refCount <= 0) {
originalRemoveEventListener.call(this, type, handlerForType.handler, options);
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function visit(
const visitValue = visitable[visitKey];
normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo);

numAdded += 1;
numAdded++;
}

// Once we've visited all the branches, remove the parent from memo storage
Expand Down
3 changes: 0 additions & 3 deletions packages/utils/src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ function normalizeArray(parts: string[], allowAboveRoot?: boolean): string[] {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
// eslint-disable-next-line no-plusplus
up++;
} else if (up) {
parts.splice(i, 1);
// eslint-disable-next-line no-plusplus
up--;
}
}

// if the path is allowed to go above the root, restore leading ..s
if (allowAboveRoot) {
// eslint-disable-next-line no-plusplus
for (; up--; up) {
parts.unshift('..');
}
Expand Down
1 change: 0 additions & 1 deletion packages/utils/src/promisebuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export function makePromiseBuffer<T>(limit?: number): PromiseBuffer<T> {
// if all promises resolve in time, cancel the timer and resolve to `true`
buffer.forEach(item => {
void resolvedSyncPromise(item).then(() => {
// eslint-disable-next-line no-plusplus
if (!--counter) {
clearTimeout(capturedSetTimeout);
resolve(true);
Expand Down
1 change: 0 additions & 1 deletion packages/utils/src/stacktrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ function node(getModule?: GetModuleFn): StackLineParserFn {

let methodStart = functionName.lastIndexOf('.');
if (functionName[methodStart - 1] === '.') {
// eslint-disable-next-line no-plusplus
methodStart--;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const generateComponentTrace = (vm?: ViewModel): string => {
const last = tree[tree.length - 1] as any;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (last.constructor === vm.constructor) {
currentRecursiveSequence += 1;
currentRecursiveSequence++;
vm = vm.$parent; // eslint-disable-line no-param-reassign
continue;
} else if (currentRecursiveSequence > 0) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/ensure-bundle-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export async function ensureBundleBuildPrereqs(options: {

while (retries < maxRetries && !checkForBundleDeps(packagesDir, dependencyDirs)) {
console.log('Bundle dependencies not found. Trying again in 5 seconds.');
retries += 1;
retries++;
await sleep(5000);
}

Expand Down