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

tslint

Package Overview
Dependencies
Maintainers
1
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslint - npm Package Compare versions

Comparing version 0.4.10 to 0.4.11

build/rules/noSwitchCaseFallThroughRule.js

37

build/rules/noTrailingWhitespaceRule.js

@@ -26,23 +26,28 @@ var __extends = this.__extends || function (d, b) {

NoTrailingWhitespaceWalker.prototype.visitToken = function (token) {
var leadingTrivia = token.leadingTrivia();
var trailingTrivia = token.trailingTrivia();
var position = this.position();
var trailingPosition = position + leadingTrivia.fullWidth() + token.width();
this.checkForTrailingWhitespace(leadingTrivia, position);
this.checkForTrailingWhitespace(trailingTrivia, trailingPosition);
_super.prototype.visitToken.call(this, token);
this.checkForTrailingWhitespace(token.trailingTrivia());
};
NoTrailingWhitespaceWalker.prototype.visitNode = function (node) {
_super.prototype.visitNode.call(this, node);
this.checkForTrailingWhitespace(node.trailingTrivia());
};
NoTrailingWhitespaceWalker.prototype.checkForTrailingWhitespace = function (triviaList, position) {
var start = position;
NoTrailingWhitespaceWalker.prototype.checkForTrailingWhitespace = function (triviaList) {
if (triviaList.count() < 2) {
return;
}
for (var i = 0; i < triviaList.count() - 1; i++) {
var trivia = triviaList.syntaxTriviaAt(i);
var nextTrivia = triviaList.syntaxTriviaAt(i + 1);
var lastButOne = triviaList.count() - 2;
var trivia = triviaList.syntaxTriviaAt(lastButOne);
var triviaKind = trivia.kind();
if (triviaList.hasNewLine() && triviaKind === 4 /* WhitespaceTrivia */) {
var start = this.position() - trivia.fullWidth() - 1;
var failure = this.createFailure(start, trivia.fullWidth(), Rule.FAILURE_STRING);
this.addFailure(failure);
if (trivia.kind() === 4 /* WhitespaceTrivia */ && nextTrivia.kind() === 5 /* NewLineTrivia */) {
var width = trivia.fullWidth();
var failure = this.createFailure(start, width, Rule.FAILURE_STRING);
this.addFailure(failure);
}
start += trivia.fullWidth();
}

@@ -49,0 +54,0 @@ };

Change Log
===
v0.4.10
---
* [bugs] #136, #163
* internal refactors
v0.4.10
---
* [bugs] #138, #145, #146, #148
v0.4.9

@@ -5,0 +16,0 @@ ---

@@ -38,2 +38,3 @@ {

"no-string-literal": true,
"no-switch-case-fall-through": true,
"no-trailing-comma": true,

@@ -58,3 +59,2 @@ "no-trailing-whitespace": true,

"callSignature",
"catchClause",
"indexSignature",

@@ -61,0 +61,0 @@ "parameter",

{
"name": "tslint",
"version": "0.4.10",
"version": "0.4.11",
"description": "a static analysis linter for TypeScript",

@@ -5,0 +5,0 @@ "bin": {

@@ -41,2 +41,3 @@ TSLint [![NPM version](https://badge.fury.io/js/tslint.png)](http://badge.fury.io/js/tslint) [![Builds](https://api.travis-ci.org/repositories/palantir/tslint.png?branch=master)](https://travis-ci.org/palantir/tslint)

* `no-string-literal` disallows object access via string literals.
* `no-switch-case-fall-through` disallows falling through case statements.
* `no-trailing-comma` disallows trailing comma within object literals.

@@ -62,3 +63,2 @@ * `no-trailing-whitespace` disallows trailing whitespace at the end of a line.

* `"callSignature"` checks return type of functions
* `"catchClause"` checks type in exception catch blocks
* `"indexSignature"` checks index type specifier of indexers

@@ -65,0 +65,0 @@ * `"parameter"` checks type specifier of parameters

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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