add lint to build

This commit is contained in:
Boris Cherny
2018-06-21 13:26:06 +03:00
parent 4447c1967a
commit aa05594395
3 changed files with 65 additions and 18 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ export function react2angular<Props>(
bindings: fromPairs(names.map(_ => [_, '<'])), bindings: fromPairs(names.map(_ => [_, '<'])),
controller: ['$element', ...injectNames, class extends NgComponent<Props> { controller: ['$element', ...injectNames, class extends NgComponent<Props> {
static get $$ngIsClass() { static get $$ngIsClass() {
return true; return true
} }
injectedProps: { [name: string]: any } injectedProps: { [name: string]: any }
constructor(private $element: IAugmentedJQuery, ...injectedProps: any[]) { constructor(private $element: IAugmentedJQuery, ...injectedProps: any[]) {
+2 -1
View File
@@ -6,8 +6,9 @@
"main:esnext": "index.es2015.js", "main:esnext": "index.es2015.js",
"typings": "index.d.ts", "typings": "index.d.ts",
"scripts": { "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", "clean": "rm ./*.d.ts; rm ./*.map; exit 0",
"lint": "tslint -p ./tsconfig.json index.tsx test.tsx",
"pretest": "npm run build", "pretest": "npm run build",
"prepublishOnly": "npm test", "prepublishOnly": "npm test",
"test": "karma start --single-run", "test": "karma start --single-run",
+62 -16
View File
@@ -1,17 +1,27 @@
{ {
"rules": { "rules": {
"class-name": true, "class-name": true,
"comment-format": [true, "check-space"], "comment-format": [
true,
"check-space"
],
"eofline": true, "eofline": true,
"indent": [true, "spaces"], "indent": [
"linebreak-style": [true, "LF"], true,
"spaces"
],
"linebreak-style": [
true,
"LF"
],
"member-access": false, "member-access": false,
"no-angle-bracket-type-assertion": true, "no-angle-bracket-type-assertion": true,
"no-bitwise": true, "no-bitwise": true,
"no-consecutive-blank-lines": [true], "no-consecutive-blank-lines": [
true
],
"no-debugger": true, "no-debugger": true,
"no-default-export": true, "no-default-export": true,
"no-duplicate-key": true,
"no-duplicate-variable": true, "no-duplicate-variable": true,
"no-eval": true, "no-eval": true,
"no-internal-module": true, "no-internal-module": true,
@@ -19,20 +29,56 @@
"no-reference": true, "no-reference": true,
"no-trailing-whitespace": true, "no-trailing-whitespace": true,
"no-unused-expression": true, "no-unused-expression": true,
"no-unused-new": true,
"no-unused-variable": true, "no-unused-variable": true,
"no-var-keyword": 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-shorthand": true,
"object-literal-sort-keys": true, "object-literal-sort-keys": true,
"one-line": [true, "check-catch", "check-finally", "check-else", "check-open-brace"], "one-line": [
"one-variable-per-declaration": [true, "ignore-for-loop"], true,
"ordered-imports": [true], "check-catch",
"quotemark": [true, "single"], "check-finally",
"semicolon": [true, "never"], "check-else",
"trailing-comma": [true, {"multiline": "never", "singleline": "never"}], "check-open-brace"
"triple-equals": [true, "allow-null-check"], ],
"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, "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"
]
} }
} }