Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds tslint #33

Merged
merged 18 commits into from
Jun 6, 2018
Merged

Adds tslint #33

merged 18 commits into from
Jun 6, 2018

Conversation

gunzip
Copy link
Contributor

@gunzip gunzip commented Jun 6, 2018

No description provided.

@digitalcitizenship
Copy link

Warnings
⚠️

Please include a Pivotal story at the beginning of the PR title (see below).

⚠️

Please include a description of your PR changes.

Messages
📖

🎉 - congrats on your new release

Example of PR titles that include pivotal stories:

  • single story: [#123456] my PR title
  • multiple stories: [#123456,#123457,#123458] my PR title

New dependencies added: tslint, tslint-config-prettier, tslint-plugin-prettier, tslint-sonarts and typestrict.

tslint

Author: Unknown

Description: An extensible static analysis linter for the TypeScript language

Homepage: http://npmjs.com/package/tslint

Createdalmost 5 years ago
Last Updatedabout 1 month ago
LicenseApache-2.0
Maintainers1
Releases162
Direct Dependenciesbabel-code-frame, builtin-modules, chalk, commander, diff, glob, js-yaml, minimatch, resolve, semver, tslib and tsutils
Keywordscli, typescript and linter
README

NPM version
Downloads
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 supports:

Installation & Usage

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

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

Creating a new release

  1. Bump the version number in package.json and src/linter.ts
  2. Add release notes in CHANGELOG.md
    • Use ./scripts/generate-changelog.js (after building it with tsc -p scripts) to generate the changelog diff. This script expects a Github.com personal access token to exist at ~/github_token.txt with "repo" permissions.
  3. Commit with message Prepare release <version>
  4. Push your branch to GitHub and make a PR
  5. Once your PR is merged, wait for the tests to pass on CircleCI for develop
  6. Create a "Release" on GitHub with the proper tag version and notes from the changelog.
    • The tag should be identical to the version in package.json
  7. Run yarn run publish:local

tslint-config-prettier

Author: Alex Jover Morales

Description: Do you wanna use tslint and prettier without conflicts? tslint-config-prettier disables all conflicting rules that may cause such problems. Prettier takes care of formatting and tslint the rest.

Homepage: https://github.com/alexjoverm/tslint-config-prettier#readme

Created12 months ago
Last Updated17 days ago
LicenseMIT
Maintainers1
Releases14
Keywordslint, tslint, ts-lint, prettier, config and typescript
README

tslint-config-prettier

npm
Travis
downloads
David
David
Greenkeeper badge

👮 tslint + 💅 prettier = 😍

Do you want to use tslint and prettier without conflicts? tslint-config-prettier disables all conflicting rules that may cause such problems. Prettier takes care of the formatting whereas tslint takes care of all the other things.

Get started

npm install -D tslint-config-prettier

Make sure you've already set up tslint and prettier.

Then, extend your tslint.json, and make sure tslint-config-prettier is at the end:

{
  "extends": [
    "tslint:latest",
    "tslint-config-prettier"
  ]
}

More configuration

tslint-config-prettier also turns off formatting rules from the following rulesets, so you can use them safely.

{
  "extends": [
    "tslint:latest",
    "tslint-react",
    "tslint-eslint-rules",
    "tslint-config-prettier"
  ]
}

CLI helper tool

tslint-config-prettier is shipped with a little CLI tool to help you check if your configuration contains any rules that are in conflict with Prettier. (require tslint installed)

In order to execute the CLI tool, first add a script for it to package.json:

{
  "scripts": {
    "tslint-check": "tslint-config-prettier-check ./tslint.json"
  }
}

Then run npm run tslint-check.

Tutorials

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Related

  • tslint-plugin-prettier - Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.

Credits

Made with ❤️ by @alexjoverm and all its contributors

tslint-plugin-prettier

Author: Ika

Description: Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.

Homepage: https://github.com/ikatyang/tslint-plugin-prettier#readme

Created10 months ago
Last Updated8 months ago
LicenseMIT
Maintainers1
Releases4
Direct Dependencieseslint-plugin-prettier and tslib
Keywordsprettier, tslint, tslint-plugin and tslint-rules
README

tslint-plugin-prettier

npm
build
coverage
dependencies
devDependencies

Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.

NOTE: This project uses official reporter from eslint-plugin-prettier.

Changelog

Sample

a();;;
    ~~
;;;
~~~ [Delete `;;⏎;;;`]
var foo = ''
          ~~ [Replace `''` with `"";⏎`]
var foo= "";
       ~ [Insert `·`]

Install

# using npm
npm install --save-dev tslint-plugin-prettier prettier

# using yarn
yarn add --dev tslint-plugin-prettier prettier

Usage

(tslint.json)

for tslint@5.0.0+

{
  "extends": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": true
  }
}

for tslint@5.2.0+

{
  "rulesDirectory": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": true
  }
}

NOTE: To use this plugin, it'd better to also use tslint-config-prettier to disable all prettier-related rules, so as to avoid conflicts between existed rules.

Options

If there is no option provided, it'll try to load config file if possible (require prettier@1.7.0+), uses Prettier's default option if not found.

{
  "extends": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": true
  }
}

If you'd like to specify where to find the config file, just put the search path (relative to process.cwd()) in the second argument, the following example shows how to use the config file from <cwd>/configs/.prettierrc:

{
  "extends": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": [true, "configs"]
  }
}

If you'd like to specify options manually, just put Prettier Options in the second argument, for example:

{
  "extends": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": [true, { "singleQuote": true }]
  }
}

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

Related

License

MIT © Ika

tslint-sonarts

Author: Unknown

Description: SonarTS rules for TSLint

Homepage: https://github.com/SonarSource/SonarTS

Createdabout 1 year ago
Last Updated6 days ago
LicenseLGPL-3.0
Maintainers3
Releases35
Direct Dependenciesimmutable
Keywordssonarts, sonarqube, typescript and tslint
README

ERROR: No README data found!

typestrict

Author: Unknown

Description:

TypeStrict

TypeStrict

Squash bugs before shipping them with Typescript and TSlint!

Homepage: https://github.com/krzkaczor/TypeStrict#readme

Created6 months ago
Last Updatedabout 18 hours ago
LicenseMIT
Maintainers1
Releases8
Direct Dependenciestslint-microsoft-contrib and tslint-sonarts
README

TypeStrict

TypeStrict

Squash bugs before shipping them with Typescript and TSlint!

Tslint config focused on maximizing type safety

Installation

npm install --save-dev typestrict

or

yarn add --dev typestrict

Usage

Create tslint.json:

{
  "extends": "typestrict"
  // ... add here your own rules
}

and run tslint -c ./tslint.json --project ./tsconfig.json --format stylish.

Remember to use strict compiler setting in tsconfig.json!

Description

All rules in this config are focused on catching bugs in your code and be as not annoying as possible. They don't
care about code style or formatting.

TypeStrict combines rules from various rule sets: tslint,
sonarTS,
tslint-microsoft-contrib.

Complete rules list

Tslint

SonarTS

Microsoft Contrib

Contributing

Do you have idea for new rule to be added? You don't agree with one of rules included? Feel free to create issue / PR.

License

MIT by Krzysztof Kaczor

Generated by 🚫 dangerJS

@gunzip gunzip merged commit a6d66bf into master Jun 6, 2018
@gunzip gunzip deleted the add-tslint branch June 7, 2018 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants