Permalink
Browse files

feat(tslint): add react and node lint configurations

This commit moves shared configuration into tslint-base.json, which is still the default preset when
extending `@detroit-labs/tslint-config`. However, we now also have react and node presets available,
which both extend tslint-base.json and override rules where applicable.

BREAKING CHANGE: since rules were removed from tslint-base.json and moved to their react and node
configurations respectively, this commit requires a major version bump.
  • Loading branch information...
macklinu committed May 10, 2017
1 parent cab1b13 commit ebac53c2405f2af4f5f723193a6a7253a4a9a9fd
Showing with 57 additions and 13 deletions.
  1. +17 −0 README.md
  2. +13 −0 node.json
  3. +1 −1 package.json
  4. +25 −0 react.json
  5. +1 −12 tslint-config.json → tslint-base.json
@@ -28,6 +28,23 @@ Here's a sample configuration where `tslint.json` lives adjacent to your `node_m
}
```
There are two primary configurations supplied for convenience:
* `@detroit-labs/tslint-config/react`: contains extra configuration for a TypeScript React project
* `@detroit-labs/tslint-config/node`: contains extra configuration for a Node server project
Usage is the same as above:
```js
{
"extends": ["@detroit-labs/tslint-config/react"],
"rules": {
// override rules here
"semicolon": false
}
}
```
To lint all TypeScript files in the `src/` directory, for example, run `tslint -c tslint.json 'src/**/*.{ts,tsx}'`.
### Development
@@ -0,0 +1,13 @@
{
"extends": ["./tslint-base.json"],
"rules": {
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
]
}
}
@@ -2,7 +2,7 @@
"name": "@detroit-labs/tslint-config",
"version": "0.0.0-development",
"description": "Shared TSLint configuration used in Detroit Labs' TypeScript projects",
"main": "tslint-config.json",
"main": "tslint-base.json",
"scripts": {
"commit": "git-cz",
"commitmsg": "validate-commit-msg",
@@ -0,0 +1,25 @@
{
"extends": ["./tslint-base.json"],
"rules": {
"interface-name": [
true,
"always-prefix"
],
"no-consecutive-blank-lines": true,
"no-console": [
true,
"log",
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-invalid-this": true,
"no-switch-case-fall-through": true,
"no-use-before-declare": false,
"no-var-keyword": true,
"ordered-imports": true,
"switch-default": true
}
}
@@ -8,18 +8,13 @@
true,
"spaces"
],
"interface-name": [
true,
"always-prefix"
],
"label-position": true,
"max-line-length": [
true,
140
],
"no-arg": true,
"no-bitwise": true,
"no-consecutive-blank-lines": true,
"no-console": [
true,
"log",
@@ -34,12 +29,8 @@
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-invalid-this": true,
"no-string-literal": false,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-use-before-declare": false,
"no-var-keyword": true,
"one-line": [
true,
"check-open-brace",
@@ -49,7 +40,6 @@
],
"radix": true,
"semicolon": true,
"switch-default": true,
"triple-equals": [
true,
"allow-null-check"
@@ -61,7 +51,6 @@
"check-decl",
"check-operator",
"check-separator"
],
"ordered-imports": true
]
}
}

0 comments on commit ebac53c

Please sign in to comment.