Skip to content

Commit 236b633

Browse files
style: address integration tests lint errors
1 parent 03a61e9 commit 236b633

File tree

108 files changed

+1073
-817
lines changed

Some content is hidden

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

108 files changed

+1073
-817
lines changed

.eslintignore

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

.eslintrc.js

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

eslint.config.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// @ts-check
2+
import eslint from '@eslint/js';
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4+
import globals from 'globals';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{
9+
ignores: ['node_modules', '**/node_modules/**', '**/*.js', '**/*.d.ts'],
10+
},
11+
eslint.configs.recommended,
12+
...tseslint.configs.recommendedTypeChecked,
13+
eslintPluginPrettierRecommended,
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.node,
18+
...globals.jest,
19+
},
20+
ecmaVersion: 5,
21+
sourceType: 'module',
22+
parserOptions: {
23+
project: ['tsconfig.json', 'tsconfig.spec.json'],
24+
projectService: true,
25+
tsconfigRootDir: import.meta.dirname,
26+
},
27+
},
28+
},
29+
{
30+
rules: {
31+
'@typescript-eslint/no-explicit-any': 'off',
32+
'@typescript-eslint/no-unsafe-assignment': 'off',
33+
'@typescript-eslint/no-unsafe-call': 'off',
34+
'@typescript-eslint/no-unsafe-member-access': 'off',
35+
'@typescript-eslint/no-unsafe-function-type': 'off',
36+
'@typescript-eslint/no-unsafe-argument': 'off',
37+
'@typescript-eslint/no-unsafe-return': 'off',
38+
39+
'@typescript-eslint/no-unused-expressions': 'off',
40+
'@typescript-eslint/no-require-imports': 'off',
41+
'@typescript-eslint/no-unused-vars': 'off',
42+
"@typescript-eslint/no-misused-promises": [
43+
"error",
44+
{
45+
"checksVoidReturn": false
46+
}
47+
],
48+
"@typescript-eslint/require-await": "off"
49+
},
50+
},
51+
);

integration/auto-mock/test/bar.service.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ describe('Auto-Mocking with token in factory', () => {
4848
expect(fooServ.foo.called);
4949
});
5050
it('cannot mock the dependencies', async () => {
51+
/* eslint-disable @typescript-eslint/unbound-method */
5152
const moduleRef = Test.createTestingModule({
5253
providers: [BarService],
5354
}).useMocker(token => {

integration/auto-mock/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
},
3333
"include": [
3434
"src/**/*",
35-
"e2e/**/*"
35+
"e2e/**/*",
36+
"test/**/*"
3637
],
3738
"exclude": [
3839
"node_modules",

integration/graphql-code-first/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ async function bootstrap() {
77
app.useGlobalPipes(new ValidationPipe());
88
await app.listen(3000);
99
}
10-
bootstrap();
10+
void bootstrap();

integration/graphql-code-first/src/recipes/recipes.resolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class RecipesResolver {
3535
@Args('newRecipeData') newRecipeData: NewRecipeInput,
3636
): Promise<Recipe> {
3737
const recipe = await this.recipesService.create(newRecipeData);
38-
pubSub.publish('recipeAdded', { recipeAdded: recipe });
38+
void pubSub.publish('recipeAdded', { recipeAdded: recipe });
3939
return recipe;
4040
}
4141

integration/graphql-schema-first/e2e/graphql-request-scoped.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('GraphQL request scoped', () => {
4242
],
4343
},
4444
})
45-
.end((err, res) => {
45+
.end(err => {
4646
if (err) return end(err);
4747
end();
4848
});

integration/graphql-schema-first/src/cats/cats.resolvers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class CatsResolvers {
2727

2828
@Mutation('createCat')
2929
async create(@Args() args: Cat): Promise<Cat> {
30-
const createdCat = await this.catsService.create(args);
31-
pubSub.publish('catCreated', { catCreated: createdCat });
30+
const createdCat = this.catsService.create(args);
31+
void pubSub.publish('catCreated', { catCreated: createdCat });
3232
return createdCat;
3333
}
3434

integration/graphql-schema-first/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ async function bootstrap() {
55
const app = await NestFactory.create(AppModule);
66
await app.listen(3000);
77
}
8-
bootstrap();
8+
void bootstrap();

0 commit comments

Comments
 (0)