Socket
Book a DemoInstallSign in
Socket

@privyid/eslint-config-ts

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@privyid/eslint-config-ts

Eslint shareable config for Typescript

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
1
Maintainers
3
Weekly downloads
 
Created
Source

@privyid/eslint-config-ts

Eslint shareable config for Typescript

Usage

First, install all dependencies

NPM

npm install --save-dev \
  eslint \
  babel-eslint \
  eslint-config-standard \
  eslint-plugin-import \
  eslint-plugin-node \
  eslint-plugin-promise \
  eslint-plugin-standard \
  eslint-plugin-unicorn \
  eslint-plugin-varspacing \
  eslint-plugin-vue \
  @privyid/eslint-config-js \
  @privyid/eslint-config-ts \
  @typescript-eslint/eslint-plugin \
  @typescript-eslint/parser

Yarn

yarn add --dev \
  eslint \
  babel-eslint \
  eslint-config-standard \
  eslint-plugin-import \
  eslint-plugin-node \
  eslint-plugin-promise \
  eslint-plugin-standard \
  eslint-plugin-unicorn \
  eslint-plugin-varspacing \
  eslint-plugin-vue \
  @privyid/eslint-config-js \
  @privyid/eslint-config-ts \
  @typescript-eslint/eslint-plugin \
  @typescript-eslint/parser

Then, add this to your .eslintrc file (create one if doesn't exist):

{
  "extends": "@privyid/eslint-config-ts"
}

Optional, add this to package.json script's

{
  // ...
  "scripts": {
    // ...
    "lint:js": "eslint --ext .ts,.js,.vue --ignore-path .gitignore .",
    "fix:js": "eslint --fix --ext .ts,.js,.vue --ignore-path .gitignore .",
    // ...
  }
  // ...
}

Lint on commit

If you run linting every commit, you can use pre-commit and lint-staged

# NPM
npm install --save-dev pre-commit lint-staged

# Yarn
yarn add --dev pre-commit lint-staged

and this to your package.json

{
  // ...
  "scripts": {
    // ...
    "precommit": "lint-staged",
    // ...
  },
  // ...
  "precommit": ["precommit"],
  "lint-staged": {
    "*.(js|ts|vue)": [
      "eslint --fix"
    ],
    // ...
  },
  // ...
}

License

This project is licensed under the MIT License - see the LICENSE file for details

Keywords

eslint

FAQs

Package last updated on 13 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts