added codelyzer and tslint

This commit is contained in:
Art Lowel
2016-11-30 15:58:58 +01:00
parent a573556963
commit 7bd7f32362
2 changed files with 120 additions and 3 deletions

View File

@@ -26,7 +26,8 @@
"predebug": "npm run build",
"debug:build": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js",
"debug:build:prod": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js --config webpack.prod.config.ts",
"debug": "node --debug-brk dist/server/index.js"
"debug": "node --debug-brk dist/server/index.js",
"lint": "tslint \"src/**/*.ts\" || true"
},
"dependencies": {
"@angular/common": "~2.1.2",
@@ -58,7 +59,7 @@
"zone.js": "~0.6.26"
},
"devDependencies": {
"@types/morgan": "^1.7.32",
"@ngtools/webpack": "~1.1.7",
"@types/body-parser": "0.0.29",
"@types/compression": "0.0.29",
"@types/cookie-parser": "^1.3.29",
@@ -67,13 +68,14 @@
"@types/hammerjs": "^2.0.32",
"@types/memory-cache": "0.0.29",
"@types/mime": "0.0.28",
"@types/morgan": "^1.7.32",
"@types/node": "^6.0.38",
"@types/serve-static": "^1.7.27",
"@types/webfontloader": "^1.6.27",
"@ngtools/webpack": "~1.1.7",
"accepts": "^1.3.3",
"angular2-template-loader": "^0.4.0",
"awesome-typescript-loader": "^2.2.4",
"codelyzer": "^2.0.0-beta.1",
"cookie-parser": "^1.4.3",
"express-interceptor": "^1.2.0",
"iltorb": "^1.0.13",
@@ -87,6 +89,7 @@
"string-replace-loader": "^1.0.5",
"ts-helpers": "^1.1.2",
"ts-node": "^1.3.0",
"tslint": "^4.0.2",
"typescript": "2.0.2",
"v8-lazy-parse-webpack-plugin": "^0.3.0",
"webpack": "2.1.0-beta.27",

114
tslint.json Normal file
View File

@@ -0,0 +1,114 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules":{
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
"spaces"
],
"label-position": true,
"label-undefined": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
"static-before-instance",
"variables-before-functions"
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-inferrable-types": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-unreachable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [true, "attribute", "ds", "camelCase"],
"component-selector": [true, "element", "ds", "kebab-case"],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-attribute-parameter-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"no-forward-ref": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"pipe-naming": [true, "camelCase", "ds"],
"component-class-suffix": true,
"directive-class-suffix": true,
"import-destructuring-spacing": true,
"templates-use-public": true,
"no-access-missing-member": true,
"invoke-injectable": true
}
}