- Vite: frontend build tool and dev server, configured in
./vite.config.ts
- TypeScript: types for js. Configured in
./tsconfig.json
- Various utilities and ESLint rules are installed with a focus on a functional programming style
- ESLint: Linter/code analyzer with plugins for TypeScript and sonarjs. Configured in
./.eslintrc.json
- Prettier: Formatter. Configured in
./.prettierrc.json
- Vitest: testing framework, configured in
./vite.config.ts
> test - npm scripts (run with
npm run <script>
):dev
- starts nodemon in the terminal, which will reload on file changesbuild
- compile prod source code to./dist
start
- after build, run the applint
- evaluate ESLint rules against source codeformat
- format source code with prettier and try to fix any ESLint errorstest:run
- run teststest:ui
- run tests and display on localhosttest
- run unit tests located in./tests
that will reload whenever files changecoverage
- run coverage tests and output results to./coverage
- Source code:
./src
- Tests:
./tests
- Types:
./types
Complete the configuration checklist below and remove from the README once complete.
- Specify the following fields with a search and replace: repo_name, project_title, project_description
- Replace personal information with your own: Tim-W-James, [email protected], https://linkedin.com/in/timothy-william-james/
- Fill out each section of the README as needed, uncommenting/removing sections as needed.
- Add images for the following: images/logo.png, images/screenshot.png
- Specify the LICENSE.txt for the project
- Specify the following fields with a search and replace: repo_name, project_title, project_description, project_keywords
- Replace personal information with your own: Tim-W-James, Tim James
- Set the environment of the project:
- ES Modules (import, export):
- Add to
package.json
:"type": "module"
- Modify the scripts in
package.json
:"dev": "nodemon --watch './**/*.ts' --watch '.env' --exec 'node --experimental-specifier-resolution=node --loader ts-node/esm' src/index.ts"
"start": "node --es-module-specifier-resolution=node dist/index.js"
- Add to
tsconfig.json
:"module": "ES6"
"moduleResolution" : "node
"lib": ["ES6"]
- Add to
.eslintrc.json
:"parserOptions": { "sourceType": "module" }
- Add to
- Node CommonJS (require, exports):
- Add to
package.json
:"type": "commonjs"
- Add to
tsconfig.json
:"module": "commonjs"
- Add to
.eslintrc.json
:"parserOptions": { "sourceType": "script" }
- Add to
- ES Modules (import, export):
- Set the target ES version (ES6 - supported by most browsers, ESNext - latest):
./.eslint.json
:"<target>": true
"ecmaVersion": <target>
./tsconfig.json
:"target": "<target>"
"module": "<target>"
"lib": ["<target>", "DOM"]
- Do you want to commit package-lock? If yes, remove it from the
./.gitignore
- Specify node version in the
.nvmrc
- Specify formatting and editor configuration in
./.editorconfig
. Use the./.prettierrc.json
for js specific rules that are not defined in./.editorconfig
. - Run:
npm i
- Finally, remove/modify the sample code:
./src/*
./tests/*
โ Remove everything above once setup is complete. โ
project_description
Table of Contents
About text.
-
Clone the repo
git clone https://github.com/Tim-W-James/repo_name.git
Distributed under the MIT License. See LICENSE
for more information.
Email: [email protected]
Project Link: https://github.com/Tim-W-James/repo_name