Skip to content

Commit 74ddb1e

Browse files
authored
chore(examples): lint examples/ using shared top-level eslint config; add lint:examples to 'npm run lint' (#2919)
Refs: #2891
1 parent 4386262 commit 74ddb1e

File tree

41 files changed

+98
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+98
-62
lines changed

examples/.eslintrc

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/connect/client.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
'use strict';
1818

19-
// eslint-disable-next-line import/order
2019
const tracing = require('./tracing')('example-connect-client');
2120

2221
const { tracer } = tracing;

examples/connect/server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
'use strict';
1818

19-
// eslint-disable-next-line
2019
const tracing = require('./tracing')('example-connect-server');
2120

2221
// Require in rest of modules
@@ -27,7 +26,6 @@ const axios = require('axios');
2726
const app = connect();
2827
const PORT = 8080;
2928

30-
// eslint-disable-next-line prefer-arrow-callback
3129
app.use(function middleware1(req, res, next) {
3230
next();
3331
});

examples/dns/client.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
const api = require('@opentelemetry/api');
2020
const tracer = require('./tracer')('example-dns');
21-
// eslint-disable-next-line import/order
2221
const dns = require('dns').promises;
2322

2423
/** A function which makes a dns lookup and handles response. */

examples/express/src/client.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
// eslint-disable-next-line import/order, import/extensions
1817
import { setupTracing } from './tracer';
1918

2019
import * as api from '@opentelemetry/api';

examples/express/src/server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
// eslint-disable-next-line import/order, import/extensions
1817
import { setupTracing } from './tracer';
1918

2019
// Require in rest of modules

examples/express/src/tracer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import {
3636
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
3737
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
3838

39-
// eslint-disable-next-line import/prefer-default-export
4039
export const setupTracing = (serviceName: string) => {
4140
const exporter = new OTLPTraceExporter({});
4241
const provider = new NodeTracerProvider({

examples/fastify/server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
'use strict';
1818

19-
// eslint-disable-next-line
2019
const api = require('@opentelemetry/api');
2120
const tracer = api.trace.getTracer('fastify-server');
2221
const Fastify = require('fastify');
@@ -32,7 +31,6 @@ async function subsystem(fastify) {
3231
span.setAttribute('order', 2);
3332
});
3433

35-
// eslint-disable-next-line prefer-arrow-callback
3634
fastify.addHook('onRequest', async function onRequestHook() {
3735
const span = api.trace.getSpan(api.context.active());
3836
span.setAttribute('order', 3);

examples/graphql/schema.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
/* eslint-disable no-unused-vars */
18+
1719
'use strict';
1820

1921
const https = require('https');

examples/grpc-census-prop/capitalize_client.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
'use strict';
1818

1919
const api = require('@opentelemetry/api');
20-
/* eslint-disable global-require */
2120
const binaryPropagator = process.env.BINARY_PROPAGATOR === 'true';
2221
const censusTracer = process.env.CENSUS_TRACER === 'true';
2322
let tracer;

0 commit comments

Comments
 (0)