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

nwronski-tslint-rules

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nwronski-tslint-rules

TSLint rule configuration for Node and Angular projects

  • 4.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

nwronski-tslint-rules

This repo contains my TSLint rule configurations for projects that use TypeScript and/or Angular.

Installation

Use the TypeScript Rules Installation for plain Node + TypeScript projects or the Angular Rules Installation for Angular + TypeScript projects.

TypeScript Rules Installation

Install the nwronski-tslint-rules and tslint modules.

npm i -D nwronski-tslint-rules tslint

Create a tslint.json file in the root folder of your project and add the following:

{
  "extends": "nwronski-tslint-rules"
}

Angular Rules Installation

Install the nwronski-tslint-rules, tslint, and codelyzer modules.

npm i -D nwronski-tslint-rules tslint codelyzer

Create a tslint.json file in the root folder of your project and add the following:

{
  "extends": "nwronski-tslint-rules/tslint-ng2.json",
  "rules": {
    "directive-selector": [ true, "attribute", "nw", "camelCase" ],
    "component-selector": [ true, "element", "nw", "kebab-case" ]
  }
}

Don't forget to change nw to your preferred prefix for component and directive selectors.

Usage

Add a script to the scripts section of your package.json, making sure to set the correct pattern for your source files (the example uses src/**/*.ts):

{
  "scripts": {
    "lint": "tslint --fix --config ./tslint.json --project ./tsconfig.json 'src/**/*.ts'"
  }
}

If you have a build script then you should modify it so that the linting is done before the project can be successfully built. For example, you could prepend the linting command to your build command to make sure the linting is run first.

npm run lint

Keywords

FAQs

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