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:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
*.js
|
||||||
14
.prettierrc.mjs
Normal file
14
.prettierrc.mjs
Normal 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
13
.vscode/settings.json
vendored
Normal 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
18
eslint.config.mjs
Normal 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
15
main.ts
Normal 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
1546
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
17
package.json
Normal file
17
package.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user