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 4.5.0 to 4.5.1-dev.0

18

CHANGELOG.md
Change Log
===
v4.5.1-dev.0
---
* Include latest v4.5.1 changes
v4.5.1
---
- [enhancement] Updated recommended rules to include `ban-types` and `no-duplicate-super` (#2271)
- [bugfix] `object-literal-key-quotes` handle negative number property name (#2273)
v4.5.0

@@ -33,2 +44,4 @@ ---

- [enhancement] `no-unbound-method` allows property access and binary expressions (#2143)
- [api] Introduce `AbstractWalker` for performance (#2093)
- see [performance] (https://palantir.github.io/tslint/develop/custom-rules/performance.html) and [migration] (https://palantir.github.io/tslint/develop/custom-rules/migration.html) docs

@@ -113,2 +126,7 @@ Thanks to our contributors!

v4.3.0-dev.0
---
* Include latest v4.3.1 changes
v4.3.1

@@ -115,0 +133,0 @@ ---

2

lib/configs/latest.d.ts

@@ -39,4 +39,6 @@ /**

"no-misused-new": boolean;
"ban-types": (boolean | string[])[];
"no-duplicate-super": boolean;
};
declare const xtends = "tslint:recommended";
export { xtends as extends };

@@ -52,2 +52,13 @@ /**

"no-misused-new": true,
// added in v4.5
"ban-types": [
true,
["Object", "Avoid using the `Object` type. Did you mean `object`?"],
["Function", "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."],
["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"],
["Number", "Avoid using the `Number` type. Did you mean `number`?"],
["String", "Avoid using the `String` type. Did you mean `string`?"],
["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"],
],
"no-duplicate-super": true,
};

@@ -54,0 +65,0 @@ // tslint:enable object-literal-sort-keys

3

lib/formatterLoader.d.ts

@@ -1,1 +0,2 @@

export declare function findFormatter(name: string | Function, formattersDirectory?: string): any;
import { FormatterFunction } from "./index";
export declare function findFormatter(name: string | FormatterFunction, formattersDirectory?: string): any;

@@ -24,13 +24,7 @@ /**

var CORE_FORMATTERS_DIRECTORY = path.resolve(moduleDirectory, ".", "formatters");
function isFunction(variable) {
return typeof variable === "function";
}
function isString(variable) {
return typeof variable === "string";
}
function findFormatter(name, formattersDirectory) {
if (isFunction(name)) {
if (typeof name === "function") {
return name;
}
else if (isString(name)) {
else if (typeof name === "string") {
name = name.trim();

@@ -37,0 +31,0 @@ var camelizedName = utils_1.camelize(name + "Formatter");

@@ -37,10 +37,11 @@ /**

fixes?: RuleFailure[];
format: string | Function;
format: string | FormatterFunction;
output: string;
}
export declare type FormatterFunction = (failures: RuleFailure[]) => string;
export interface ILinterOptions {
fix: boolean;
formatter?: string | Function;
formatter?: string | FormatterFunction;
formattersDirectory?: string;
rulesDirectory?: string | string[];
}

@@ -116,3 +116,5 @@ /**

var formatter;
var formattersDirectory = configuration_1.getRelativePath(this.options.formattersDirectory);
var formattersDirectory = this.options.formattersDirectory !== undefined
? configuration_1.getRelativePath(this.options.formattersDirectory)
: undefined;
var formatterName = this.options.formatter || "prose";

@@ -197,3 +199,3 @@ var Formatter = formatterLoader_1.findFormatter(formatterName, formattersDirectory);

}());
Linter.VERSION = "4.5.0";
Linter.VERSION = "4.5.1-dev.0";
Linter.findConfiguration = configuration_1.findConfiguration;

@@ -200,0 +202,0 @@ Linter.findConfigurationPath = configuration_1.findConfigurationPath;

@@ -146,3 +146,3 @@ /**

function propertyNeedsQuotes(property) {
return !IDENTIFIER_NAME_REGEX.test(property) && Number(property).toString() !== property;
return !IDENTIFIER_NAME_REGEX.test(property) && (Number(property).toString() !== property || property.startsWith("-"));
}

@@ -149,0 +149,0 @@ // This is simplistic. See https://mothereff.in/js-properties for the gorey details.

@@ -263,3 +263,3 @@ /**

: is(ts.TypeFlags.Null) ? 6 /* Null */
: is(ts.TypeFlags.Undefined | ts.TypeFlags.Void) ? 7 /* Undefined */ // tslint:disable-line:no-bitwise
: is(ts.TypeFlags.Undefined | ts.TypeFlags.Void) ? 7 /* Undefined */
: is(ts.TypeFlags.EnumLike) ? 8 /* Enum */

@@ -266,0 +266,0 @@ : is(ts.TypeFlags.NumberLiteral) ?

{
"name": "tslint",
"version": "4.5.0",
"version": "4.5.1-dev.0",
"description": "An extensible static analysis linter for the TypeScript language",

@@ -50,3 +50,3 @@ "bin": {

"peerDependencies": {
"typescript": ">=2.0.0"
"typescript": ">=2.0.0-dev || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev"
},

@@ -73,5 +73,5 @@ "devDependencies": {

"rimraf": "^2.5.4",
"tslint": "latest",
"tslint": "next",
"tslint-test-config-non-relative": "file:test/external/tslint-test-config-non-relative",
"typescript": "^2.2.1"
"typescript": ">=2.3.0-dev"
},

@@ -78,0 +78,0 @@ "license": "Apache-2.0",

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