Last active
March 13, 2026 15:42
-
-
Save falkoschumann/367aaec8e19b75f87ca11ec9f89e5b45 to your computer and use it in GitHub Desktop.
Node.js project starter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| corrupt.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "proseWrap": "always", | |
| "plugins": ["prettier-plugin-sql"], | |
| "language": "sqlite", | |
| "keywordCase": "upper", | |
| "dataTypeCase": "upper", | |
| "functionCase": "lower" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) 2025 Falko Schumann. All rights reserved. MIT license. | |
| import js from "@eslint/js"; | |
| import headers from "eslint-plugin-headers"; | |
| import react from "eslint-plugin-react"; | |
| import reactHooks from "eslint-plugin-react-hooks"; | |
| import reactRefresh from "eslint-plugin-react-refresh"; | |
| import globals from "globals"; | |
| import ts from "typescript-eslint"; | |
| export default ts.config( | |
| { ignores: [".venv", "coverage", "dist", "out", "tmp"] }, | |
| { | |
| extends: [js.configs.recommended, ...ts.configs.recommended], | |
| files: ["**/*.{cjs,mjs,js,jsx,ts,tsx}"], | |
| languageOptions: { | |
| ecmaVersion: 2023, | |
| globals: { | |
| ...globals.es2023, | |
| ...globals.browser, | |
| }, | |
| parserOptions: { | |
| ecmaFeatures: { | |
| jsx: true, | |
| }, | |
| }, | |
| }, | |
| plugins: { | |
| headers, | |
| react, | |
| "react-hooks": reactHooks, | |
| "react-refresh": reactRefresh, | |
| }, | |
| rules: { | |
| ...reactHooks.configs.recommended.rules, | |
| ...reactRefresh.configs.recommended.rules, | |
| "headers/header-format": [ | |
| "error", | |
| { | |
| source: "string", | |
| style: "line", | |
| trailingNewlines: 2, | |
| content: `Copyright (c) (copyrightYear) Falko Schumann. All rights reserved. MIT license.`, | |
| patterns: { | |
| copyrightYear: { | |
| pattern: "\\d{4}", | |
| defaultValue: new Date().getUTCFullYear().toString(), | |
| }, | |
| }, | |
| }, | |
| ], | |
| "@typescript-eslint/no-unused-vars": [ | |
| "error", | |
| { argsIgnorePattern: "^_" }, | |
| ], | |
| }, | |
| }, | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PLANTUML_FILES = $(wildcard doc/images/*.puml) | |
| DIAGRAM_FILES = $(subst .puml,.png,$(PLANTUML_FILES)) | |
| all: dist check | |
| clean: | |
| rm -rf coverage out testdata | |
| distclean: clean | |
| rm -rf dist | |
| rm -rf node_modules | |
| dist: build | |
| start: prepare | |
| bun start | |
| doc: $(DIAGRAM_FILES) | |
| check: test | |
| bunx eslint . | |
| bunx stylelint "**/*.css" --ignore-path .gitignore | |
| bunx prettier --check . | |
| bunx sheriff verify | |
| format: | |
| bunx eslint --fix . | |
| bunx stylelint "**/*.css" --fix --ignore-path .gitignore | |
| bunx prettier --write . | |
| dev: prepare | |
| bun run dev | |
| test: prepare | |
| bunx vitest run | |
| watch: prepare | |
| bun test | |
| unit-tests: prepare | |
| bunx vitest run unit | |
| integration-tests: prepare | |
| bunx vitest run integration | |
| e2e-tests: prepare | |
| bunx vitest run e2e | |
| build: prepare | |
| bun run build | |
| prepare: version | |
| ifdef CI | |
| ifeq ($(findstring $(DEPENDABOT), $(GITHUB_ACTOR)), $(DEPENDABOT)) | |
| @echo "dependabot detected, run bun install" | |
| bun install | |
| else | |
| @echo "CI detected, run bun ci" | |
| bun ci | |
| endif | |
| else | |
| bun install | |
| endif | |
| version: | |
| @echo "Using bun $(shell bun --version)" | |
| $(DIAGRAM_FILES): %.png: %.puml | |
| plantuml $^ | |
| .PHONY: \ | |
| all clean distclean dist \ | |
| start doc \ | |
| check format \ | |
| dev test watch unit-tests integration-tests e2e-tests \ | |
| build prepare version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) 2026 Falko Schumann. All rights reserved. MIT license. | |
| /** @type {import("stylelint").Config} */ | |
| export default { | |
| extends: ["stylelint-config-standard"], | |
| rules: { | |
| // Importing SASS partials needs string notation | |
| //"import-notation": "string", | |
| }, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "compilerOptions": { | |
| // Type Checking | |
| "noFallthroughCasesInSwitch": true, | |
| "noImplicitAny": true, | |
| "noImplicitOverride": true, | |
| "noImplicitReturns": true, | |
| "noPropertyAccessFromIndexSignature": true, | |
| "noUncheckedIndexedAccess": true, | |
| "noUnusedLocals": true, | |
| "noUnusedParameters": true, | |
| "strict": true, | |
| "strictBindCallApply": true, | |
| "strictNullChecks": true, | |
| "strictPropertyInitialization": true, | |
| "useUnknownInCatchVariables": true, | |
| // Modules | |
| "allowImportingTsExtensions": true, | |
| "module": "Preserve", | |
| "moduleResolution": "bundler", | |
| "noUncheckedSideEffectImports": true, | |
| // Emit | |
| "noEmit": true, | |
| // JavaScript Support | |
| "allowJs": true, | |
| // Interop Constraints | |
| "allowSyntheticDefaultImports": true, | |
| "erasableSyntaxOnly": true, | |
| "forceConsistentCasingInFileNames": true, | |
| "verbatimModuleSyntax": true, | |
| // Language and Environment | |
| "jsx": "react-jsx", | |
| "moduleDetection": "force", | |
| "target": "ES2023", | |
| "useDefineForClassFields": true, | |
| // Projects | |
| "lib": ["ES2023", "DOM"], | |
| "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo", | |
| // Completeness | |
| "skipLibCheck": true | |
| }, | |
| "exclude": ["dist", "node_modules"] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) 2025 Falko Schumann. All rights reserved. MIT license. | |
| import { defineConfig } from "vitest/config"; | |
| export default defineConfig({ | |
| test: { | |
| coverage: { | |
| enabled: true, | |
| include: [ | |
| "src/**/application/**/*", | |
| "src/**/common/**/*", | |
| "src/**/domain/**/*", | |
| "src/**/infrastructure/**/*", | |
| // exclude layers UI and root | |
| ], | |
| provider: "istanbul", | |
| thresholds: { | |
| statements: 90, | |
| branches: 90, | |
| }, | |
| }, | |
| reporters: ["tree"], | |
| }, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment