Skip to content

Commit 91b341a

Browse files
committed
chore: configures auto-fixing imports
Signed-off-by: Anthony D. Mays <[email protected]>
1 parent 7f6c65d commit 91b341a

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"editor.formatOnPaste": true,
66
"editor.formatOnSave": true,
77
"prettier.requireConfig": true,
8+
"editor.codeActionsOnSave": {
9+
"source.fixAll.eslint": "explicit",
10+
"source.organizeImports": "explicit"
11+
},
812
"[typescriptreact]": {
913
"editor.defaultFormatter": "esbenp.prettier-vscode"
1014
},

lesson_03/quiz/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ indent_size = 2
66
end_of_line = lf
77
charset = utf-8
88
insert_final_newline = true
9+
organize_imports = true
10+
trim_trailing_whitespace = true

lesson_03/quiz/.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

lesson_03/quiz/eslint.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ export default tseslint.config(
1111
eslintConfigPrettier,
1212
{
1313
ignores: ["build"],
14-
env: {
15-
node: true,
16-
jest: true,
17-
},
1814
rules: {
1915
"@typescript-eslint/interface-name-prefix": "off",
2016
"@typescript-eslint/explicit-function-return-type": "off",
2117
"@typescript-eslint/no-explicit-any": "off",
18+
"@typescript-eslint/no-extraneous-class": "off",
2219
},
2320
},
2421
);

lesson_03/quiz/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"scripts": {
77
"start": "node build/lesson3.js",
88
"dev": "tsc-watch --noClear -p ./tsconfig.build.json --onSuccess \"node ./build/lesson3.js\"",
9-
"test": "node --experimental-vm-modules node_modules/.bin/jest --watch",
9+
"lint": "eslint \"{src,test}/**/*.{ts,tsx}\"",
10+
"test": "node --experimental-vm-modules node_modules/.bin/jest",
11+
"test:watch": "node --experimental-vm-modules node_modules/.bin/jest --watch",
1012
"compile": "tsc -p tsconfig.build.json",
1113
"prepare": "npm run compile",
1214
"pretest": "npm run compile",

lesson_03/quiz/src/lesson3.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1+
import { flush, proxy } from "@alfonso-presa/soft-assert";
2+
import { beforeAll, describe, expect, it } from "@jest/globals";
3+
import { Test, TestingModule } from "@nestjs/testing";
14
import {
5+
AnswerChoice,
26
QuizConfig,
37
QuizQuestion,
4-
AnswerChoice,
58
} from "codedifferently-instructional";
6-
import { Test, TestingModule } from "@nestjs/testing";
7-
import { beforeAll, describe, it, expect } from "@jest/globals";
8-
import { proxy, flush } from "@alfonso-presa/soft-assert";
9-
import { AppModule } from "./app.module.js";
10-
import { INestApplication } from "@nestjs/common";
11-
import { Quizzes } from "./quizzes/quizzes.module.js";
129
import path from "path";
1310
import { fileURLToPath } from "url";
11+
import { AppModule } from "./app.module.js";
12+
import { Quizzes } from "./quizzes/quizzes.module.js";
1413

1514
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
1615
const __dirname = path.dirname(__filename); // get the name of the directory

lesson_03/quiz/src/lesson3.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { NestFactory } from "@nestjs/core";
2-
import { Quizzes } from "./quizzes/quizzes.module.js";
3-
import { AppModule } from "./app.module.js";
41
import { INestApplicationContext } from "@nestjs/common";
2+
import { NestFactory } from "@nestjs/core";
53
import { QuizPrinter, QuizQuestion } from "codedifferently-instructional";
4+
import { AppModule } from "./app.module.js";
5+
import { Quizzes } from "./quizzes/quizzes.module.js";
66

77
async function bootstrap() {
88
const app = await NestFactory.createApplicationContext(AppModule);
@@ -20,7 +20,7 @@ function run(app: INestApplicationContext) {
2020
}
2121

2222
function printQuiz(quizQuestions: Iterable<QuizQuestion>) {
23-
var printer = new QuizPrinter();
23+
const printer = new QuizPrinter();
2424
printer.printQuiz(quizQuestions);
2525
}
2626

0 commit comments

Comments
 (0)