Skip to content

Feature/ts lint #9

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ you can learn more about all these tags [here](https://html.com/semantic-markup/

- [AirBnB EsLint](https://github.com/bigspaceship/javascript)

### Typescript Linting
- Angular usually sets up a tslint file by defualt but in this repo we have a custom [one](https://github.com/bigspaceship/coding-standards/tree/feature/ts-lint/linting-formatting/angular)
- At Big Spaceship whenever working on a Angular application we use the following tools for ensuring a proper lint environment.
- [TSLint](https://palantir.github.io/tslint/)
- [Prettier](https://prettier.io/)
- And to bind the two together [tslint-config-prettier](https://github.com/alexjoverm/tslint-config-prettier)
- Since our code editor of choice is currently VS Code, [this tool](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) is what we recommend for this IDE.

## Testing

- [Jest](https://facebook.github.io/jest/)
Expand Down
90 changes: 90 additions & 0 deletions linting-formatting/angular/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"defaultSeverity": "error",
"extends": ["tslint:recommended", "tslint-config-standard", "tslint-config-prettier"],
"jsRules": {},
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [true, "check-space"],
"curly": true,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [true, "rxjs/Rx"],
"import-spacing": true,
"indent": [true, "spaces"],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [true, 140],
"member-access": false,
"member-ordering": [
true,
{
"order": ["static-field", "instance-field", "static-method", "instance-method"]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [true, "ignore-params"],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"ordered-imports": false,
"object-literal-sort-keys": false,
"one-line": [true, "check-open-brace", "check-catch", "check-else", "check-whitespace"],
"prefer-const": true,
"quotemark": [true, "single"],
"radix": true,
"semicolon": [true, "always"],
"triple-equals": [true, "allow-null-check"],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"no-output-on-prefix": true,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
},
"rulesDirectory": ["node_modules/codelyzer"]
}