Add Typescript

This commit is contained in:
Mylloon 2023-09-07 17:09:24 +02:00
commit e5c8c71c0f
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
8 changed files with 2040 additions and 0 deletions

16
README.md Normal file
View file

@ -0,0 +1,16 @@
# Init projects!
## Typescript
Copy and paste [`typescript/`](./typescript/) directory and you should be good to go!
- Remember to change values in the [`package.json`](./typescript/package.json).
- Then, to install all the dependencies, run `npm install`.
- To check if there is any new update for dependencies, run `npm outdated`, makes
changes accordingly to run the latest version, you may need to run `npm update`
to apply the updates after the modification of [`package.json`](./typescript/package.json).
- **Run `npm run main` to start the program.**
---
Contribution? Yes, please!

2
typescript/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/node_modules
/dist

3
typescript/.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}

8
typescript/.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,8 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": false,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true
}

1968
typescript/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

28
typescript/package.json Normal file
View file

@ -0,0 +1,28 @@
{
"name": "PROJECT_NAME",
"version": "1.0.0",
"description": "DESCRIPTION_PROJECT",
"main": "./dist/main.js",
"scripts": {
"main": "rm -r dist 2> /dev/null; npx tsc && node ./dist/index.js",
"lint": "npx eslint src",
"format": "npx prettier --check src"
},
"repository": {
"type": "git",
"url": "URL_TO_YOUR_GIT_PROJECT"
},
"keywords": [
"KEYWORD"
],
"author": "YOU",
"license": "AGPL-3.0-or-later",
"dependencies": {
"typescript": "~5.2.2"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "~6.6.0",
"@typescript-eslint/parser": "~6.6.0",
"prettier-eslint": "~15.0.1"
}
}

1
typescript/src/index.ts Normal file
View file

@ -0,0 +1 @@
console.log("Hello, world!");

14
typescript/tsconfig.json Normal file
View file

@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"noImplicitAny": true,
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": ["node_modules/*"]
}
},
"include": ["src/**/*.ts"]
}