Skip to content

Commit d2cbba9

Browse files
BLANC Etienne DISU/UOMBLANC Etienne DISU/UOM
authored andcommitted
fix project architecture (tsconfig etc)
1 parent bfc8c04 commit d2cbba9

File tree

10 files changed

+3432
-0
lines changed

10 files changed

+3432
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,6 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
# Typescript build
107+
build/

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"esbenp.prettier-vscode",
4+
"ms-vscode.vscode-typescript-tslint-plugin",
5+
"editorconfig.editorconfig"
6+
]
7+
}

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"editor.tabSize": 2,
3+
"typescript.tsdk": "node_modules/typescript/lib",
4+
"files.autoSave": "onFocusChange",
5+
"editor.formatOnSave": true,
6+
"[javascript]": {
7+
"editor.formatOnSave": false
8+
},
9+
"typescript.implementationsCodeLens.enabled": true,
10+
"typescript.referencesCodeLens.enabled": true,
11+
"typescript.updateImportsOnFileMove.enabled": "always",
12+
"editor.rulers": [80, 120]
13+
}

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
};

package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"scripts": {
3+
"start:bankocr": "yarn build && node build/katas/bankOCR.js",
4+
"build": "tsc",
5+
"watch": "tsc -w",
6+
"test": "jest"
7+
},
8+
"devDependencies": {
9+
"@types/jest": "^24.0.25",
10+
"@types/node": "^13.1.4",
11+
"jest": "^24.9.0",
12+
"ts-jest": "^24.2.0",
13+
"typescript": "^3.7.4"
14+
}
15+
}

src/katas/bankOCR.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const testage = "test";
2+
3+
console.log(testage, "s'affiche");

src/tests/bankOCR.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { testage } from "katas/bankOCR";
2+
3+
it("Should be ok", function() {
4+
expect(1 + 1).toBe(2);
5+
});
6+
it("Should be a string", function() {
7+
expect(typeof testage).toBe(typeof "");
8+
});

tsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "commonjs",
5+
"removeComments": true,
6+
"sourceMap": true,
7+
"strictNullChecks": false,
8+
"skipLibCheck": true,
9+
"strict": true,
10+
"outDir": "build",
11+
"baseUrl": "./src",
12+
"paths": {
13+
// Shortcuts:
14+
"@katas*": ["katas"]
15+
},
16+
"pretty": true
17+
},
18+
"exclude": ["tests/*", "*.test.ts*"]
19+
}

tslint.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"defaultSeverity": "error",
3+
"jsRules": {},
4+
"rules": {
5+
"interface-name": false,
6+
"no-console": false,
7+
"no-eval": false,
8+
"no-bitwise": false,
9+
"variable-name": [
10+
true,
11+
"ban-keywords",
12+
"check-format",
13+
"allow-leading-underscore",
14+
"allow-snake-case",
15+
"allow-pascal-case"
16+
],
17+
"max-classes-per-file": [true, 2],
18+
"no-empty-interface": false,
19+
"member-ordering": [
20+
true,
21+
{
22+
"order": [
23+
"public-static-field",
24+
"private-static-field",
25+
"public-instance-field",
26+
"private-instance-field",
27+
"public-constructor",
28+
"private-constructor",
29+
"public-instance-method",
30+
"protected-instance-method",
31+
"private-instance-method"
32+
]
33+
}
34+
],
35+
"no-implicit-dependencies": false,
36+
"no-submodule-imports": false,
37+
"no-object-literal-type-assertion": false
38+
},
39+
"rulesDirectory": []
40+
}

0 commit comments

Comments
 (0)