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 Versions

1
19

5.10.0

Diff

Changelog

Source

v5.10.0

:tada: Features

:hammer_and_wrench: Bugfixes & enhancements

  • [bugfix]file-header rule plays nice with no-trailing-whitespace rule (#3802)
  • [bugfix]no-unbound-method rule allows square bracket property access (#3610)
  • [bugfix]no-unsafe-any no longer marks native JSX elements as unsafe (#3699)
  • [enhancement]file-header auto-fixes use '!' character to ensure header stays above imports (#3741)
  • [enhancement] Better error messages if a rule crashes (#3836)
  • [enhancement] Better error messages when no valid rules are specified (#3729)
  • [enhancement] Better lint messages for unused imports in no-unused-variable rule (#3831)
  • [docs] Improve documentation of cli flag --project (#3703)
  • [docs] Added short rationales for about thirty rules (#3734)
  • [docs] Added optional capability to provide code examples in rules' metadata (#3602)
  • [docs] Many small docs fixes and tweaks from many great contributors!

Thanks to our contributors!

  • Achim Weimert
  • BB9z
  • Blair Zajac
  • Chia-Lun Wu (Leo)
  • Ethan
  • Janis Koehr
  • Josh Goldberg
  • Julian Verdurmen
  • Lucas Sloan
  • Mark Vincze
  • Martin Möhwald
  • Oliver Joseph Ash
  • Pichest Wongsiripiphat
  • Rafael Santana
  • Ruben Bridgewater
  • Ryan Waskiewicz
  • Sehrope Sarkuni
  • Suchan Lee
  • Victor Belozyorov
  • aervin_
  • cwgorman
  • felipeissa
  • jishi9
palantir
published 5.9.1 •

Changelog

Source

v5.9.1

:hammer_and_wrench: Bugfixes

  • [bugfix] Removed extraneous deprecation warning produced when using tslint:recommended or tslint:latest by disabling typeof-compare in these rulesets. (#3639)
  • [bugfix] Resolve directories as absolute paths when validating custom rulesDirectory paths, which fixes usage with tslint-loader. (#3640)
palantir
published 5.9.0 •

Changelog

Source

v5.9.0

:warning: Deprecations

  • [deprecation] Several utility functions from src/language/utils.ts have been deprecated (#3476)
  • [deprecation] Linting non-existent files now outputs a warning. This will be an error in TSLint 6. (#3313)

Configuration inheritance changes

Significant changes have been made to configuration inheritance to address a long-standing UX issue around defaultSeverity: #2569.

defaultSeverity defined in a tslint.json file will now override the defaultSeverity value defined in any configurations you are extending. This means that any rules specified in the base configurations can now take on a new defaultSeverity if you so choose. If you extend multiple configuration files, the defaultSeverity defined in the last one wins.

In practice, this allows users to, for example, more easily use the built-in TSLint configurations (tslint:recommended, tslint:latest, tslint:all) and treat all errors as warnings instead of errors.

For more details, see the relevant PRs:

  • Override defaultSeverity defined in extended configs (#3449)
  • Inherit defaultSeverity and apply it to preceding base configs (#3530)

:tada: Features

:hammer_and_wrench: Bugfixes & enhancements

  • [bugfix] Update commander.js dependency to prevent users from transitively installing a buggy 2.12.0 release (#3510)
  • [bugfix] --project excludes all files of external dependencies (#3320)
  • [bugfix] Show errors when tsconfig.json is invalid (#3410)
  • [bugfix]no-implicit-dependencies don't crash on malformed package.json (#3373)
  • [bugfix]strict-type-predicates allows comparing typeof result with non-literals (#3542)
  • [bugfix]no-redundant-jsdoc fixed crash on unhandled tag (#3414)
  • [bugfix]object-literal-sort-keys fixed regression that effectively disabled the rule with \r\n line breaks (#3427)
  • [bugfix]curly fixer now correctly handles comments (#3473)
  • [bugfix]no-unsafe-any fixed false-positive with namespaced types (#3487)
  • [bugfix] Removed potentailly dangerous fixer for no-any (#3486)
  • [bugfix]no-unnecessary-type-assertion fixed false negatives for types with numeric keys (#3468)
  • [bugfix]callable-types adds parentheses when fixing a type literal inside an array type (#3440)
  • [bugfix]no-unsafe-any allows spreading an any value into an object (#3439)
  • [bugfix] no unnecessary whitespace before argument in callback functions fixed with arrow-parens fixer (#3618)
  • [bugfix]prefer-const false negative with index signature named like a variable (#3385)
  • [bugfix]whitespace rule checks property declarations if "check-decl" is enabled (#3546)
  • [bugfix] Using ternary operator for calling super() now passes no-duplicate-super rule. (#3544)
  • [bugfix]no-shadowed-variable now excludes declaration files and ambient modules (#3387)
  • [bugfix]no-duplicate-imports Allow duplicate imports from separate ambient module declarations (#3398)
  • [bugfix]await-promise correctly recognises classes extending Promise (#3383)
  • [bugfix]prefer-conditional-expression: don't repeat error on nested if statements (#3528)
  • [bugfix]completed-docs: don't require documentation on methods in object literals (#3532)
  • [bugfix]one-line fixed crash on syntax error in class or interface (#3538)
  • [bugfix]no-redundant-jsdoc allow @template tag if it has a description (#3415)
  • [bugfix] Fix condition for deprecation of typeof-compare (#3429)
  • [enhancement] Better error message for files not contained in the project (#3313)
  • [enhancement] "properties" option for completed-docs rule now checks getter and setter accessors. (#3497)
  • [enhancement]no-magic-numbers ignores parseInt radix parameter (#3536)
  • [enhancement] Avoid duplicate I/O when using --project option (#3313)
  • [enhancement] clicking the filename in stylish-formatter's output jumps to the first failure in that file. (#3491)
  • [enhancement]ban-comma-operator ignores comma operator inside for-loop incrementor (#3485)
  • [enhancement]space-within-parens updated to always allow empty parentheses (). (#3513)
  • [enhancement] Better error message syntax for completed-docs modifier lists (#3379)
  • [enhancement] Improve failure message & docs for ban-comma-operator (#3384)
  • [enhancement] Output code warnings in yellow instead of red for codeFrame formatter (#3402)
  • [enhancement] Converted completed-docs rule to use a function instead of a walker (#3466)
  • [docs]ban-comma-operator: fix metadata, list as "functionality" rule (#3612)
  • [docs] Enhance no-use-before-declare documentation to clarify the rule's status (#3520)
  • [docs] Enhance await-promise options documentation (#3519)
  • [docs] Add hasFix metadata for the indent rule (#3529)
  • [docs] Clearer rule description for no-irregular-whitespace (#3627)

Thanks to our contributors!

  • Klaus Meinhardt
  • Josh Goldberg
  • Chris Barr
  • Nathan Shively-Sanders
  • Jeremy Morton
  • Sergey Koshechkin
  • Daniel Kucal
  • Eric Smekens
  • Johannes Choo
  • Elena Vilchik
  • Eugene Timokhov
  • Carlo Bottiglieri
  • reduckted
  • Glavin Wiechert
  • jbsingh
  • Mateusz Witkowski
  • HideDev
  • Bruno Lemos
  • aervin_
  • Roman
  • Ryan Waskiewicz
palantir
published 5.8.0 •

Changelog

Source

v5.8.0

:warning: Deprecations

  • [deprecation]typeof-compare is deprecated because typescript already does that check (#3286)
  • [deprecation] CLI argument --type-check is no longer necessary and will be removed in the next major version (#3322)

Updates to tslint:latest configuration

+    "ban-comma-operator": true,
+    "jsdoc-format": {
+        options: "check-multiline-start",
+    },
+    "no-duplicate-switch-case": true,
+    "no-implicit-dependencies": true,
+    "no-return-await": true,

:tada: Features

:hammer_and_wrench: Bugfixes & enhancements

  • [bugfix]no-empty-interface allows providing type arguments for extended type (#3260)
  • [bugfix] Fixed line switches to not disable failures in the next line following the disabled line (#3177)
  • [bugfix]return-undefined handles union return types in async functions (#3298)
  • [bugfix]deprecation checks correct constructor overload (#3203)
  • [bugfix]return-undefined declared return type takes precedence over contextual type (#3298)
  • [bugfix] Correctly mark inputFilePath as an optional parameter in Configuration.findConfiguration() (#3195)
  • [bugfix]return-undefined fixed regressions: once again allows anything if return type is any (#3298)
  • [bugfix]only-arrow-functions allow function if this is used in parameter initializer (#3315)
  • [bugfix]no-conditional-assignment: exclude intentional assignments, e.g. inside functions (#2629)
  • [bugfix]no-angle-bracket-type-assertion fixer adds parentheses when necessary (#3301)
  • [bugfix]no-angle-bracket-type-assertion fixed order when autofixing consecutive assertions (#3301)
  • [bugfix] vso formatter no longer duplicates output for fixed failures (#3348)
  • [bugfix]no-unbound-method: Allow negation of method (#3349)
  • [bugfix]arrow-parens with option "ban-single-arg-parens" no longer produces invalid code when fixed (#3247)
  • [bugfix] Fixed regression where the lookup of tslint.json stopped at the current directory. (#3309)
  • [bugfix] --test works correctly with any compilerOptions.target (#3296)
  • [bugfix] whitepace handles files with BOM and other irregular whitespace (#3305)
  • [bugfix]callable-types auto fix produces invalid results (#3342)
  • [bugfix]no-string-literal correctly fix property names with leading underscores (#3184)
  • [bugfix]variable-name fixed crash on empty variable name (#3292)
  • [bugfix]trailing-comma fixed crash on arrow function without parens (#3246)
  • [bugfix] Fix space-before-function-paren for anonymous/arrow generic functions (#3085)
  • [bugfix] Removed warning printed to console when using the no-unused-variable along with the noUnusedLocals and noUnusedParameters compiler options (#3227)
  • [bugfix]no-invalid-this ignores functions with a this param (#3267)
  • [enhancement] Sort failures by line and character for formatters (#3345)
  • [enhancement]import-blacklist also checks exports and dynamic imports (#3258)
  • [enhancement]no-conditional-assignment added check for conditional (ternary) expressions (#2629)
  • [enhancement] Allow completed-docs to list doc tags that mark a node as not requiring a documentation body. Tags can also provide a regexp matcher to validate that their contents are docs-valid. (#2415)
  • [enhancement]await-promise enforces that for-await-of is only used with AsyncIterable (#3297)
  • [enhancement]one-line checks type alias declarations (#3200)
  • [enhancement]deprecation checks object destructuring (#3318)
  • [enhancement]no-submodule-imports also checks exports (#3258)
  • [enhancement]restrict-plus-operands: More specific error message when arguments include strings (#3220)
  • [enhancement]no-unsafe-any checks more expressions, for example destructuring, yield, property initializer (#3196)
  • [enhancement]object-literal-sort-keys: allow grouping of object properties via additional blank lines when using alphabetical ordering. (#3191)
  • [enhancement] Migrated CLI from using colors module to chalk module (#3171)
  • [enhancement]no-unused-variable applies the ignorePattern to imports (#3187)

Thanks to our contributors!

  • Klaus Meinhardt
  • Charles Samborski
  • Donald Pipowitch
  • Josh Goldberg
  • mmkal
  • Erik
  • Csaba Miklos
  • Dominik Moritz
  • Khalid Saifullah
  • Lukas Spieß
  • Merott Movahedi
  • Bowen Ni
  • ksvitkovsky
  • Hutson Betts
  • Caleb Eggensperger
  • Brent Erickson
  • Trivikram
  • Brandon Furtwangler
  • Pavel Zet
  • aervin_
  • Holger Jeromin
  • Danny Guo
  • Jeremy Morton
  • Cyril Gandon
  • Andy Hanson
  • yadan
palantir
published 5.7.0 •

Changelog

Source

v5.7.0

:tada: New rules, options, and fixers

:hammer_and_wrench: Bugfixes & enhancements

  • [api] AbstractRule#applyWithFunction allows additional parameter that is passed through to walkFn (#3140)
  • [api] AbstractRule#applyWithFunction has better type checking for its type parameter (#2660)
  • [bugfix]member-access autofix now correcly inserts public keyword after decorators (#3162)
  • [bugfix]prefer-const correctly handle catch without binding parameter introduced in typescript@2.5.1 (#3151)
  • [bugfix]no-invalid-template-strings allows backslash-prefixed template expressions (#3116)
  • [bugfix]deprecation no longer shows errors on imports and exports (#3141)
  • [bugfix]deprecation: fix false positive when calling a function or method where another overload is deprecated (#2883)
  • [bugfix]whitespace: fixed "check-separator" for trivial for cases. (#3132)
  • [bugfix]prefer-object-spread prevent spreading this as it is not allowed by the compiler (#3126)
  • [bugfix] msbuild formatter uses backslashes in paths on Windows (#3145)
  • [bugfix]no-namespace ignores global augmentation (#3161)
  • [enhancement] remove superfluous empty lines on tslint output. (#3121)
  • [enhancement]no-submodule-imports allows whitelisting of submodules like @angular/core/testing (#3129)
  • [enhancement] custom lint rules will be resolved using node's path resolution to allow for loaders like ts-node (#3108)
  • [enhancement]quotemark no longer requires "single" or "double" to be the first option. The rule defaults to "double" if none is specified. (#3114)
  • [enhancement]no-unused-variable autofix removes trailing comments of imports (#3156)
  • [enhancement]no-unnecessary-type-assertion allows certain necessary assertions to prevent type widening (#3120)

Thanks to our contributors!

  • Paul Gschwendtner
  • Andy Hanson
  • ksvitkovsky
  • Santi Albo
  • aervin
  • Junle Li
  • Joscha Feth
  • WiseBird
  • Caleb Eggensperger
  • WGroenestein
  • Bowen Ni
palantir
published 5.6.0 •

Changelog

Source

v5.6.0

:tada: New rules, options, and fixers

:hammer_and_wrench: Bugfixes & enhancements

  • [bugfix]array-type: consider this to be simple type (#2982)
  • [bugfix]await-promise accepts not only union types but also intersection types with Promise-like types (#2987)
  • [bugfix]callable-types: don't remove export modifier of interfaces (#2962)
  • [bugfix]completed-docs: Only checks variables at the file-level. (#2950)
  • [bugfix]completed-docs: Uses correct visibility of variables. (#2950)
  • [bugfix]no-floating-promises: recognize rejection handler passed as second argument to promise.then() (#3048)
  • [bugfix]no-shadowed-variable don't warn for shadowed type parameter on static class members (#3030)
  • [bugfix]no-shadowed-variable fixed false positive with key name in index signature (#3030)
  • [bugfix]no-shadowed-variable fixed false positive with parameter inside function decorator (#3030)
  • [bugfix]no-unsafe-any: allow truthyness and falsyness checks (#3008)
  • [bugfix]no-unused-variable fixed crash when using destructuring (#3058)
  • [bugfix]one-line correctly handles multiline type parameters (#3004)
  • [bugfix]prefer-for-of fixed false positives when array is modified, e.g. arr[i]++ (#3044)
  • [bugfix]prefer-object-spread adds parens when fixing arrow function return (#3026)
  • [bugfix]prefer-object-spread permit functions as first argument to Object.assign (#3098)
  • [bugfix]space-before-function-paren Handle default exports of functions without names like anonymous functions (fixes #3040) (#3053)
  • [bugfix] Fixed an issue where, at runtime, the module ./test/parse could not be located due after consumers had run yarn clean (#3072)
  • [enhancement]no-null-keyword allows strict comparison (#2802)
  • [enhancement]no-switch-case-fall-through matches // falls through comments case insensitive and allows trailing text (#2983)
  • [enhancement]ordered-imports: support importEqualsDeclaration (#3102)
  • [enhancement] Added NaN and (+/-)Infinity as numbers to no-inferrable-types (#2885)
  • [enhancement] Improved CLI error message when no filenames are specified (#3066)
  • [rule-change]prefer-conditional-expression: ignore if-else-if by default. Use the new "check-else-if" option to check nested if statements (#2963)

Thanks to our contributors!

  • Klaus Meinhardt
  • Julian Verdurmen
  • Alexandre Alonso
  • Josh Goldberg
  • ksvitkovsky
  • Daisuke Yokomoto
  • Andrii Dieiev
  • Florent Suc
  • Jason Killian
  • Amin Pakseresht
  • reduckted
  • vilicvane
  • Russell Briggs
  • Andy Hanson
  • Leo Liang
  • Dan Homola
  • BehindTheMath
  • David Golightly
  • aervin
  • Daniel Kucal
  • Ika
  • Chris Barr
palantir
published 5.5.0 •

Changelog

Source

v5.5.0

Editor's note: This release features an important bugfix for overlapping fixes when using --project and --fix (#2864).

:tada: New rules and options

:hammer_and_wrench: Bugfixes & enhancements

  • [bugfix]encoding closes files correctly (#2958)
  • [bugfix]whitespace fix whitespace "check-module" to properly lint and fix errors (#2401) (#2825)
  • [bugfix]: whitespace: now correctly handles dynamic imports introduced in typescript@2.4.0 (#2924)
  • [bugfix]switch-final-break: don't fail if break jumps to a label outside of the switch (#2914)
  • [bugfix]no-shadowed-variable: exempt this parameter (#2598)
  • [bugfix]prefer-for-of correctly handles variable scopes and other unrelated identifiers (#2984)
  • [bugfix] Don't leave blank lines when no-unused-variable autofix removes whole import (#2901)
  • [cli] restore -v option (#2926)
  • [enhancement] Print stack trace of exceptions (#2890)
  • [enhancement] Added allow-empty-catch option to no-empty (#2886)
  • [enhancement]prefer-const: handle destructuring in for-of loop initializer as if {"destructuring": "all"} was specified (#2904)
  • [enhancement]no-shadowed-variable: added checks for other shadowing declarations, e.g. interfaces, classes, type parameters, imports, etc. (#2598)
  • [rule-change]no-shadowed-variable no longer fails for declarations in the same scope, e.g. var foo; var foo;. Use the rule no-duplicate-variable to find such errors. (#2598)

Thanks to our contributors!

  • Klaus Meinhardt
  • Josh Goldberg
  • Petr Kosikhin
  • Pablo Núñez
  • Benny Neugebauer
  • Radon Rosborough
  • reduckted
  • Chris Barr
  • Julian Verdurmen
palantir
published 5.4.3 •

Changelog

Source

v5.4.3

:hammer_and_wrench: Bugfixes

palantir
published 5.4.2 •

Changelog

Source

v5.4.2

:hammer_and_wrench: Bugfixes

  • [bugfix] Restored support for multiple --exclude options in the CLI (#2855)
  • [bugfix] Restored support for --version CLI option (#2857)
palantir
published 5.4.1 •

Changelog

Source

v5.4.1

:hammer_and_wrench: Bugfixes

  • [bugfix] Fixed regression in --exclude CLI option when using --project (#2852)
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