diff --git a/package.json b/package.json index 2babcaa..bf94ba7 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/rules/jsxAlignmentRule.ts b/src/rules/jsxAlignmentRule.ts index c620ba1..3553cd8 100644 --- a/src/rules/jsxAlignmentRule.ts +++ b/src/rules/jsxAlignmentRule.ts @@ -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"; @@ -139,4 +139,3 @@ class JsxAlignmentWalker extends Lint.RuleWalker { this.addFailure(this.createFailure(node.getStart(), node.getWidth(), message)); } } - diff --git a/src/rules/jsxNoLambdaRule.ts b/src/rules/jsxNoLambdaRule.ts index 4f050b2..2c3ac3f 100644 --- a/src/rules/jsxNoLambdaRule.ts +++ b/src/rules/jsxNoLambdaRule.ts @@ -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"; diff --git a/src/rules/jsxNoMultilineJsRule.ts b/src/rules/jsxNoMultilineJsRule.ts index 2fb62d8..cde4db0 100644 --- a/src/rules/jsxNoMultilineJsRule.ts +++ b/src/rules/jsxNoMultilineJsRule.ts @@ -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"; diff --git a/src/rules/jsxNoStringRefRule.ts b/src/rules/jsxNoStringRefRule.ts index 04d1e77..fffbff0 100644 --- a/src/rules/jsxNoStringRefRule.ts +++ b/src/rules/jsxNoStringRefRule.ts @@ -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 { diff --git a/src/rules/jsxSelfCloseRule.ts b/src/rules/jsxSelfCloseRule.ts index 3789c1b..21efa7b 100644 --- a/src/rules/jsxSelfCloseRule.ts +++ b/src/rules/jsxSelfCloseRule.ts @@ -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"; diff --git a/tslint-react.json b/tslint-react.json index 69e46a3..6279d6c 100644 --- a/tslint-react.json +++ b/tslint-react.json @@ -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 + } }