From aa055943951019330040bada87fd16b4d3e86ca4 Mon Sep 17 00:00:00 2001 From: Boris Cherny Date: Thu, 21 Jun 2018 13:26:06 +0300 Subject: [PATCH] add lint to build --- index.tsx | 2 +- package.json | 3 +- tslint.json | 78 +++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 65 insertions(+), 18 deletions(-) diff --git a/index.tsx b/index.tsx index 6e7fa73..e3f1920 100644 --- a/index.tsx +++ b/index.tsx @@ -28,7 +28,7 @@ export function react2angular( bindings: fromPairs(names.map(_ => [_, '<'])), controller: ['$element', ...injectNames, class extends NgComponent { static get $$ngIsClass() { - return true; + return true } injectedProps: { [name: string]: any } constructor(private $element: IAugmentedJQuery, ...injectedProps: any[]) { diff --git a/package.json b/package.json index 0b0b043..7989a6b 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,9 @@ "main:esnext": "index.es2015.js", "typings": "index.d.ts", "scripts": { - "build": "npm run clean; tsc -d -t es2015 && mv ./index.js ./index.es2015.js && tsc -t es5", + "build": "npm run clean && npm run lint && tsc -d -t es2015 && mv ./index.js ./index.es2015.js && tsc -t es5", "clean": "rm ./*.d.ts; rm ./*.map; exit 0", + "lint": "tslint -p ./tsconfig.json index.tsx test.tsx", "pretest": "npm run build", "prepublishOnly": "npm test", "test": "karma start --single-run", diff --git a/tslint.json b/tslint.json index 9d09274..7d2e14b 100644 --- a/tslint.json +++ b/tslint.json @@ -1,17 +1,27 @@ { "rules": { "class-name": true, - "comment-format": [true, "check-space"], + "comment-format": [ + true, + "check-space" + ], "eofline": true, - "indent": [true, "spaces"], - "linebreak-style": [true, "LF"], + "indent": [ + true, + "spaces" + ], + "linebreak-style": [ + true, + "LF" + ], "member-access": false, "no-angle-bracket-type-assertion": true, "no-bitwise": true, - "no-consecutive-blank-lines": [true], + "no-consecutive-blank-lines": [ + true + ], "no-debugger": true, "no-default-export": true, - "no-duplicate-key": true, "no-duplicate-variable": true, "no-eval": true, "no-internal-module": true, @@ -19,20 +29,56 @@ "no-reference": true, "no-trailing-whitespace": true, "no-unused-expression": true, - "no-unused-new": true, "no-unused-variable": true, "no-var-keyword": true, - "object-literal-key-quotes": [true, "as-needed"], + "object-literal-key-quotes": [ + true, + "as-needed" + ], "object-literal-shorthand": true, "object-literal-sort-keys": true, - "one-line": [true, "check-catch", "check-finally", "check-else", "check-open-brace"], - "one-variable-per-declaration": [true, "ignore-for-loop"], - "ordered-imports": [true], - "quotemark": [true, "single"], - "semicolon": [true, "never"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}], - "triple-equals": [true, "allow-null-check"], + "one-line": [ + true, + "check-catch", + "check-finally", + "check-else", + "check-open-brace" + ], + "one-variable-per-declaration": [ + true, + "ignore-for-loop" + ], + "ordered-imports": [ + true + ], + "quotemark": [ + true, + "single" + ], + "semicolon": [ + true, + "never" + ], + "trailing-comma": [ + true, + { + "multiline": "never", + "singleline": "never" + } + ], + "triple-equals": [ + true, + "allow-null-check" + ], "use-isnan": true, - "whitespace": [true, "check-branch", "check-decl", "check-module", "check-operator", "check-separator", "check-type"] + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-module", + "check-operator", + "check-separator", + "check-type" + ] } -} \ No newline at end of file +}