Skip to content

Commit b50c293

Browse files
committed
chore: import type lint rule and fixes
Signed-off-by: Todd Baert <[email protected]>
1 parent 924802b commit b50c293

File tree

93 files changed

+304
-217
lines changed

Some content is hidden

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

93 files changed

+304
-217
lines changed

.eslintrc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
"jsdoc"
2222
],
2323
"rules": {
24+
"@typescript-eslint/consistent-type-imports": [
25+
"error",
26+
{
27+
"disallowTypeAnnotations": true,
28+
"fixStyle": "separate-type-imports",
29+
"prefer": "type-imports"
30+
}
31+
],
2432
"jsdoc/require-jsdoc": [
2533
"warn",
2634
{
@@ -60,4 +68,4 @@
6068
}
6169
]
6270
}
63-
}
71+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"e2e-web": "git submodule update --init --recursive && shx cp test-harness/features/evaluation.feature packages/web/e2e/features && jest --selectProjects=web-e2e --verbose",
1010
"e2e": "npm run e2e-server && npm run e2e-web",
1111
"lint": "npm run lint --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/angular --workspace=packages/nest",
12+
"lint:fix": "npm run lint:fix --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/angular --workspace=packages/nest --fix ",
1213
"clean": "shx rm -rf ./dist",
1314
"build": "npm run build --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/angular --workspace=packages/nest",
1415
"publish-all": "npm run publish-if-not-exists --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/angular --workspace=packages/nest",

packages/angular/angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"cli": {
4040
"schematicCollections": [
4141
"@angular-eslint/schematics"
42-
]
42+
],
43+
"analytics": false
4344
}
4445
}

packages/angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"ng": "ng",
66
"start": "ng serve",
77
"lint": "ng lint",
8+
"lint:fix": "ng lint --fix",
89
"watch": "ng build --watch --configuration development",
910
"test": "jest",
1011
"build": "ng build && npm run postbuild",

packages/nest/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"scripts": {
1717
"test": "jest --verbose",
1818
"lint": "eslint ./",
19+
"lint:fix": "eslint ./ --fix",
1920
"clean": "shx rm -rf ./dist",
2021
"build:esm": "esbuild src/index.ts --bundle --external:@nestjs/* --external:@openfeature/server-sdk --sourcemap --target=es2015 --platform=node --format=esm --outfile=./dist/esm/index.js --analyze",
2122
"build:cjs": "esbuild src/index.ts --bundle --external:@nestjs/* --external:@openfeature/server-sdk --sourcemap --target=es2015 --platform=node --format=cjs --outfile=./dist/cjs/index.js --analyze",
@@ -60,4 +61,4 @@
6061
"@types/supertest": "^6.0.0",
6162
"supertest": "^7.0.0"
6263
}
63-
}
64+
}

packages/nest/src/context-factory.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { EvaluationContext } from '@openfeature/core';
2-
import { ExecutionContext, Inject } from '@nestjs/common';
1+
import type { EvaluationContext } from '@openfeature/core';
2+
import type { ExecutionContext} from '@nestjs/common';
3+
import { Inject } from '@nestjs/common';
34

45
/**
56
* A factory function for creating an OpenFeature {@link EvaluationContext} from Nest {@link ExecutionContext}.

packages/nest/src/evaluation-context-interceptor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { CallHandler, ExecutionContext, Inject, Injectable, NestInterceptor } from '@nestjs/common';
2-
import { ContextFactory, ContextFactoryToken } from './context-factory';
1+
import type { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
2+
import { Inject, Injectable } from '@nestjs/common';
3+
import type { ContextFactory} from './context-factory';
4+
import { ContextFactoryToken } from './context-factory';
35
import { Observable } from 'rxjs';
46
import { OpenFeature } from '@openfeature/server-sdk';
57
import { OpenFeatureModule } from './open-feature.module';

packages/nest/src/feature.decorator.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { createParamDecorator, Inject } from '@nestjs/common';
2-
import {
2+
import type {
33
EvaluationContext,
44
EvaluationDetails,
55
FlagValue,
6-
JsonValue,
6+
JsonValue} from '@openfeature/server-sdk';
7+
import {
78
OpenFeature,
89
Client,
910
} from '@openfeature/server-sdk';
1011
import { getOpenFeatureClientToken } from './open-feature.module';
11-
import { from, Observable } from 'rxjs';
12+
import type { Observable } from 'rxjs';
13+
import { from } from 'rxjs';
1214

1315
/**
1416
* Options for injecting an OpenFeature client into a constructor.

packages/nest/src/open-feature.module.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
import {
1+
import type {
22
DynamicModule,
3-
Module,
43
FactoryProvider as NestFactoryProvider,
54
ValueProvider,
65
ClassProvider,
7-
Provider as NestProvider,
6+
Provider as NestProvider} from '@nestjs/common';
7+
import {
8+
Module,
89
ExecutionContext,
910
} from '@nestjs/common';
10-
import {
11+
import type {
1112
Client,
1213
Hook,
13-
OpenFeature,
1414
Provider,
1515
EvaluationContext,
1616
ServerProviderEvents,
1717
EventHandler,
18-
Logger,
18+
Logger} from '@openfeature/server-sdk';
19+
import {
20+
OpenFeature,
1921
AsyncLocalStorageTransactionContextPropagator,
2022
} from '@openfeature/server-sdk';
21-
import { ContextFactory, ContextFactoryToken } from './context-factory';
23+
import type { ContextFactory} from './context-factory';
24+
import { ContextFactoryToken } from './context-factory';
2225
import { APP_INTERCEPTOR } from '@nestjs/core';
2326
import { EvaluationContextInterceptor } from './evaluation-context-interceptor';
2427
import { ShutdownService } from './shutdown.service';

packages/nest/src/shutdown.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Injectable, OnApplicationShutdown } from '@nestjs/common';
1+
import type { OnApplicationShutdown } from '@nestjs/common';
2+
import { Injectable } from '@nestjs/common';
23
import { OpenFeature } from '@openfeature/server-sdk';
34

45
@Injectable()

0 commit comments

Comments
 (0)