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

tslint-microsoft-contrib

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslint-microsoft-contrib

TSLint Rules for Microsoft

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
57K
increased by13.45%
Maintainers
1
Weekly downloads
 
Created
Source

tslint-microsoft-contrib

A set of TSLint rules used on some Microsoft projects.

Version 0.0.1

This software is not yet released with a 1.0 version. All release blockers are listed in the issues page.

Installation

npm install tslint-microsoft-contrib

Configuration

Configure your Grunt build task

Add the new rulesDirectory to your tslint task:

grunt.initConfig({
  tslint: {
    options: {
      rulesDirectory: 'node_modules/tslint-microsoft-contrib',
      configuration: grunt.file.readJSON("tslint-contrib.json")
    },
    files: {
      src: ['src/file1.ts', 'src/file2.ts']
    }
  }
})

The tslint-contrib.json file follows the same conventions as other tslint rules.

Supported Rules

A sample configuration file with all options is available under tslint-microsoft-contrig/tslint.json

  • missing-optional-annotation A parameter that follows one or more parameters marked as optional is not itself marked optional
  • no-banned-terms Do not use banned terms: caller, callee, eval, arguments. These terms refer to functions or properties that should not be used, so it is best practice to simply avoid them.
  • no-cookies Do not use cookies
  • no-delete-expression Do not delete expressions. Only properties should be deleted
  • no-disable-auto-sanitization Do not disable auto-sanitization of HTML because this opens up your page to an XSS attack. Specifically, do not use the execUnsafeLocalFunction or setInnerHTMLUnsafe functions.
  • no-document-write Do not use document.write
  • no-duplicate-parameter-names Do not write functions or methods with duplicate parameter names
  • no-exec-script Do not use the execScript functions
  • no-function-constructor-with-string-args Do not use the version of the Function constructor that accepts a string argument to define the body of the function
  • no-increment-decrement Avoid use of increment and decrement operators particularly as part of complicated expressions
  • no-multiline-string Do not declare multiline strings
  • no-unnecessary-semicolons Remove unnecessary semicolons
  • no-octal-literal Do not use octal literals or escaped octal sequences
  • no-reserved-keywords Do not use reserved keywords as names of local variables, fields, functions, or other identifiers.
  • no-string-based-set-immediate Do not use the version of setImmediate that accepts code as a string argument. However, it is acceptable to use the version of setImmediate where a direct reference to a function is provided as the callback argument
  • no-string-based-set-interval Do not use the version of setInterval that accepts code as a string argument. However, it is acceptable to use the version of setInterval where a direct reference to a function is provided as the callback argument
  • no-string-based-set-timeout Do not use the version of setTimeout that accepts code as a string argument. However, it is acceptable to use the version of setTimeout where a direct reference to a function is provided as the callback argument
  • no-unused-imports Remove unused imports
  • no-with-statement Do not use with statements. Assign the item to a new variable instead

Development

To develop tslint-microsoft-contrib simply clone the repository, install dependencies and run grunt:

git config --global core.autocrlf input
git config --global core.eol lf
git clone git@github.com:Microsoft/tslint-microsoft-contrib.git
cd tslint-microsoft-contrib
npm install
grunt all

Creating a new Release

  1. Bump up the version number in package.json
  2. Run grunt all to build the latest sources
  3. Commit
  4. Create a git tag for the new release and push it

Keywords

FAQs

Package last updated on 21 Aug 2015

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