A Simple Project With TypeScript & NodeJs

Overview

Assumptions

Getting Started

mkdir read-excel
cd .\read-excel\
npm init -y
The output from npm init -y
npm i -D commitizen commitlint cz-conventional-changelog eslint @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-prettier ts-node
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js', 'graphql.ts'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
{
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "auto"
}
const helloWorld = () => {
console.log('Hellow, World')
}

helloWorld();
  "scripts": {
"start": "ts-node src/index.ts"
},
Output from running npm run start
# ignore the node_modules folder.
node_modules
# Keep environment variables out of version control
.env
.env.*

# IDE
.idea/

# Dist
dist/

# coverage
coverage

# documentation
documentation

# ignore any temp documents
temp
git init
git add .
git-cz
Output in a PowerShell terminal for git commands
Enter the details in the cz wizard like this
GitHub repo add code instructions
git remote add origin git@github.com:<USERNAME>/read-excel.git
git push -u origin main
Output from a GitHub push
Using git flow init command
git push --set-upstream origin develop
Github repo
  "scripts": {
"eslint": "eslint src/**",
"start": "ts-node src/index.ts"
},
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"lib": ["esnext"],
"esModuleInterop": true
}
}
Post lint errors
  "scripts": {
"eslint": "eslint src/** --fix",
"start": "ts-node src/index.ts"
},
git add .
git-cz
Adding the git-cz details

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Allison

Andrew Allison

62 Followers

15 Years of Professionally putting characters in places that produces great software systems. A life time of hacking on computers.