initial commit

- add .gitignore
  - node modules
  - generated js files
- add prettier and eslint configurations
  - prettier: some options configured
  - eslint: js linting disabled
- initialize npm, install packages
- add vscode settings
  - prettier formatting on save disabled
This commit is contained in:
borb
2025-09-23 15:26:20 +03:00
commit 07faf3c274
7 changed files with 1625 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules/
*.js

14
.prettierrc.mjs Normal file
View File

@@ -0,0 +1,14 @@
/**
* @see https://prettier.io/docs/configuration
* @type {import("prettier").Config}
*/
const config = {
trailingComma: "es5",
tabWidth: 4,
useTabs: true,
semi: true,
singleQuote: true,
printWidth: 120
};
export default config;

13
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
// "editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"prettier.requireConfig": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.rulers": [
120
],
}

18
eslint.config.mjs Normal file
View File

@@ -0,0 +1,18 @@
import js from "@eslint/js"
import globals from "globals";
import tseslint from "typescript-eslint";
import { defineConfig } from "eslint/config";
export default defineConfig([
// {
// files: ["**/*.{js,mjs,cjs}"],
// plugins: { js },
// extends: ["js/recommended"],
// languageOptions: { globals: globals.node },
// },
{files: ["**/*.{ts,mts,cts}"], plugins: { tseslint }, extends: [tseslint.configs.recommended], languageOptions: { globals: globals.node },
rules: {
"@typescript-eslint/no-unused-vars": "warn",
},
},
]);

15
main.ts Normal file
View File

@@ -0,0 +1,15 @@
const name = 'Mikko'; // type is inferred as a string
let ageoftheknownuniverseandbeyond = 41; // type is inferred as a number
const rightHanded = true; // type is inferred as a boolean
ageoftheknownuniverseandbeyond = 12412432094509384890389045890389045890348905389045890308945034;
if (ageoftheknownuniverseandbeyond < 4223 && ageoftheknownuniverseandbeyond > 10)
console.log('jeeje');
if (name == 'Mikko' || name == 'Matti') {
console.log('jee');
}
console.log(ageoftheknownuniverseandbeyond);
export {};

1546
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

17
package.json Normal file
View File

@@ -0,0 +1,17 @@
{
"dependencies": {
"@types/node": "^24.5.2",
"typescript": "^5.9.2"
},
"devDependencies": {
"@eslint/js": "^9.36.0",
"eslint": "^9.36.0",
"globals": "^16.4.0",
"prettier": "^3.6.2",
"typescript-eslint": "^8.44.1"
},
"scripts": {
"lint": "eslint .",
"lintfix": "eslint . --fix"
}
}