Skip to content
🚦 An extensible linter for the TypeScript language
TypeScript Other
Branch: master
Clone or download
ColCh and JoshuaKGoldberg Add rule: strict-string-expressions (#4807)
* feat: add strict-string-expressions

* docs(strictStringExpressionsRule): add option desc

* feat(strictStringExpressionsRule): add fixer

* test: add strict-string-expressions into all.ts

* type: remove declare

* refactor(strictStringExpressionsRule): eliminate copy-paste

* style: fix tslint errors

* fix(strictStringExpressionsRule): exclude any type from checks

* style: fix sytle erorrs

* refactor: rename function name to more cohesive

* refactor(strictStringExpressionsRule): add more renaimings

* style(strictStringExpressionsRule): prettify

* fix: do not require numbers to be stringified

* test(strictStringExpressions): add string and  number literals

* test(strictStringExpressionsRule): fix nit

* test(strictStringExpressionsRule): add string uni in test

* test: add typeof window case

* feat: handle union type

* feat(strictStringExpressionsRule): add allow-empty-types option

* feat: allo empty types in all.ts config

* style(strictStringExpressionsRule): fix lint rules

* feat(strictStringExpressionsRule): allow booleans

* style(linter): fix codestyle

* refactor(strictStringExpressionsRule): rename private helpers

* docs(strictStringExpressionsRule): update license year

* refactor(strictStringExpressionsRule): make allow-empty-types to appear
default option

* test(stringStrictExpressions): correct test
Latest commit 05cfde7 Aug 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Refactor CI config, require lockfile to be up to date (#4667) Apr 16, 2019
.github Add tslint-playground to README and bug report template. (#4150) Jun 16, 2019
.vscode Remove .vscode/settings.json git.ignoreLimitWarning (#4766) Jun 18, 2019
bin [New rule] add fileNameCasing rule (#3978) Jun 26, 2018
docs feat(cli): --print-config flag (#4744) Jun 3, 2019
scripts Prepare v5.17.0 (#4751) May 30, 2019
src Add rule: strict-string-expressions (#4807) Aug 12, 2019
test Add rule: strict-string-expressions (#4807) Aug 12, 2019
.editorconfig Switch to tslint-plugin-prettier, clean up rule options config syntax ( Feb 2, 2019
.gitattributes object-literal-sort-keys: don't consider \r\n as two line breaks (#3427) Oct 31, 2017
.gitignore Switch to tslint-plugin-prettier, clean up rule options config syntax ( Feb 2, 2019
.npmignore Use CircleCI 2.0 (#3490) Nov 15, 2017
.nycrc [enhancement] Update devDependency nyc from v13.3.0 to v14.1.1 (#4699) May 16, 2019
.prettierrc Add prettierrc (#4637) Apr 7, 2019
CHANGELOG.md Prepare release v5.18.0 (#4771) Jun 21, 2019
LICENSE Update LICENSE (#1705) Nov 10, 2016
README.md docs: Link to OSS fellowship medium post in README (#4821) Aug 2, 2019
appveyor.yml Re-ran Prettier on source files again, with some more ignores (#4270) Nov 5, 2018
package.json Prepare release v5.18.0 (#4771) Jun 21, 2019
tslint-vscode.json Prepare v5.17.0 (#4751) May 30, 2019
tslint.json Add strict-comparisons Rule (#4519) Jun 16, 2019
yarn.lock Bump lodash from 4.17.11 to 4.17.15 (#4809) Jul 24, 2019

README.md

NPM version Downloads Dependency Status devDependency Status peerDependency Status Circle CI

TSLint

TSLint is an extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors. It is widely supported across modern editors & build systems and can be customized with your own lint rules, configurations, and formatters.

⚠️ TSLint will be deprecated some time in 2019. See this issue for more details: Roadmap: TSLint → ESLint. If you're interested in helping with the TSLint/ESLint migration, please check out our OSS Fellowship program.

TSLint currently supports:

Installation & Usage

Please refer to the full installation & usage documentation on the TSLint website. There, you'll find information about

TSLint Playground

There is a sandbox environment for TSLint at palantir.github.io/tslint-playground, which can be used to test rules and see how TSLint works. Issues can be filed against tslint-playground here.

Custom Rules & Plugins

Custom rule sets from Palantir

Custom rule sets from the community

If we don't have all the rules you're looking for, you can either write your own custom rules or use rules implementations developed by the community. The repos below are a good source of custom rules:

Development

Prerequisites:

  • node v7+
  • yarn v1.0+

Quick Start

git clone git@github.com:palantir/tslint.git --config core.autocrlf=input --config core.eol=lf
yarn
yarn compile
yarn test
You can’t perform that action at this time.