This repository was archived by the owner on Jan 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 490
Externalise ts-lint rules #112
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,3 @@ | ||
{ | ||
"extends": ["tslint-react"], | ||
"rules": { | ||
"align": [ | ||
true, | ||
"parameters", | ||
"arguments", | ||
"statements" | ||
], | ||
"ban": false, | ||
"class-name": true, | ||
"comment-format": [ | ||
true, | ||
"check-space" | ||
], | ||
"curly": true, | ||
"eofline": false, | ||
"forin": true, | ||
"indent": [ true, "spaces" ], | ||
"interface-name": [true, "never-prefix"], | ||
"jsdoc-format": true, | ||
"jsx-no-lambda": false, | ||
"jsx-no-multiline-js": false, | ||
"label-position": true, | ||
"max-line-length": [ true, 120 ], | ||
"member-ordering": [ | ||
true, | ||
"public-before-private", | ||
"static-before-instance", | ||
"variables-before-functions" | ||
], | ||
"no-any": true, | ||
"no-arg": true, | ||
"no-bitwise": true, | ||
"no-console": [ | ||
true, | ||
"log", | ||
"error", | ||
"debug", | ||
"info", | ||
"time", | ||
"timeEnd", | ||
"trace" | ||
], | ||
"no-consecutive-blank-lines": true, | ||
"no-construct": true, | ||
"no-debugger": true, | ||
"no-duplicate-variable": true, | ||
"no-empty": true, | ||
"no-eval": true, | ||
"no-shadowed-variable": true, | ||
"no-string-literal": true, | ||
"no-switch-case-fall-through": true, | ||
"no-trailing-whitespace": false, | ||
"no-unused-expression": true, | ||
"no-use-before-declare": true, | ||
"one-line": [ | ||
true, | ||
"check-catch", | ||
"check-else", | ||
"check-open-brace", | ||
"check-whitespace" | ||
], | ||
"quotemark": [true, "single", "jsx-double"], | ||
"radix": true, | ||
"semicolon": [true, "always"], | ||
"switch-default": true, | ||
|
||
"trailing-comma": false, | ||
|
||
"triple-equals": [ true, "allow-null-check" ], | ||
"typedef": [ | ||
true, | ||
"parameter", | ||
"property-declaration" | ||
], | ||
"typedef-whitespace": [ | ||
true, | ||
{ | ||
"call-signature": "nospace", | ||
"index-signature": "nospace", | ||
"parameter": "nospace", | ||
"property-declaration": "nospace", | ||
"variable-declaration": "nospace" | ||
} | ||
], | ||
"variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"], | ||
"whitespace": [ | ||
true, | ||
"check-branch", | ||
"check-decl", | ||
"check-module", | ||
"check-operator", | ||
"check-separator", | ||
"check-type", | ||
"check-typecast" | ||
] | ||
} | ||
"extends": ["tslint-react", "tslint-create-react-app-typescript"] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "tslint-create-react-app-typescript", | ||
"version": "1.0.0", | ||
"description": "TS Lint configuration for create-react-app-typescript", | ||
"license": "BSD-3-Clause", | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/wmonk/create-react-app/issues" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"rules": { | ||
"align": [ | ||
true, | ||
"parameters", | ||
"arguments", | ||
"statements" | ||
], | ||
"ban": false, | ||
"class-name": true, | ||
"comment-format": [ | ||
true, | ||
"check-space" | ||
], | ||
"curly": true, | ||
"eofline": false, | ||
"forin": true, | ||
"indent": [ true, "spaces" ], | ||
"interface-name": [true, "never-prefix"], | ||
"jsdoc-format": true, | ||
"jsx-no-lambda": false, | ||
"jsx-no-multiline-js": false, | ||
"label-position": true, | ||
"max-line-length": [ true, 120 ], | ||
"member-ordering": [ | ||
true, | ||
"public-before-private", | ||
"static-before-instance", | ||
"variables-before-functions" | ||
], | ||
"no-any": true, | ||
"no-arg": true, | ||
"no-bitwise": true, | ||
"no-console": [ | ||
true, | ||
"log", | ||
"error", | ||
"debug", | ||
"info", | ||
"time", | ||
"timeEnd", | ||
"trace" | ||
], | ||
"no-consecutive-blank-lines": true, | ||
"no-construct": true, | ||
"no-debugger": true, | ||
"no-duplicate-variable": true, | ||
"no-empty": true, | ||
"no-eval": true, | ||
"no-shadowed-variable": true, | ||
"no-string-literal": true, | ||
"no-switch-case-fall-through": true, | ||
"no-trailing-whitespace": false, | ||
"no-unused-expression": true, | ||
"no-use-before-declare": true, | ||
"one-line": [ | ||
true, | ||
"check-catch", | ||
"check-else", | ||
"check-open-brace", | ||
"check-whitespace" | ||
], | ||
"quotemark": [true, "single", "jsx-double"], | ||
"radix": true, | ||
"semicolon": [true, "always"], | ||
"switch-default": true, | ||
|
||
"trailing-comma": false, | ||
|
||
"triple-equals": [ true, "allow-null-check" ], | ||
"typedef": [ | ||
true, | ||
"parameter", | ||
"property-declaration" | ||
], | ||
"typedef-whitespace": [ | ||
true, | ||
{ | ||
"call-signature": "nospace", | ||
"index-signature": "nospace", | ||
"parameter": "nospace", | ||
"property-declaration": "nospace", | ||
"variable-declaration": "nospace" | ||
} | ||
], | ||
"variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"], | ||
"whitespace": [ | ||
true, | ||
"check-branch", | ||
"check-decl", | ||
"check-module", | ||
"check-operator", | ||
"check-separator", | ||
"check-type", | ||
"check-typecast" | ||
] | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest i'd be happier to just extend from
tslint-react
and let people write their own rules? Would be interested to hear how people are actually using this file, whether they just delete their own and start again, or leave as-is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make things a lot simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sample
tslint-react
config suggests extending tslint:latestThe
latest
preset extends tslint:recommended and adds features supported by tslint 2.4Many reasonable defaults
Quite strict
Helps keep consistent style across projects
Angular contributors have an issue and a pull request considering its usage in their bootstrapping tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree this is a good starting point!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like having all the tslint config rules that someone else thought through, but some of the rules are out of date.
Project is a day or so old, here's my tslint: https://github.com/Falieson/typescript-react-asteroid-meteor/blob/master/client/tslint.json