New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tslint-microsoft-contrib

Package Overview
Dependencies
Maintainers
5
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

  • 6.1.1-beta1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
97K
decreased by-14.06%
Maintainers
5
Weekly downloads
 
Created

What is tslint-microsoft-contrib?

The tslint-microsoft-contrib package is a set of TSLint rules developed by Microsoft. It provides a collection of rules that help enforce best practices and coding standards in TypeScript projects, particularly those that align with Microsoft's internal guidelines.

What are tslint-microsoft-contrib's main functionalities?

Security Rules

Security rules help prevent common security vulnerabilities. For example, the 'no-eval' rule disallows the use of the eval() function, which can lead to code injection attacks.

/* Example of the 'no-eval' rule */
const userInput = '2 + 2';
const result = eval(userInput); // This will trigger a linting error

Performance Rules

Performance rules aim to improve the performance of your code. For instance, the 'no-for-in' rule discourages the use of for-in loops, which can be slower and less predictable than other iteration methods.

/* Example of the 'no-for-in' rule */
const obj = { a: 1, b: 2, c: 3 };
for (const key in obj) {
  if (obj.hasOwnProperty(key)) {
    console.log(key, obj[key]);
  }
} // This will trigger a linting error

Accessibility Rules

Accessibility rules ensure that your code is accessible to all users, including those with disabilities. The 'react-a11y-anchors' rule, for example, enforces best practices for anchor elements in React applications.

/* Example of the 'react-a11y-anchors' rule */
<a href='#' onClick={handleClick}>Click me</a> // This will trigger a linting error

Code Quality Rules

Code quality rules help maintain a high standard of code. The 'no-duplicate-variable' rule prevents the declaration of variables with the same name within the same scope.

/* Example of the 'no-duplicate-variable' rule */
let x = 1;
let x = 2; // This will trigger a linting error

Other packages similar to tslint-microsoft-contrib

Keywords

FAQs

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