GithubHelp home page GithubHelp logo

passport-google-test's Introduction

Setup

  1. npm i
  2. Use VSCode, make sure the recommended eslint and prettier plugins are installed. Automatic linting should occur when you save!
  3. npx husky install. Automatic linting should occur when you commit!

Commands

  • npm run dev: Run with live reloading.
  • npm run build: Generates the production build.
  • npm start: Runs the production build.

Steps to reproduce template

npm init

Create .gitignore with node_modules

npm i -D typescript

Create tsconfig.json:

{
  "compilerOptions": {
    "incremental": true,
    "target": "es2016",
    "module": "commonjs",
    "outDir": "dist",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true
  },
  "include": ["src/**/*"]
}

Create src/index.ts:

console.log('Hello, world!');

Add dist to .gitignore

Add to scripts in package.json:

"start": "node dist/index.js",
"build": "tsc"

npm i -D ts-node-dev

Add "dev": "tsnd --respawn --transpile-only src/index.ts" to scripts in package.json

npm i -D eslint @typescript-eslint/eslint-plugin prettier eslint-config-prettier

Create .eslintrc.json:

{
  "extends": ["plugin:@typescript-eslint/recommended", "prettier"],
  "rules": {
    "eqeqeq": "error",
    "no-case-declarations": "error"
  }
}

Create .prettierrc.json:

{
  "singleQuote": true,
  "trailingComma": "all"
}

Create .vscode/extensions.json:

{
  "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}

Create .vscode/settings.json:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

npm i -D husky lint-staged, npx husky install, npx husky add .husky/pre-commit "npx lint-staged"

Create lint-staged.config.js:

module.exports = {
  '**/*.(ts)': () => 'npx tsc --noEmit',
  '**/*.(ts)': (filenames) => [
    `npx eslint --fix ${filenames.join(' ')}`,
    `npx prettier --write ${filenames.join(' ')}`,
  ],
  '**/*.(md|json)': (filenames) =>
    `npx prettier --write ${filenames.join(' ')}`,
};

Add .env to .gitignore

npm i dotenv

Add import dotenv from 'dotenv'; and dotenv.config(); to src/index.ts

passport-google-test's People

Contributors

tmwilliamlin168 avatar

Stargazers

Edward Hoang avatar kunal dongre avatar Crescent avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.