Skip to content

Commit 19893c6

Browse files
committed
fix: try another way to ignore issue
1 parent 17128d9 commit 19893c6

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/config/shortstops.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function serviceTypeFactory(name: string) {
8484
return function serviceType(v: string) {
8585
let checkValue = v;
8686
let matchIsGood = true;
87-
if (checkValue[0] === '!') {
87+
if (checkValue.startsWith('!')) {
8888
matchIsGood = false;
8989
checkValue = checkValue.substring(1);
9090
}
@@ -114,15 +114,15 @@ export function shortstops(service: { name: string }, sourcedir: string) {
114114
env,
115115
// A version of env that can default to false
116116
env_switch(v: string) {
117-
if (v && v[0] === '!') {
117+
if (v && v.startsWith('!')) {
118118
const bval = env(`${v.substring(1)}|b`);
119119
return !bval;
120120
}
121121
return !!env(v);
122122
},
123123
base64: base64Handler(),
124124
regex(v: string) {
125-
const [, pattern, flags] = v.match(/^\/(.*)\/([a-z]*)$/) || [];
125+
const [, pattern, flags] = /^\/(.*)\/([a-z]*)$/.exec(v) || [];
126126
if (pattern === undefined) {
127127
throw new Error(`Invalid regular expression in configuration ${v}`);
128128
}

src/config/validation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export function validateConfiguration<Config extends ConfigurationSchema>(
1616
) {
1717
const result = validator(config);
1818
if (!result.success) {
19+
const errorMessages = result.errors.map((e) => ` - ${e.path}: ${e.message}`).join('\n');
1920
throw new Error(`Configuration validation failed:
20-
${result.errors.map((e) => ` - ${e.path}: ${e.message}`).join('\n')}`);
21+
${errorMessages}`);
2122
}
2223
}

src/telemetry/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ import { getAutoInstrumentations } from './instrumentations.js';
2929
import { DummySpanExporter } from './DummyExporter.js';
3030

3131
/**
32-
* @SuppressWarning(typescript:S5332) - OTLP exporter requires http it seems.
32+
* NOSONAR_BEGIN (typescript:S5332) - OTLP exporter requires http it seems.
3333
*/
3434
const baseDefaultOtlpUrl = new URL('http://otlp-exporter:4318/v1').toString();
35+
/**
36+
* NOSONAR_END (typescript:S5332)
37+
*/
3538

3639
function getSpanExporter() {
3740
if (

0 commit comments

Comments
 (0)