Skip to content

Commit cee8d3d

Browse files
committed
Remove commonjs plugin, configure eslint
1 parent 78d9375 commit cee8d3d

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

packages/node/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@
9797
"@prisma/instrumentation": "6.7.0",
9898
"@sentry/core": "9.20.0",
9999
"@sentry/opentelemetry": "9.20.0",
100-
"import-in-the-middle": "^1.13.1"
100+
"import-in-the-middle": "^1.13.1",
101+
"minimatch": "^9.0.0"
101102
},
102103
"devDependencies": {
103104
"@types/node": "^18.19.1"

packages/node/rollup.npm.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import commonjs from '@rollup/plugin-commonjs';
21
import replace from '@rollup/plugin-replace';
32
import { makeBaseNPMConfig, makeNPMConfigVariants, makeOtelLoaders } from '@sentry-internal/rollup-utils';
43
import { createWorkerCodeBuilder } from './rollup.anr-worker.config.mjs';
@@ -28,7 +27,6 @@ export default [
2827
preserveModules: true,
2928
},
3029
plugins: [
31-
commonjs(),
3230
replace({
3331
delimiters: ['###', '###'],
3432
// removes some rollup warnings
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
},
5+
parserOptions: {
6+
sourceType: 'module',
7+
ecmaVersion: 2020,
8+
},
9+
};

packages/node/src/integrations/tracing/fastify/fastify-otel/index.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ SOFTWARE.
3232
*/
3333

3434
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
35-
'use strict';
36-
const dc = require('node:diagnostics_channel');
37-
const { context, trace, SpanStatusCode, propagation, diag } = require('@opentelemetry/api');
38-
const { getRPCMetadata, RPCType } = require('@opentelemetry/core');
39-
const {
40-
ATTR_HTTP_ROUTE,
41-
ATTR_HTTP_RESPONSE_STATUS_CODE,
35+
/* eslint-disable jsdoc/require-jsdoc */
36+
/* eslint-disable max-lines */
37+
/* eslint-disable no-param-reassign */
38+
import dc from 'node:diagnostics_channel';
39+
import { context, propagation,SpanStatusCode, trace } from '@opentelemetry/api';
40+
import { getRPCMetadata, RPCType } from '@opentelemetry/core';
41+
import { InstrumentationBase } from '@opentelemetry/instrumentation';
42+
import {
4243
ATTR_HTTP_REQUEST_METHOD,
44+
ATTR_HTTP_RESPONSE_STATUS_CODE,
45+
ATTR_HTTP_ROUTE,
4346
ATTR_SERVICE_NAME,
44-
} = require('@opentelemetry/semantic-conventions');
45-
const { InstrumentationBase } = require('@opentelemetry/instrumentation');
47+
} from '@opentelemetry/semantic-conventions';
4648

4749
// SENTRY VENDOR NOTE
4850
// Instead of using the package.json file, we hard code the package name and version here.
@@ -82,7 +84,7 @@ const kAddHookOriginal = Symbol('fastify otel addhook original');
8284
const kSetNotFoundOriginal = Symbol('fastify otel setnotfound original');
8385
const kIgnorePaths = Symbol('fastify otel ignore path');
8486

85-
class FastifyOtelInstrumentation extends InstrumentationBase {
87+
export class FastifyOtelInstrumentation extends InstrumentationBase {
8688
constructor(config) {
8789
super(PACKAGE_NAME, PACKAGE_VERSION, config);
8890
this.servername = config?.servername ?? process.env.OTEL_SERVICE_NAME ?? 'fastify';
@@ -488,6 +490,3 @@ class FastifyOtelInstrumentation extends InstrumentationBase {
488490
}
489491
}
490492
}
491-
492-
module.exports = FastifyOtelInstrumentation;
493-
module.exports.FastifyOtelInstrumentation = FastifyOtelInstrumentation;

0 commit comments

Comments
 (0)