Socket
Socket
Sign inDemoInstall

nwronski-tslint-rules

Package Overview
Dependencies
68
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nwronski-tslint-rules

TSLint rule configuration for Node and Angular projects


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
1.13 MB
Created
Weekly downloads
 

Changelog

Source

4.0.3 (2019-09-09)

Bug Fixes

  • accept any valid TypeScript version (a9f950f)

Readme

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

Last updated on 09 Sep 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc