Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@threads/tsconfig

Package Overview
Dependencies
Maintainers
15
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@threads/tsconfig

ThreadsStyling tsconfig, tslint, prettier etc. configs

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
288
decreased by-13.25%
Maintainers
15
Weekly downloads
 
Created
Source

tsconfig

ThreadsStyling tsconfig, tslint, prettier etc. configs. These shared configs are used to set up our TypeScript projects.

TypeScript Config

To use Threads' tsconfig as your default config. Install typescript via:

yarn add -D @threads/tsconfig typescript

and add the following tsconfig.json in your project's root directory:

{
  "extends": "@threads/tsconfig",
  "compilerOptions": {
    "outDir": "lib"
  },
  "include": ["src"]
}

In package.json add:

{
  ...
  "scripts": {
    ...
    "build": "tsc"
    ...
  }
  ...
}

TSLint Config

To use Threads' tslint as your default config. Install tslint via:

yarn add -D @threads/tsconfig tslint

and add the following tslint.json in your project's root directory:

{
  "extends": "@threads/tsconfig/tslint"
}

In package.json add:

{
  ...
  "scripts": {
    ...
    "lint": "tslint './src/**/*.{ts,tsx}' -t verbose -p ."
    ...
  }
  ...
}

Prettier Config

To use Threads' prettier as your default config. Install prettier via:

yarn add -D @threads/tsconfig prettier

and add the following prettier.config.js in your project's root directory:

module.exports = require('@threads/tslint/prettier');

In package.json add:

{
  ...
  "scripts": {
    ...
    "prettier:write": "prettier --ignore-path .gitignore --write './**/*.{md,json,yaml,js,jsx,ts,tsx}'",
    "prettier:check": "prettier --ignore-path .gitignore --list-different './**/*.{md,json,yaml,js,jsx,ts,tsx}'",
    ...
  }
  ...
}

Husky / Lint-Staged / Commit Lint

We recommend using husky with lint staged. To do this, run:

yarn add -D @threads/tslint @commitlint/cli tslint prettier husky lint-staged

add the following commitlint.config.js in your project's root directory:

module.exports = require('@threads/tslint/commitlint');

and add the following to package.json. This will run prettier and tslint on just files that have changed, and enforce that commits all start with feat:/fix:/etc.

{
  ...
    "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,tsx}": [
      "prettier --write",
      "tslint -t verbose -p .",
      "git add"
    ],
    "*.{md,json,yaml,js,jsx}": [
      "prettier --write",
      "git add"
    ]
  }
  ...
}

License

MIT

Keywords

FAQs

Package last updated on 03 Jul 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc