Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@silicon-soldier/eslint-config-typescript

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silicon-soldier/eslint-config-typescript

This ESLint configuration targets TypeScript, building on the baseline configuration `@silicon-soldier/eslint-config`.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

ESLint Config

This ESLint configuration targets TypeScript, building on the baseline configuration @silicon-soldier/eslint-config.

1. Install

npm i --save-dev @silicon-soldier/eslint-config-typescript

This plugin requires ESLint 6. Note that @typescript-eslint/parser and @typescript-eslint/eslint-plugin will peer dependency warning for ESLint 5, this can be safely ignored as they are compatible with both versions. Offical support in those plugins will arrive in v2, which is currently held up by other planned breaking changes that are targetted for the same major version bump.

2. Configure

Create an ESLint config file called .eslintrc.json (or whichever extension you need/prefer).

{
    "extends": "@silicon-soldier/eslint-config-typescript",
    "parserOptions": {
        "ecmaVersion": 2015
    }
}

Some things to note are;

  • ECMA version is specified to ensure ESLint interprets source according to the correct spec version.
  • ESLint may need to be explicitly told what files to lint.
  • ESLint will not lint TypeScript files unless you tell it to include them .ts files. Use the --ext flag, or provide a glob that includes the file extension to get around this.

3. Integrate

ESLint isn't magic. To actually get value out, you'll need to integrate it with your projects existing tooling to maximise value. Some other recommendations are;

  • Integrating with Git Hooks using Husky, good for avoiding accidental commits of unlinted code.
  • Including it in integration tests so that bad linting can be caught for every push/PR in a reliable fashion.
  • Installing plugins for your IDE that will automatically lint what is being viewed, and overlay issues.

FAQs

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