Skip to content

Commit

Permalink
Merge branch 'release/0.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThWoywod committed Apr 24, 2019
2 parents b059eab + 39b68cc commit 82955d5
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 13 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#0.0.1
# Changelog

- Add basis linting rules
## Unreleased

## [0.0.1] - 2019-03-27
### Added
- Basic linting rules for open source projects

[Unreleased]: https://github.com/webcomputing/tslint-config-webcomputing/compare/v0.0.1...HEAD
[0.0.1]: https://github.com/webcomputing/tslint-config-webcomputing/releases/tag/0.0.1
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ npm i tslint-config-webcomputing --save-dev
```

## Usage
Add the following config in your `tslint.json` file:
Add the following config in your `tslint.json` file, to extend from our basic configuration:
```
{
"extends": "tslint-config-webcomputing"
"extends": "@webcomputing/tslint-config-webcomputing"
}
```
For angular workspaces, we recommend to extend from `tslint-angular.json`file
```
{
"extends": "@webcomputing/tslint-config-webcomputing/tslint-angular"
}
```

## Visual Studio Code

The popular VSCode linting extension [TSLint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) isn't able to support rules that need typing, e.g. `no-floating-promises` or `use-strict-boolean` and is hence deprecated.

Please make sure you use the new extension [TSLint](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin) along with [tslint-language-service](https://github.com/angelozerr/tslint-language-service).
144 changes: 136 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"AssistantJS"
],
"dependencies": {
"@angular/compiler": "^7.2.11",
"@angular/core": "^7.2.11",
"codelyzer": "~4.5.0",
"rxjs": "^6.4.0",
"tslint": "^5.11.0",
"tslint-config-airbnb": "^5.11.1",
"tslint-config-prettier": "^1.18.0"
Expand Down
24 changes: 24 additions & 0 deletions tslint-angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"rulesDirectory": ["node_modules/codelyzer"],
"extends": ["./tslint-base.json"],
"rules": {
"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,
"directive-selector": [true, "attribute", "app", "camelCase"],
"component-selector": [true, "element", "app", "kebab-case"],
"no-submodule-imports": [
true,
"rxjs",
"@angular/platform-browser-dynamic",
"@angular/core/testing"
]
}
}
12 changes: 11 additions & 1 deletion tslint-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
"rules": {
"no-floating-promises": true,
"no-unused-expression": true,
"strict-boolean-expressions": [
true,
"allow-null-union",
"allow-undefined-union",
"allow-string",
"allow-enum",
"allow-number",
"allow-mix",
"ignore-rhs"
],
"interface-name": [true, "never-prefix"],
"only-arrow-functions": false,
"object-shorthand-properties-first": true,
Expand All @@ -19,7 +29,7 @@
true,
{
"static-method-regex": "^[a-z][\\w\\d]+$",
"function-regex": "^([a-z][\\w\\d]+)|(([A-Z][\\w\\d]+)Mixin)$"
"function-regex": "^([a-z][\\w\\d]+)|(\\[[a-z][\\w\\d]+\\])|(([A-Z][\\w\\d]+)Mixin)$"
}
],
"member-ordering": [
Expand Down

0 comments on commit 82955d5

Please sign in to comment.