-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adds tslint #33
Conversation
Example of PR titles that include pivotal stories:
New dependencies added: tslintAuthor: Unknown Description: An extensible static analysis linter for the TypeScript language Homepage: http://npmjs.com/package/tslint
|
Created | 12 months ago |
Last Updated | 17 days ago |
License | MIT |
Maintainers | 1 |
Releases | 14 |
Keywords | lint, tslint, ts-lint, prettier, config and typescript |
README
tslint-config-prettier
👮 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.
- codelyzer
- tslint
- tslint-consistent-codestyle
- tslint-divid
- tslint-eslint-rules
- tslint-immutable
- tslint-microsoft-contrib
- tslint-misc-rules
- tslint-plugin-ikatyang
- tslint-react
- vrsource-tslint-rules
{
"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
Created | 10 months ago |
Last Updated | 8 months ago |
License | MIT |
Maintainers | 1 |
Releases | 4 |
Direct Dependencies | eslint-plugin-prettier and tslib |
Keywords | prettier, tslint, tslint-plugin and tslint-rules |
README
tslint-plugin-prettier
Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.
NOTE: This project uses official reporter from eslint-plugin-prettier.
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
Created | about 1 year ago |
Last Updated | 6 days ago |
License | LGPL-3.0 |
Maintainers | 3 |
Releases | 35 |
Direct Dependencies | immutable |
Keywords | sonarts, sonarqube, typescript and tslint |
README
ERROR: No README data found!
typestrict
Author: Unknown
Description:
TypeStrict
Squash bugs before shipping them with Typescript and TSlint!
Homepage: https://github.com/krzkaczor/TypeStrict#readme
Created | 6 months ago |
Last Updated | about 18 hours ago |
License | MIT |
Maintainers | 1 |
Releases | 8 |
Direct Dependencies | tslint-microsoft-contrib and tslint-sonarts |
README
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
- await-promise
- no-floating-promises
- no-unused-variable (with
"check-parameters"
and{"ignore-pattern": "^_" }
) - no-use-before-declare
- no-duplicate-super
- no-inferred-empty-object-type
- no-invalid-this
- no-misused-new
- restrict-plus-operands
- use-isnan
SonarTS
- no-accessor-field-mismatch
- no-all-duplicated-branches
- no-collection-size-mischeck
- no-dead-store
- no-duplicated-branches
- no-element-overwrite
- no-empty-destructuring
- no-gratuitous-expressions
- no-identical-conditions
- no-identical-expressions
- no-ignored-return
- no-multiline-string-literals
- no-self-assignment
- no-unconditional-jump
- no-unthrown-error
- no-unused-array
- no-useless-cast
- no-useless-increment
- no-variable-usage-before-declaration
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
No description provided.