Initial boilerplate setup

This commit is contained in:
Simon Detheridge 2025-01-15 10:50:50 +00:00
commit db7defdaf6
Signed by: simon
GPG Key ID: 38640971DA1E704E
11 changed files with 2996 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules
dist
*.tsbuildinfo

2
.prettierignore Normal file
View File

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

5
.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# node-ts-boilerplate
Initial empty node repository with ts, eslint, prettier and jest.

13
eslint.config.mjs Normal file
View File

@ -0,0 +1,13 @@
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ['**/*.{mjs,cjs,ts}'] },
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
eslintPluginPrettierRecommended,
]

16
jest.config.ts Normal file
View File

@ -0,0 +1,16 @@
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
import type { Config } from 'jest'
const config: Config = {
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
// collectCoverage: false,
}
export default config

34
package.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "tumelo-backend",
"version": "1.0.0",
"main": "dist/index.js",
"author": "Simon Detheridge",
"license": "MIT",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "nodemon --watch '*.ts' --exec 'ts-node' ./src/index.ts",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"ci": "eslint . && jest",
"test": "jest"
},
"dependencies": {
"typescript": "^5.7.3"
},
"devDependencies": {
"@eslint/js": "^9.18.0",
"@types/node": "^22.10.6",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.14.0",
"jest": "^29.7.0",
"nodemon": "^3.1.9",
"prettier": "^3.4.2",
"ts-node": "^10.9.2",
"typescript-eslint": "^8.20.0"
}
}

1
src/index.ts Normal file
View File

@ -0,0 +1 @@
console.log('test')

9
test/index.spec.ts Normal file
View File

@ -0,0 +1,9 @@
describe('A test', () => {
test('Fails', () => {
expect(1).toBe(2)
})
test('Succeeds', () => {
expect(3).toBe(3)
})
})

19
tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"target": "ESNext",
"isolatedModules": true,
"esModuleInterop": true,
"outDir": "dist",
"lib": [ "esnext" ],
"types": [ "node" ],
"baseUrl": "./",
"rootDir": "src"
},
"exclude": [ "node_modules" ],
"include": [
"src"
]
}

2890
yarn.lock Normal file

File diff suppressed because it is too large Load Diff