Skip to content

Commit

Permalink
fix(eslint-eqeqeq): updated the eqeqeq rule to match the core repo (o…
Browse files Browse the repository at this point in the history
…pen-telemetry#1485)

* fix(eslint-eqeqeq): updated eqeqeq from off to error

* Revert "fix(eslint-eqeqeq): updated eqeqeq from off to error"

This reverts commit b5ce8e58115d906b2f37c104521a1f31b4075c05.

* fix(eslint-eqeqeq): removed unnecessary changes

* Update plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts

Co-authored-by: Gerhard Stöbich <[email protected]>

---------

Co-authored-by: Gerhard Stöbich <[email protected]>
Co-authored-by: Haddas Bronfman <[email protected]>
  • Loading branch information
3 people authored May 7, 2023
1 parent 7d31b69 commit 5709008
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ module.exports = {
},
rules: {
"quotes": ["error", "single", { "avoidEscape": true }],
"eqeqeq": "off",
"eqeqeq": [
"error",
"smart"
],
"prefer-rest-params": "off",
"no-shadow": "off",
"node/no-deprecated-api": ["warn"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class AwsLambdaInstrumentation extends InstrumentationBase {
return moduleExports;
},
(moduleExports?: LambdaModule) => {
if (moduleExports == undefined) return;
if (moduleExports == null) return;
diag.debug('Removing patch for lambda handler');
this._unwrap(moduleExports, functionName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class DynamodbServiceExtension implements ServiceExtension {
),
};

if (operation == 'BatchGetItem') {
if (operation === 'BatchGetItem') {
spanAttributes[SemanticAttributes.AWS_DYNAMODB_TABLE_NAMES] = Object.keys(
normalizedRequest.commandInput.RequestItems
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ describe('graphql', () => {

it('should attach response hook data to the resulting spans', () => {
const querySpan = spans.find(
span => span.attributes[AttributeNames.OPERATION_TYPE] == 'query'
span => span.attributes[AttributeNames.OPERATION_TYPE] === 'query'
);
const instrumentationResult = querySpan?.attributes[dataAttributeName];
assert.deepStrictEqual(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ export class PinoInstrumentation extends InstrumentationBase {
diag.debug(`Applying patch for pino@${moduleVersion}`);
const instrumentation = this;
const patchedPino = Object.assign((...args: unknown[]) => {
if (args.length == 0) {
if (args.length === 0) {
return pinoModule({
mixin: instrumentation._getMixinFunction(),
});
}

if (args.length == 1) {
if (args.length === 1) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const optsOrStream = args[0] as any;
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class InstanaPropagator implements TextMapPropagator {
setter.set(carrier, INSTANA_TRACE_ID_HEADER, spanContext.traceId);
setter.set(carrier, INSTANA_SPAN_ID_HEADER, spanContext.spanId);
const sampled =
(spanContext.traceFlags & TraceFlags.SAMPLED) == TraceFlags.SAMPLED;
(spanContext.traceFlags & TraceFlags.SAMPLED) === TraceFlags.SAMPLED;
setter.set(carrier, INSTANA_LEVEL_HEADER, sampled ? '1' : '0');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class OTTracePropagator implements TextMapPropagator {

extract(context: Context, carrier: unknown, getter: TextMapGetter): Context {
let traceId = readHeader(carrier, getter, OT_TRACE_ID_HEADER);
if (traceId.length == 16) traceId = `${PADDING}${traceId}`;
if (traceId.length === 16) traceId = `${PADDING}${traceId}`;
const spanId = readHeader(carrier, getter, OT_SPAN_ID_HEADER);
const sampled = readHeader(carrier, getter, OT_SAMPLED_HEADER);
const traceFlags =
Expand Down

0 comments on commit 5709008

Please sign in to comment.