Skip to content

Commit

Permalink
sample: another round of sample updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jan 16, 2025
1 parent 4123bbd commit a8ae8c7
Show file tree
Hide file tree
Showing 31 changed files with 486 additions and 333 deletions.
23 changes: 0 additions & 23 deletions sample/12-graphql-schema-first/.eslintrc.js

This file was deleted.

43 changes: 43 additions & 0 deletions sample/12-graphql-schema-first/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @ts-check
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['eslint.config.mjs'],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
ecmaVersion: 5,
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/unbound-method': 'warn',
},
},
);
27 changes: 14 additions & 13 deletions sample/12-graphql-schema-first/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@
"@apollo/server": "4.11.3",
"@graphql-tools/utils": "10.7.2",
"@nestjs/apollo": "12.2.2",
"@nestjs/common": "10.4.15",
"@nestjs/core": "10.4.15",
"@nestjs/common": "11.0.1",
"@nestjs/core": "11.0.1",
"@nestjs/graphql": "12.2.2",
"@nestjs/platform-express": "10.4.15",
"@nestjs/platform-express": "11.0.1",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"graphql": "16.8.1",
"graphql-subscriptions": "2.0.0",
"graphql": "16.10.0",
"graphql-subscriptions": "3.0.0",
"reflect-metadata": "0.2.2",
"rimraf": "6.0.1",
"rxjs": "7.8.1"
},
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.18.0",
"@nestjs/cli": "10.4.9",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.15",
"@types/express": "4.17.21",
"@nestjs/testing": "11.0.1",
"@types/express": "5.0.0",
"@types/jest": "29.5.14",
"@types/node": "22.10.6",
"@types/node": "22.10.7",
"@types/supertest": "6.0.2",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "9.18.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-prettier": "5.2.2",
"globals": "15.14.0",
"jest": "29.7.0",
"prettier": "3.4.2",
"supertest": "7.0.0",
Expand All @@ -55,7 +55,8 @@
"ts-morph": "25.0.0",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"typescript": "5.7.3"
"typescript": "5.7.3",
"typescript-eslint": "8.20.0"
},
"jest": {
"moduleFileExtensions": [
Expand Down
4 changes: 2 additions & 2 deletions sample/12-graphql-schema-first/src/cats/cats.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export class CatsResolver {

@Mutation('createCat')
async create(@Args('createCatInput') args: CreateCatDto): Promise<Cat> {
const createdCat = await this.catsService.create(args);
const createdCat = this.catsService.create(args);
pubSub.publish('catCreated', { catCreated: createdCat });
return createdCat;
}

@Subscription('catCreated')
catCreated() {
return pubSub.asyncIterator('catCreated');
return pubSub.asyncIterableIterator('catCreated');
}
}
2 changes: 1 addition & 1 deletion sample/12-graphql-schema-first/src/graphql.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/* tslint:disable */
/* eslint-disable */

export class CreateCatInput {
name?: Nullable<string>;
age?: Nullable<number>;
Expand Down
23 changes: 0 additions & 23 deletions sample/13-mongo-typeorm/.eslintrc.js

This file was deleted.

41 changes: 41 additions & 0 deletions sample/13-mongo-typeorm/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// @ts-check
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['eslint.config.mjs'],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
ecmaVersion: 5,
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
},
},
);
8 changes: 4 additions & 4 deletions sample/13-mongo-typeorm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.4.15",
"@nestjs/core": "10.4.15",
"@nestjs/platform-express": "10.4.15",
"@nestjs/common": "11.0.1",
"@nestjs/core": "11.0.1",
"@nestjs/platform-express": "11.0.1",
"@nestjs/typeorm": "10.0.2",
"mongodb": "6.12.0",
"reflect-metadata": "0.2.2",
Expand All @@ -34,7 +34,7 @@
"@eslint/js": "9.18.0",
"@nestjs/cli": "10.4.9",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "11.0.0",
"@nestjs/testing": "11.0.1",
"@types/express": "5.0.0",
"@types/jest": "29.5.14",
"@types/node": "22.10.7",
Expand Down
23 changes: 0 additions & 23 deletions sample/14-mongoose-base/.eslintrc.js

This file was deleted.

42 changes: 42 additions & 0 deletions sample/14-mongoose-base/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// @ts-check
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['eslint.config.mjs'],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
ecmaVersion: 5,
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/require-await': 'warn',
},
},
);
8 changes: 4 additions & 4 deletions sample/14-mongoose-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.4.15",
"@nestjs/core": "10.4.15",
"@nestjs/platform-express": "10.4.15",
"@nestjs/common": "11.0.1",
"@nestjs/core": "11.0.1",
"@nestjs/platform-express": "11.0.1",
"mongoose": "8.9.5",
"reflect-metadata": "0.2.2",
"rimraf": "6.0.1",
Expand All @@ -32,7 +32,7 @@
"@eslint/js": "9.18.0",
"@nestjs/cli": "10.4.9",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "11.0.0",
"@nestjs/testing": "11.0.1",
"@types/express": "5.0.0",
"@types/jest": "29.5.14",
"@types/node": "22.10.7",
Expand Down
23 changes: 0 additions & 23 deletions sample/15-mvc/.eslintrc.js

This file was deleted.

42 changes: 42 additions & 0 deletions sample/15-mvc/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// @ts-check
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['eslint.config.mjs'],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
ecmaVersion: 5,
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/require-await': 'warn',
},
},
);
Loading

0 comments on commit a8ae8c7

Please sign in to comment.