Code Monkey home page Code Monkey logo

node-typescript-eslint-airbnb's Introduction

node-typescript-eslint-airbnb

Boilerplate node typescript project with eslint and airbnb config. Contains minor adjustments from standard

What is this?

This is a boilerplate nodejs typescript project that uses eslint with airbnb config for linting and formatting. The eslint config contains some overrides to introduce comfy spaces.

Steps to reproduce

Create node project.

npm init -y

Install typescript and Node ambient types.

npm install typescript @types/node --save-dev

Create typescript config

npx tsc --init

Install eslint

npm i --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin

Create eslint config.

npx eslint --init

Answer prompts.

Need to install the following packages:
  @eslint/create-config
Ok to proceed? (y)
✔ How would you like to use ESLint? · problems
✔ What type of modules does your project use? · esm
✔ Which framework does your project use? · none
✔ Does your project use TypeScript? · No / Yes
✔ Where does your code run? · browser
✔ What format do you want your config file to be in? · JSON
The config that you've selected requires the following dependencies:

@typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest
✔ Would you like to install them now? · No / Yes
✔ Which package manager do you want to use? · npm

Install airbnb-base config.

npx install-peerdeps --dev eslint-config-airbnb-base

Add airbnb-base to .eslintrc.

  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "airbnb-base"
  ],

Add custom eslint rules.

  "rules": {
    "no-console": "off",
    "quotes": ["error", "double"],
    "space-in-parens": ["error", "always"],
    "array-bracket-spacing": [ "error", "always" ],
  }

Add VSCode integration

{
  "editor.tabSize": 2,
  "eslint.format.enable": true,
  "eslint.validate": ["javascript", "typescript"],
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.formatOnPaste": true,
  "editor.formatOnSave": true
}

node-typescript-eslint-airbnb's People

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.