Skip to content

Commit

Permalink
v1.0: enable all rules in tslint-react.json (palantir#28)
Browse files Browse the repository at this point in the history
* Enable all rules in tslint-react.json

* v1.0.0

* Fix lint failures in jsxAlignmentRule

* Fix lint failures in jsxNoLambdaRule

* Fix lint failures in jsxNoMultilineJsRule

* Fix lint failures in jsxNoStringRefRule

* Fix lint failures in jsxSelfCloseRule

* Enable jsx-no-multiline-js in tslint-react.json
  • Loading branch information
adidahiya authored and jkillian committed Aug 15, 2016
1 parent 0d94007 commit d0a4e4c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tslint-react",
"version": "0.4.0",
"description": "React-specific rules for TSLint",
"version": "1.0.0",
"description": "Lint rules related to React & JSX for TSLint",
"main": "tslint-react.json",
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions src/rules/jsxAlignmentRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import * as ts from "typescript";
import * as Lint from "tslint/lib/lint";
import * as ts from "typescript";

export class Rule extends Lint.Rules.AbstractRule {
public static ATTR_LINE_FAILURE = "JSX attributes must be on a line below the opening tag";
Expand Down Expand Up @@ -139,4 +139,3 @@ class JsxAlignmentWalker extends Lint.RuleWalker {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), message));
}
}

2 changes: 1 addition & 1 deletion src/rules/jsxNoLambdaRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import * as ts from "typescript";
import * as Lint from "tslint/lib/lint";
import * as ts from "typescript";

export class Rule extends Lint.Rules.AbstractRule {
public static FAILURE_STRING = "Lambdas are forbidden in JSX attributes due to their rendering performance impact";
Expand Down
2 changes: 1 addition & 1 deletion src/rules/jsxNoMultilineJsRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import * as ts from "typescript";
import * as Lint from "tslint/lib/lint";
import * as ts from "typescript";

export class Rule extends Lint.Rules.AbstractRule {
public static FAILURE_STRING = "Multiline JS expressions inside JSX are forbidden";
Expand Down
3 changes: 2 additions & 1 deletion src/rules/jsxNoStringRefRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
* limitations under the License.
*/

import * as ts from "typescript";
import * as Lint from "tslint/lib/lint";
import * as ts from "typescript";

import { nodeIsKind } from "../guards";

export class Rule extends Lint.Rules.AbstractRule {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/jsxSelfCloseRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import * as ts from "typescript";
import * as Lint from "tslint/lib/lint";
import * as ts from "typescript";

export class Rule extends Lint.Rules.AbstractRule {
public static FAILURE_STRING = "JSX elements with no children must be self-closing";
Expand Down
9 changes: 8 additions & 1 deletion tslint-react.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"rulesDirectory": "./rules"
"rulesDirectory": "./rules",
"rules": {
"jsx-alignment": true,
"jsx-no-lambda": true,
"jsx-no-multiline-js": true,
"jsx-no-string-ref": true,
"jsx-self-close": true
}
}

0 comments on commit d0a4e4c

Please sign in to comment.