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

eslint-config-typescript

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-typescript

A base set of recommended ESLint rules for TypeScript projects

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35K
decreased by-12.63%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-typescript

An opinionated set of ESLint rules for TypeScript projects

Installation

Install eslint-config-typescript:

$ npm install --save-dev eslint-config-typescript

Then, add eslint-config-typescript to the "extends" array in your ESLint file. Make sure to put it last, so it gets the chance to override other configs.

{
  "extends": [
    "typescript"
  ]
}

A few ESLint plugins are supported as well:

{
  "extends": [
    "typescript",
    "typescript/react",
    "typescript/prettier",
    "typescript/prettier-react"
  ]
}

Note: typescript/prettier-react will automatically import typescript/prettier.

Example configuration

Using default prettier configurations:

{
  "extends": [
    "typescript",
    "typescript/prettier"    
  ],
  "plugins": ["filenames", "jest"],
  "env": {    
    "jest": true,
    "node": true
  },
  "rules": {
    "filenames/no-index": "error",
    "filenames/match-exported": ["error", "kebab"],
    "jest/no-disabled-tests": "error",
    "jest/no-focused-tests": "error",
    "jest/no-identical-title": "error",
    "jest/valid-expect": "error"
  }
}

Using specific react configurations:

{
  "extends": [
    "typescript",
    "typescript/react",
    "typescript/prettier-react"
  ],
  "plugins": ["filenames", "jest"],
  "env": {    
    "jest": true,
    "node": true
  },
  "rules": {
    "filenames/no-index": "error",
    "filenames/match-exported": ["error", "kebab"],
    "jest/no-disabled-tests": "error",
    "jest/no-focused-tests": "error",
    "jest/no-identical-title": "error",
    "jest/valid-expect": "error",
    "prettier/prettier": [
      "error",
      {
        "semi": false,
        "tabWidth": 4,
        "singleQuote": true
      }
    ]
  }
}

Keywords

FAQs

Package last updated on 05 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