From 462a76225f0ca45e867817c33bd3c46c963abdb4 Mon Sep 17 00:00:00 2001 From: Naseem Date: Mon, 13 Jan 2020 23:02:15 -0500 Subject: [PATCH] fix: lint --- examples/basic-tracer-node/index.js | 17 +++-------------- examples/dns/client.js | 1 + examples/grpc/helloworld_grpc_pb.js | 11 +++++++++++ examples/grpc/helloworld_pb.js | 10 ++++++++++ examples/opentracing-shim/shim.js | 12 ++++++------ examples/postgres/client.js | 1 + examples/postgres/server.js | 1 + examples/redis/client.js | 1 + .../tracer-web/examples/document-load/index.js | 2 ++ 9 files changed, 36 insertions(+), 20 deletions(-) diff --git a/examples/basic-tracer-node/index.js b/examples/basic-tracer-node/index.js index ac177d498e7..e16b95b8988 100644 --- a/examples/basic-tracer-node/index.js +++ b/examples/basic-tracer-node/index.js @@ -29,18 +29,12 @@ registry.addSpanProcessor(new SimpleSpanProcessor(exporter)); // Initialize the OpenTelemetry APIs to use the BasicTracerRegistry bindings opentelemetry.initGlobalTracerRegistry(registry); -const tracer = opentelemetry.getTracer('example-basic-tracer-node') +const tracer = opentelemetry.getTracer('example-basic-tracer-node'); // Create a span. A span must be closed. -<<<<<<< HEAD -const parentSpan = opentelemetry.getTracer().startSpan('main'); +const parentSpan = tracer.startSpan('main'); for (let i = 0; i < 10; i += 1) { doWork(parentSpan); -======= -const span = tracer.startSpan('main'); -for (let i = 0; i < 10; i++) { - doWork(span); ->>>>>>> master } // Be sure to end the span. parentSpan.end(); @@ -51,13 +45,8 @@ exporter.shutdown(); function doWork(parent) { // Start another span. In this example, the main method already started a // span, so that'll be the parent span, and this will be a child span. -<<<<<<< HEAD - const span = opentelemetry.getTracer().startSpan('doWork', { - parent, -======= const span = tracer.startSpan('doWork', { - parent: parent ->>>>>>> master + parent, }); // simulate some random work. diff --git a/examples/dns/client.js b/examples/dns/client.js index 7aa01482146..1ea52d6ce02 100644 --- a/examples/dns/client.js +++ b/examples/dns/client.js @@ -1,6 +1,7 @@ 'use strict'; const tracer = require('./tracer')('example-dns'); +// eslint-disable-next-line import/order const dns = require('dns').promises; /** A function which makes a dns lookup and handles response. */ diff --git a/examples/grpc/helloworld_grpc_pb.js b/examples/grpc/helloworld_grpc_pb.js index 1e39a0f46ab..c32727f8daa 100644 --- a/examples/grpc/helloworld_grpc_pb.js +++ b/examples/grpc/helloworld_grpc_pb.js @@ -1,3 +1,14 @@ +/* eslint-disable no-multi-assign */ +/* eslint-disable prefer-const */ +/* eslint-disable no-var */ +/* eslint-disable vars-on-top */ +/* eslint-disable no-unused-vars */ +/* eslint-disable func-names */ +/* eslint-disable camelcase */ +/* eslint-disable no-undef */ +/* eslint-disable no-new-func */ +/* eslint-disable strict */ + // GENERATED CODE -- DO NOT EDIT! // Original file comments: diff --git a/examples/grpc/helloworld_pb.js b/examples/grpc/helloworld_pb.js index 462eb4ee02b..48656aef947 100644 --- a/examples/grpc/helloworld_pb.js +++ b/examples/grpc/helloworld_pb.js @@ -1,3 +1,13 @@ +/* eslint-disable prefer-const */ +/* eslint-disable no-var */ +/* eslint-disable vars-on-top */ +/* eslint-disable no-unused-vars */ +/* eslint-disable func-names */ +/* eslint-disable camelcase */ +/* eslint-disable no-undef */ +/* eslint-disable no-new-func */ +/* eslint-disable strict */ + /** * @fileoverview * @enhanceable diff --git a/examples/opentracing-shim/shim.js b/examples/opentracing-shim/shim.js index 89c828d7d06..4730f9e2587 100644 --- a/examples/opentracing-shim/shim.js +++ b/examples/opentracing-shim/shim.js @@ -1,17 +1,17 @@ 'use strict'; -const { NodeTracerRegistry } = require("@opentelemetry/node"); -const { SimpleSpanProcessor } = require("@opentelemetry/tracing"); -const { JaegerExporter } = require("@opentelemetry/exporter-jaeger"); -const { ZipkinExporter } = require("@opentelemetry/exporter-zipkin"); -const { TracerShim } = require("@opentelemetry/shim-opentracing"); +const { NodeTracerRegistry } = require('@opentelemetry/node'); +const { SimpleSpanProcessor } = require('@opentelemetry/tracing'); +const { JaegerExporter } = require('@opentelemetry/exporter-jaeger'); +const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin'); +const { TracerShim } = require('@opentelemetry/shim-opentracing'); function shim(serviceName) { const registry = new NodeTracerRegistry(); registry.addSpanProcessor(new SimpleSpanProcessor(getExporter(serviceName))); - return new TracerShim(registry.getTracer("opentracing-shim")); + return new TracerShim(registry.getTracer('opentracing-shim')); } function getExporter(serviceName) { diff --git a/examples/postgres/client.js b/examples/postgres/client.js index 65d5fc2a470..1df7bdf9f6a 100644 --- a/examples/postgres/client.js +++ b/examples/postgres/client.js @@ -1,6 +1,7 @@ 'use strict'; const tracer = require('./tracer')('postgres-client-service'); +// eslint-disable-next-line import/order const http = require('http'); function makeRequest() { diff --git a/examples/postgres/server.js b/examples/postgres/server.js index 82bd868519d..8486add4a30 100644 --- a/examples/postgres/server.js +++ b/examples/postgres/server.js @@ -1,5 +1,6 @@ 'use strict'; +// eslint-disable-next-line import/order const tracer = require('./tracer')('postgres-server-service'); const { SpanKind, CanonicalCode } = require('@opentelemetry/types'); const express = require('express'); diff --git a/examples/redis/client.js b/examples/redis/client.js index 1dcf9fb5d5c..30fd9b65ca0 100644 --- a/examples/redis/client.js +++ b/examples/redis/client.js @@ -1,5 +1,6 @@ 'use strict'; +// eslint-disable-next-line import/order const tracer = require('./tracer')('example-redis-client'); const types = require('@opentelemetry/types'); const axios = require('axios').default; diff --git a/examples/tracer-web/examples/document-load/index.js b/examples/tracer-web/examples/document-load/index.js index bd42b14797c..8b803ac48bf 100644 --- a/examples/tracer-web/examples/document-load/index.js +++ b/examples/tracer-web/examples/document-load/index.js @@ -1,3 +1,5 @@ +'use strict'; + import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing'; import { WebTracerRegistry } from '@opentelemetry/web'; import { DocumentLoad } from '@opentelemetry/plugin-document-load';