@nivinjoseph/n-strument 1.0.5 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@nivinjoseph/n-strument",
3
- "version": "1.0.5",
3
+ "version": "2.0.1",
4
4
  "description": "Instrumentation helper library",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
- "packageManager": "yarn@4.4.1",
8
+ "packageManager": "yarn@4.16.0",
9
9
  "scripts": {
10
10
  "ts-compile": "tsc -p .",
11
11
  "ts-lint": "eslint . --ext .ts",
@@ -14,7 +14,7 @@
14
14
  "clean-src": "find ./src -name '*.js' -delete -o -name '*.map' -delete",
15
15
  "clean-test": "find ./test -name '*.js' -delete -o -name '*.map' -delete",
16
16
  "test": "yarn ts-build && node --test --enable-source-maps './test/**.test.js' || true",
17
- "publish-package": "yarn ts-build-dist && git add . && git commit -m 'preparing to publish new version' && npm version patch && git push && npm publish --access=public"
17
+ "publish-package": "yarn ts-build-dist && git add . && git commit -m 'preparing to publish new version' && yarn version patch && git add . && git commit -m 'new version' && git push && npm publish --access=public"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
@@ -32,21 +32,34 @@
32
32
  },
33
33
  "homepage": "https://github.com/nivinjoseph/n-strument#readme",
34
34
  "devDependencies": {
35
- "@types/node": "^20.10",
36
- "@typescript-eslint/eslint-plugin": "^6.15.0",
37
- "@typescript-eslint/parser": "^6.15.0",
38
- "eslint": "^8.56.0",
39
- "eslint-plugin-require-extensions": "^0.1.3",
40
- "typescript": "5.3.3"
35
+ "@eslint/js": "10.0.1",
36
+ "@stylistic/eslint-plugin": "5.10.0",
37
+ "@types/node": "24.10",
38
+ "@typescript-eslint/parser": "8.58.2",
39
+ "eslint": "10.2.1",
40
+ "eslint-import-resolver-typescript": "4.4.4",
41
+ "eslint-plugin-import": "2.32.0",
42
+ "typescript": "6.0.3",
43
+ "typescript-eslint": "8.58.2"
41
44
  },
42
45
  "dependencies": {
43
- "@nivinjoseph/n-config": "^2.0.1",
44
- "@nivinjoseph/n-util": "^2.0.1",
45
- "@opentelemetry/api": "^1.9.0",
46
- "@opentelemetry/auto-instrumentations-node": "^0.50.0",
47
- "@opentelemetry/id-generator-aws-xray": "^1.2.2",
48
- "@opentelemetry/propagator-aws-xray": "^1.26.0",
49
- "@opentelemetry/sdk-node": "^0.53.0",
50
- "tslib": "^2.7.0"
46
+ "@nivinjoseph/n-config": "2.0.5",
47
+ "@nivinjoseph/n-util": "4.0.2",
48
+ "@opentelemetry/api": "1.9.1",
49
+ "@opentelemetry/auto-instrumentations-node": "0.76.0",
50
+ "@opentelemetry/exporter-trace-otlp-http": "0.218.0",
51
+ "@opentelemetry/id-generator-aws-xray": "2.1.0",
52
+ "@opentelemetry/instrumentation": "0.218.0",
53
+ "@opentelemetry/instrumentation-koa": "0.66.0",
54
+ "@opentelemetry/propagator-aws-xray": "2.2.0",
55
+ "@opentelemetry/resources": "2.7.1",
56
+ "@opentelemetry/sdk-node": "0.218.0",
57
+ "@opentelemetry/sdk-trace-base": "2.7.1",
58
+ "@opentelemetry/sdk-trace-node": "2.7.1",
59
+ "@opentelemetry/semantic-conventions": "1.41.1",
60
+ "tslib": "2.8.1"
61
+ },
62
+ "engines": {
63
+ "node": ">=24.10"
51
64
  }
52
65
  }
package/src/index.ts CHANGED
@@ -1,17 +1,18 @@
1
- import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
2
- import { Resource } from "@opentelemetry/resources";
1
+ import { getNodeAutoInstrumentations, InstrumentationConfigMap } from "@opentelemetry/auto-instrumentations-node";
2
+ import { registerInstrumentations } from "@opentelemetry/instrumentation";
3
+ import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api";
4
+ import { KoaLayerType } from "@opentelemetry/instrumentation-koa";
5
+ import { defaultResource, resourceFromAttributes } from "@opentelemetry/resources";
3
6
  import
4
- {
5
- // SemanticResourceAttributes,
6
- ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION
7
- } from "@opentelemetry/semantic-conventions";
7
+ {
8
+ // SemanticResourceAttributes,
9
+ ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION
10
+ } from "@opentelemetry/semantic-conventions";
8
11
  import { NodeTracerProvider, ParentBasedSampler, TraceIdRatioBasedSampler } from "@opentelemetry/sdk-trace-node";
9
- import { registerInstrumentations } from "@opentelemetry/instrumentation";
10
12
  import { BatchSpanProcessor, TracerConfig } from "@opentelemetry/sdk-trace-base";
11
- import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api";
13
+
12
14
  import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
13
15
  import { ConfigurationManager } from "@nivinjoseph/n-config";
14
- import { KoaLayerType } from "@opentelemetry/instrumentation-koa";
15
16
  import { TypeHelper } from "@nivinjoseph/n-util";
16
17
  import { AWSXRayPropagator } from "@opentelemetry/propagator-aws-xray";
17
18
  import { AWSXRayIdGenerator } from "@opentelemetry/id-generator-aws-xray";
@@ -19,35 +20,82 @@ import { AWSXRayIdGenerator } from "@opentelemetry/id-generator-aws-xray";
19
20
  // For troubleshooting, set the log level to DiagLogLevel.DEBUG
20
21
  diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
21
22
 
23
+ // Every key in the InstrumentationConfigMap is listed explicitly with an `enabled` flag. The
24
+ // config object is an *override map*, not an allow-list: any instrumentation left out (or set to
25
+ // `undefined`) runs at its own default, which for this library version means ~39 of 40 are on.
26
+ // Listing all of them makes the enabled set unambiguous and makes a future library version that
27
+ // adds a new instrumentation conspicuous by its absence here, instead of silently turning on.
28
+ //
29
+ // Enabled: http, grpc, pg, knex, redis, ioredis, koa, amqplib, kafkajs, socket.io, aws-sdk,
30
+ // aws-lambda. Everything else off.
31
+ // Entries are kept in the library's own InstrumentationMap order for easy auditing on upgrade.
32
+ // `Required<...>` strips the optional modifier off every key, so this literal must list every
33
+ // instrumentation the library knows about. When an OTel upgrade adds a new one, the missing key
34
+ // becomes a compile error here — forcing a deliberate enabled/disabled decision rather than a
35
+ // silent default-on.
36
+ const instrumentationConfig: Required<InstrumentationConfigMap> = {
37
+ "@opentelemetry/instrumentation-amqplib": { enabled: true },
38
+ "@opentelemetry/instrumentation-aws-lambda": { enabled: true },
39
+ "@opentelemetry/instrumentation-aws-sdk": { enabled: true },
40
+ "@opentelemetry/instrumentation-bunyan": { enabled: false },
41
+ "@opentelemetry/instrumentation-cassandra-driver": { enabled: false },
42
+ "@opentelemetry/instrumentation-connect": { enabled: false },
43
+ "@opentelemetry/instrumentation-cucumber": { enabled: false },
44
+ "@opentelemetry/instrumentation-dataloader": { enabled: false },
45
+ "@opentelemetry/instrumentation-dns": { enabled: false },
46
+ "@opentelemetry/instrumentation-express": { enabled: false },
47
+ "@opentelemetry/instrumentation-fs": { enabled: false },
48
+ "@opentelemetry/instrumentation-generic-pool": { enabled: false },
49
+ "@opentelemetry/instrumentation-graphql": { enabled: false },
50
+ "@opentelemetry/instrumentation-grpc": { enabled: true },
51
+ "@opentelemetry/instrumentation-hapi": { enabled: false },
52
+ "@opentelemetry/instrumentation-http": { enabled: true },
53
+ "@opentelemetry/instrumentation-ioredis": { enabled: true },
54
+ "@opentelemetry/instrumentation-kafkajs": { enabled: true },
55
+ "@opentelemetry/instrumentation-knex": { enabled: true },
56
+ "@opentelemetry/instrumentation-koa": { enabled: true, ignoreLayersType: [KoaLayerType.MIDDLEWARE] },
57
+ "@opentelemetry/instrumentation-lru-memoizer": { enabled: false },
58
+ "@opentelemetry/instrumentation-memcached": { enabled: false },
59
+ "@opentelemetry/instrumentation-mongodb": { enabled: false },
60
+ "@opentelemetry/instrumentation-mongoose": { enabled: false },
61
+ "@opentelemetry/instrumentation-mysql2": { enabled: false },
62
+ "@opentelemetry/instrumentation-mysql": { enabled: false },
63
+ "@opentelemetry/instrumentation-nestjs-core": { enabled: false },
64
+ "@opentelemetry/instrumentation-net": { enabled: false },
65
+ "@opentelemetry/instrumentation-openai": { enabled: false },
66
+ "@opentelemetry/instrumentation-oracledb": { enabled: false },
67
+ "@opentelemetry/instrumentation-pg": { enabled: true },
68
+ "@opentelemetry/instrumentation-pino": { enabled: false },
69
+ "@opentelemetry/instrumentation-redis": { enabled: true },
70
+ "@opentelemetry/instrumentation-restify": { enabled: false },
71
+ "@opentelemetry/instrumentation-router": { enabled: false },
72
+ "@opentelemetry/instrumentation-runtime-node": { enabled: false },
73
+ "@opentelemetry/instrumentation-socket.io": { enabled: true },
74
+ "@opentelemetry/instrumentation-tedious": { enabled: false },
75
+ "@opentelemetry/instrumentation-undici": { enabled: false },
76
+ "@opentelemetry/instrumentation-winston": { enabled: false }
77
+ };
78
+
22
79
  // This registers all instrumentation packages
23
80
  registerInstrumentations({
24
81
  instrumentations: [
25
- getNodeAutoInstrumentations({
26
- "@opentelemetry/instrumentation-http": undefined,
27
- "@opentelemetry/instrumentation-grpc": undefined,
28
- "@opentelemetry/instrumentation-redis": undefined,
29
- "@opentelemetry/instrumentation-ioredis": undefined,
30
- "@opentelemetry/instrumentation-pg": undefined,
31
- "@opentelemetry/instrumentation-knex": undefined,
32
- "@opentelemetry/instrumentation-koa": { ignoreLayersType: [KoaLayerType.MIDDLEWARE] },
33
- "@opentelemetry/instrumentation-aws-sdk": undefined,
34
- "@opentelemetry/instrumentation-aws-lambda": undefined
35
- })
82
+ getNodeAutoInstrumentations(instrumentationConfig)
36
83
  ]
37
84
  });
38
85
 
86
+
39
87
  const env = ConfigurationManager.requireStringConfig("env");
40
88
  const isDev = env === "dev";
41
89
 
42
90
  const resource =
43
- Resource.default().merge(
44
- new Resource({
91
+ defaultResource().merge(
92
+ resourceFromAttributes({
45
93
  // [SemanticResourceAttributes.SERVICE_NAME]: ConfigurationManager.getConfig("package.name"),
46
94
  // [SemanticResourceAttributes.SERVICE_VERSION]: ConfigurationManager.getConfig("package.version"),
47
95
  // [SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT]: env
48
96
 
49
- [ATTR_SERVICE_NAME]: ConfigurationManager.getConfig("package_name") ?? ConfigurationManager.getConfig("package.name"),
50
- [ATTR_SERVICE_VERSION]: ConfigurationManager.getConfig("package.version")
97
+ [ATTR_SERVICE_NAME]: ConfigurationManager.getConfig("package_name") ?? ConfigurationManager.getConfig("package.name") ?? undefined,
98
+ [ATTR_SERVICE_VERSION]: ConfigurationManager.getConfig("package.version") ?? undefined
51
99
  })
52
100
  );
53
101
 
@@ -67,7 +115,6 @@ let traceHost = ConfigurationManager.getConfig<string | null>("otelTraceHost");
67
115
  if (traceHost == null || typeof traceHost !== "string" || traceHost.isEmptyOrWhiteSpace())
68
116
  traceHost = isDev ? "localhost" : "0.0.0.0";
69
117
 
70
- const provider = new NodeTracerProvider();
71
118
  // const exporter = new ConsoleSpanExporter();
72
119
  const exporter = new OTLPTraceExporter({
73
120
  // optional - default url is http://localhost:4318/v1/traces
@@ -77,6 +124,40 @@ const exporter = new OTLPTraceExporter({
77
124
  headers: {}
78
125
  });
79
126
  const processor = new BatchSpanProcessor(exporter);
80
- provider.addSpanProcessor(processor);
81
127
 
82
- provider.register(enableXrayTracing ? { propagator: new AWSXRayPropagator() } : undefined);
128
+ // Span processors are now supplied via the constructor (addSpanProcessor was removed in the OTel SDK 2.x line).
129
+ const provider = new NodeTracerProvider({
130
+ ...tracerConfig,
131
+ spanProcessors: [processor]
132
+ });
133
+
134
+ provider.register(enableXrayTracing ? { propagator: new AWSXRayPropagator() } : undefined);
135
+
136
+ // The BatchSpanProcessor buffers finished spans in memory and only flushes periodically (or once a
137
+ // batch fills); its flush timer is unref'd, so the process can exit with spans still buffered, and
138
+ // the Node processor registers no exit handlers of its own. Rather than have this library grab
139
+ // SIGTERM/SIGINT — which would race with, and process.exit() out of, the host service's own
140
+ // graceful-shutdown sequence — we export a drain function for the host to invoke as part of its
141
+ // shutdown. provider.shutdown() flushes the buffer and shuts the exporter down.
142
+ let shutdownPromise: Promise<void> | null = null;
143
+
144
+ /**
145
+ * Flushes any buffered spans and shuts the tracer exporter down.
146
+ *
147
+ * Call this from your service's graceful-shutdown sequence — after it has stopped accepting work
148
+ * and finished in-flight requests, so their spans are captured — to avoid losing the spans the
149
+ * BatchSpanProcessor is still holding in memory. Safe to call more than once: repeat calls return
150
+ * the same in-flight (or completed) shutdown.
151
+ */
152
+ export function shutdownTracing(): Promise<void>
153
+ {
154
+ if (shutdownPromise != null)
155
+ return shutdownPromise;
156
+
157
+ shutdownPromise = provider.shutdown().catch((e: unknown) =>
158
+ {
159
+ diag.error("Error shutting down tracer provider", e);
160
+ });
161
+
162
+ return shutdownPromise;
163
+ }
package/tsconfig.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "module": "NodeNext",
4
- "target": "ES2022",
4
+ "target": "ES2023",
5
5
  "lib": [
6
6
  "ES2023"
7
7
  ],
8
+ "types": [
9
+ "node"
10
+ ],
8
11
  "strict": true,
9
12
  "strictNullChecks": true,
10
13
  "strictFunctionTypes": true,
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- node_modules
2
- dist
package/.eslintrc DELETED
@@ -1,344 +0,0 @@
1
- {
2
- "root": true,
3
- "parser": "@typescript-eslint/parser",
4
- "plugins": [
5
- "@typescript-eslint",
6
- "require-extensions"
7
- ],
8
- "extends": [
9
- "eslint:recommended",
10
- "plugin:@typescript-eslint/eslint-recommended",
11
- "plugin:@typescript-eslint/recommended",
12
- "plugin:require-extensions/recommended"
13
- ],
14
- "parserOptions": {
15
- "project": "tsconfig.json"
16
- },
17
- "rules": {
18
- "quotes": "off",
19
- "@typescript-eslint/quotes": [
20
- "error",
21
- "double",
22
- {
23
- "allowTemplateLiterals": true
24
- }
25
- ],
26
- "no-eval": "error",
27
- "no-void": "error",
28
- "no-with": "error",
29
- "@typescript-eslint/adjacent-overload-signatures": "error",
30
- "@typescript-eslint/array-type": [
31
- "error",
32
- {
33
- "default": "generic",
34
- "readonly": "generic"
35
- }
36
- ],
37
- "@typescript-eslint/await-thenable": "error",
38
- "@typescript-eslint/ban-ts-comment": [
39
- "error",
40
- {
41
- "ts-expect-error": "allow-with-description",
42
- "ts-ignore": "allow-with-description",
43
- "ts-nocheck": true,
44
- "ts-check": true
45
- }
46
- ],
47
- "@typescript-eslint/ban-tslint-comment": "error",
48
- "@typescript-eslint/ban-types": [
49
- "error",
50
- {
51
- "extendDefaults": false,
52
- "types": {
53
- "String": {
54
- "message": "Use string instead",
55
- "fixWith": "string"
56
- },
57
- "Boolean": {
58
- "message": "Use boolean instead",
59
- "fixWith": "boolean"
60
- },
61
- "Number": {
62
- "message": "Use number instead",
63
- "fixWith": "number"
64
- },
65
- "Symbol": {
66
- "message": "Use symbol instead",
67
- "fixWith": "symbol"
68
- }
69
- }
70
- }
71
- ],
72
- "brace-style": "off",
73
- "@typescript-eslint/brace-style": [
74
- "error",
75
- "allman",
76
- {
77
- "allowSingleLine": true
78
- }
79
- ],
80
- "@typescript-eslint/class-literal-property-style": [
81
- "off",
82
- "getters"
83
- ],
84
- "comma-dangle": "off",
85
- "@typescript-eslint/comma-dangle": [
86
- "error",
87
- "never"
88
- ],
89
- "default-param-last": "off",
90
- "@typescript-eslint/default-param-last": "error",
91
- "@typescript-eslint/explicit-function-return-type": "error",
92
- "@typescript-eslint/explicit-member-accessibility": "error",
93
- "@typescript-eslint/explicit-module-boundary-types": "error",
94
- "func-call-spacing": "off",
95
- "@typescript-eslint/func-call-spacing": [
96
- "error",
97
- "never"
98
- ],
99
- "@typescript-eslint/member-delimiter-style": [
100
- "error",
101
- {
102
- "multiline": {
103
- "delimiter": "semi",
104
- "requireLast": true
105
- },
106
- "singleline": {
107
- "delimiter": "semi",
108
- "requireLast": true
109
- },
110
- "multilineDetection": "brackets"
111
- }
112
- ],
113
- "@typescript-eslint/member-ordering": [
114
- "error",
115
- {
116
- "default": [
117
- // Index signature
118
- "signature",
119
- // Fields
120
- "private-static-field",
121
- "protected-static-field",
122
- "public-static-field",
123
- // "private-decorated-field",
124
- // "protected-decorated-field",
125
- // "public-decorated-field",
126
- "private-instance-field",
127
- "protected-instance-field",
128
- "public-instance-field",
129
- // "public-abstract-field",
130
- // "protected-abstract-field",
131
- // "private-abstract-field",
132
- // "private-field",
133
- // "protected-field",
134
- // "public-field",
135
- // "static-field",
136
- // "instance-field",
137
- // "abstract-field",
138
- // "decorated-field",
139
- // "field",
140
- // Getters
141
- // "public-static-get",
142
- // "protected-static-get",
143
- // "private-static-get",
144
- // "public-decorated-get",
145
- // "protected-decorated-get",
146
- // "private-decorated-get",
147
- // "public-instance-get",
148
- // "protected-instance-get",
149
- // "private-instance-get",
150
- // "public-abstract-get",
151
- // "protected-abstract-get",
152
- // "private-abstract-get",
153
- // "public-get",
154
- // "protected-get",
155
- // "private-get",
156
- // "static-get",
157
- // "instance-get",
158
- // "abstract-get",
159
- // "decorated-get",
160
- // "get",
161
- // Setters
162
- // "public-static-set",
163
- // "protected-static-set",
164
- // "private-static-set",
165
- // "public-decorated-set",
166
- // "protected-decorated-set",
167
- // "private-decorated-set",
168
- // "public-instance-set",
169
- // "protected-instance-set",
170
- // "private-instance-set",
171
- // "public-abstract-set",
172
- // "protected-abstract-set",
173
- // "private-abstract-set",
174
- // "public-set",
175
- // "protected-set",
176
- // "private-set",
177
- // "static-set",
178
- // "instance-set",
179
- // "abstract-set",
180
- // "decorated-set",
181
- // "set",
182
- // [
183
- // "get",
184
- // "set"
185
- // ],
186
- [
187
- "private-static-get",
188
- "private-static-set"
189
- ],
190
- [
191
- "protected-static-get",
192
- "protected-static-set"
193
- ],
194
- [
195
- "public-static-get",
196
- "public-static-set"
197
- ],
198
- [
199
- "private-instance-get",
200
- "private-instance-set"
201
- ],
202
- [
203
- "protected-instance-get",
204
- "protected-instance-set"
205
- ],
206
- [
207
- "public-instance-get",
208
- "public-instance-set"
209
- ],
210
- // Constructors
211
- "public-constructor",
212
- "protected-constructor",
213
- "private-constructor",
214
- // "constructor",
215
- // Methods
216
- "public-static-method",
217
- "protected-static-method",
218
- "private-static-method",
219
- // "public-decorated-method",
220
- // "protected-decorated-method",
221
- // "private-decorated-method",
222
- "public-instance-method",
223
- "protected-instance-method",
224
- "private-instance-method",
225
- // "public-abstract-method",
226
- // "protected-abstract-method",
227
- // "private-abstract-method",
228
- // "public-method",
229
- // "protected-method",
230
- // "private-method",
231
- // "static-method",
232
- // "instance-method",
233
- // "abstract-method",
234
- // "decorated-method",
235
- // "method"
236
- ]
237
- }
238
- ],
239
- "@typescript-eslint/method-signature-style": [
240
- "error",
241
- "method"
242
- ],
243
- "@typescript-eslint/naming-convention": [
244
- "error",
245
- {
246
- "selector": "memberLike",
247
- "modifiers": [
248
- "private"
249
- ],
250
- "format": [
251
- "camelCase"
252
- ],
253
- "leadingUnderscore": "require"
254
- }
255
- ],
256
- "@typescript-eslint/no-confusing-non-null-assertion": "error",
257
- "@typescript-eslint/no-confusing-void-expression": [
258
- "error",
259
- {
260
- "ignoreArrowShorthand": true
261
- }
262
- ],
263
- "no-dupe-class-members": "off",
264
- "@typescript-eslint/no-dupe-class-members": "error",
265
- "@typescript-eslint/no-duplicate-enum-values": "error",
266
- "no-duplicate-imports": "error",
267
- "no-empty-function": "off",
268
- "@typescript-eslint/no-empty-function": [
269
- "error",
270
- {
271
- "allow": [
272
- "private-constructors"
273
- ]
274
- }
275
- ],
276
- "@typescript-eslint/no-explicit-any": "off",
277
- "@typescript-eslint/no-extra-non-null-assertion": "error",
278
- "no-extra-parens": "off",
279
- "@typescript-eslint/no-extra-parens": [
280
- "error",
281
- "all",
282
- {
283
- "nestedBinaryExpressions": false
284
- }
285
- ],
286
- "no-extra-semi": "off",
287
- "@typescript-eslint/no-extra-semi": "error",
288
- "@typescript-eslint/no-floating-promises": "error",
289
- "@typescript-eslint/no-for-in-array": "error",
290
- "no-implied-eval": "off",
291
- "@typescript-eslint/no-implied-eval": "error",
292
- "no-invalid-this": "off",
293
- "@typescript-eslint/no-invalid-this": "error",
294
- "@typescript-eslint/no-invalid-void-type": "error",
295
- "no-loop-func": "off",
296
- "@typescript-eslint/no-loop-func": "error",
297
- "no-loss-of-precision": "off",
298
- "@typescript-eslint/no-loss-of-precision": "error",
299
- "@typescript-eslint/no-meaningless-void-operator": "error",
300
- "@typescript-eslint/no-misused-new": "error",
301
- "@typescript-eslint/no-misused-promises": "error",
302
- "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
303
- "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
304
- "@typescript-eslint/no-non-null-assertion": "off",
305
- "no-redeclare": "off",
306
- "@typescript-eslint/no-redeclare": "error",
307
- "@typescript-eslint/no-this-alias": "error",
308
- "@typescript-eslint/no-throw-literal": "error",
309
- "@typescript-eslint/no-unnecessary-condition": [
310
- "error",
311
- {
312
- "allowConstantLoopConditions": true
313
- }
314
- ],
315
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
316
- "@typescript-eslint/no-unnecessary-type-constraint": "error",
317
- "@typescript-eslint/no-unsafe-call": "error",
318
- "@typescript-eslint/no-unsafe-return": "error",
319
- "no-unused-expressions": "off",
320
- "@typescript-eslint/no-unused-expressions": "error",
321
- "no-unused-vars": "off",
322
- "@typescript-eslint/no-unused-vars": "off",
323
- "no-use-before-define": "off",
324
- "@typescript-eslint/no-use-before-define": "off",
325
- "no-useless-constructor": "off",
326
- "@typescript-eslint/no-useless-constructor": "error",
327
- "@typescript-eslint/no-useless-empty-export": "error",
328
- "@typescript-eslint/no-var-requires": "off",
329
- "@typescript-eslint/parameter-properties": "error",
330
- "@typescript-eslint/prefer-enum-initializers": "error",
331
- "@typescript-eslint/prefer-includes": "error",
332
- "@typescript-eslint/prefer-literal-enum-member": "error",
333
- "@typescript-eslint/prefer-readonly": "error",
334
- "@typescript-eslint/prefer-reduce-type-parameter": "error",
335
- "@typescript-eslint/prefer-string-starts-ends-with": "error",
336
- "@typescript-eslint/prefer-ts-expect-error": "error",
337
- "@typescript-eslint/require-array-sort-compare": "error",
338
- "no-return-await": "off",
339
- "@typescript-eslint/return-await": "error",
340
- "semi": "off",
341
- "@typescript-eslint/semi": "error",
342
- "@typescript-eslint/unbound-method": "error"
343
- }
344
- }