From d6ab3d1ecf7e02413fbcaaf83550969f4224409b Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Sun, 14 Oct 2018 02:52:35 +0300 Subject: [PATCH 01/15] Fix lint errors --- src/tests/ImportNameRuleTests.ts | 4 ++-- src/tests/NoFunctionExpressionRuleTests.ts | 2 +- src/tests/NoWithStatementTests.ts | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tests/ImportNameRuleTests.ts b/src/tests/ImportNameRuleTests.ts index c294fbeb5..e2cfcb46d 100644 --- a/src/tests/ImportNameRuleTests.ts +++ b/src/tests/ImportNameRuleTests.ts @@ -174,7 +174,7 @@ describe('importNameRule', () : void => { import what from 'what-module' import Up from 'up-module' `; - const options: any[] = [ true, { + const options = [ true, { 'fs/package-name': 'pkg', 'abc-tag': 'abc', 'myModule': 'pqr' @@ -190,7 +190,7 @@ describe('importNameRule', () : void => { import what from 'what-module' import Up from 'up-module' `; - const options: any[] = [ true, { + const options = [ true, { 'fs/package-name': 'pkg', 'abc-tag': 'abc', 'myModule': 'pqr' diff --git a/src/tests/NoFunctionExpressionRuleTests.ts b/src/tests/NoFunctionExpressionRuleTests.ts index 5b38fd298..971809180 100644 --- a/src/tests/NoFunctionExpressionRuleTests.ts +++ b/src/tests/NoFunctionExpressionRuleTests.ts @@ -53,7 +53,7 @@ describe('noFunctionExpressionRule', (): void => { "character": 28, "line": 1 } - }], + }] ); }); diff --git a/src/tests/NoWithStatementTests.ts b/src/tests/NoWithStatementTests.ts index 6e4cf4e19..d949cefe0 100644 --- a/src/tests/NoWithStatementTests.ts +++ b/src/tests/NoWithStatementTests.ts @@ -1,7 +1,6 @@ import {Utils} from '../utils/Utils'; import {TestHelper} from './TestHelper'; - describe('noWithStatementsRule', () : void => { it('should produce violations', () : void => { const ruleName : string = 'no-with-statement'; From 6f3ebc27e3b799d61abf711840b209ea5b8b3e0c Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Sun, 14 Oct 2018 02:57:17 +0300 Subject: [PATCH 02/15] Add regular Grunt tasks to npm scripts --- package-lock.json | 727 ++++++++++++++++++++++++++++++++++++++++ package.json | 13 +- test-data/tsconfig.json | 13 + 3 files changed, 752 insertions(+), 1 deletion(-) create mode 100644 test-data/tsconfig.json diff --git a/package-lock.json b/package-lock.json index 22879d8ad..e17660b3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,22 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz", + "integrity": "sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -76,12 +92,30 @@ "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", "dev": true }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -330,6 +364,12 @@ "unset-value": "^1.0.0" } }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, "camelcase": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", @@ -494,6 +534,205 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "cp-file": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.0.0.tgz", + "integrity": "sha512-OtHMgPugkgwHlbph25wlMKd358lZNhX1Y2viUpPoFmlBPlEiPIRhztYWha11grbGPnlM+urp5saVmwsChCIOEg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "nested-error-stacks": "^2.0.0", + "pify": "^3.0.0", + "safe-buffer": "^5.0.1" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "cpy": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-7.0.1.tgz", + "integrity": "sha512-Zo52tXKLJcgy/baacn6KaNoRAakkl2wb+R4u6qJ4wlD0uchncwRQcIk66PlGlkzuToCJO6A6PWX27Tdwc8LU2g==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "cp-file": "^6.0.0", + "globby": "^8.0.1", + "nested-error-stacks": "^2.0.0" + } + }, + "cpy-cli": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-2.0.0.tgz", + "integrity": "sha512-LzrtY3lBWvFZcw4lXgkEbbDUd7y78juC3C5l7gj3UyezMEZF0Be9fjCVLN1HoZAzdMDeC3KHehWpHBJvgVAPkw==", + "dev": true, + "requires": { + "cpy": "^7.0.0", + "meow": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + } + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, "csproj2ts": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/csproj2ts/-/csproj2ts-1.1.0.tgz", @@ -557,6 +796,16 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + } + }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", @@ -572,6 +821,15 @@ "type-detect": "^4.0.0" } }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -634,6 +892,39 @@ "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", "dev": true }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "path-type": "^3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "duplexer": { + "version": "0.1.1", + "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, "error": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", @@ -653,6 +944,30 @@ "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es6-promise": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-0.1.2.tgz", @@ -677,6 +992,22 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, + "event-stream": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.6.tgz", + "integrity": "sha512-dGXNg4F/FgVzlApjzItL+7naHutA3fDqbV/zAZqDDlXTjiMnQmZKu+prImWKszeBM5UQeGvAl3u1wBiKeDh61g==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "flatmap-stream": "^0.1.0", + "from": "^0.1.7", + "map-stream": "0.0.7", + "pause-stream": "^0.0.11", + "split": "^1.0.1", + "stream-combiner": "^0.2.2", + "through": "^2.3.8" + } + }, "eventemitter2": { "version": "0.4.14", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", @@ -819,6 +1150,20 @@ } } }, + "fast-glob": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.3.tgz", + "integrity": "sha512-NiX+JXjnx43RzvVFwRWfPKo4U+1BrK5pJPsHQdKMlLoFHrrGktXglQhHliSihWAq+m1z6fHk3uwGHrtRbS9vLA==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.0.1", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.1", + "micromatch": "^3.1.10" + } + }, "faye-websocket": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", @@ -901,6 +1246,12 @@ } } }, + "flatmap-stream": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/flatmap-stream/-/flatmap-stream-0.1.1.tgz", + "integrity": "sha512-lAq4tLbm3sidmdCN8G3ExaxH7cUCtP5mgDvrYowsx84dcYkJJ4I28N7gkxA6+YlSXzaGLJYIDEi9WGfXzMiXdw==", + "dev": true + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -916,6 +1267,12 @@ "map-cache": "^0.2.2" } }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1451,6 +1808,12 @@ } } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "gaze": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", @@ -1519,6 +1882,49 @@ } } }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "globby": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "globule": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", @@ -1764,6 +2170,15 @@ "integrity": "sha512-a9aq8HiDtnwIZAsyGCUpwnqEVFWeof2HQIhj6incOMB/IUO7NQ7aNkzVX8Y+j3HaqyCZU31wUSFyDluqIEBKXA==", "dev": true }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -1779,6 +2194,12 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -1844,6 +2265,12 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, "indent-string": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", @@ -1919,6 +2346,12 @@ "builtin-modules": "^1.0.0" } }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -1939,6 +2372,12 @@ } } }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -2008,6 +2447,12 @@ } } }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -2017,6 +2462,24 @@ "isobject": "^3.0.1" } }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", @@ -2069,6 +2532,18 @@ "integrity": "sha1-iPvi+/dfCpH2YCD9mBzWk/S/5X4=", "dev": true }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -2146,6 +2621,23 @@ "signal-exit": "^3.0.0" } }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", @@ -2158,6 +2650,12 @@ "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", "dev": true }, + "map-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", + "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", + "dev": true + }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -2167,6 +2665,12 @@ "object-visit": "^1.0.0" } }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, "meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", @@ -2185,6 +2689,12 @@ "trim-newlines": "^1.0.0" } }, + "merge2": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", + "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==", + "dev": true + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -2221,6 +2731,16 @@ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, "mixin-deep": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", @@ -2350,6 +2870,18 @@ "integrity": "sha1-dDmFMW49tFkoG1hxaehFc1oFQ58=", "dev": true }, + "nested-error-stacks": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", + "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -2380,6 +2912,79 @@ "remove-trailing-separator": "^1.0.1" } }, + "npm-run-all": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.3.tgz", + "integrity": "sha512-aOG0N3Eo/WW+q6sUIdzcV2COS8VnTZCmdji0VQIAZF3b+a3YWb0AD0vFIyjKec18A7beLGbaQ5jFTNI2bPt9Cg==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.4", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "ps-tree": "^1.1.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -2423,6 +3028,12 @@ } } }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "dev": true + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -2516,6 +3127,12 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -2539,6 +3156,15 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, + "pause-stream": { + "version": "0.0.11", + "resolved": "http://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "requires": { + "through": "~2.3" + } + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -2609,12 +3235,27 @@ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, + "ps-tree": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", + "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", + "dev": true, + "requires": { + "event-stream": "~3.3.0" + } + }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, "raw-body": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.7.tgz", @@ -2841,12 +3482,45 @@ } } }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" + } + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -3020,6 +3694,15 @@ "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "requires": { + "through": "2" + } + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -3056,12 +3739,33 @@ } } }, + "stream-combiner": { + "version": "0.2.2", + "resolved": "http://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", + "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", + "dev": true, + "requires": { + "duplexer": "~0.1.1", + "through": "~2.3.4" + } + }, "string-template": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", "dev": true }, + "string.prototype.padend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", + "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.4.3", + "function-bind": "^1.0.2" + } + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -3110,6 +3814,12 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "through": { + "version": "2.3.8", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, "time-grunt": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/time-grunt/-/time-grunt-1.4.0.tgz", @@ -3489,6 +4199,23 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } } } } diff --git a/package.json b/package.json index 4c3926462..d08b4a826 100644 --- a/package.json +++ b/package.json @@ -37,13 +37,22 @@ "license": "MIT", "analyze": true, "scripts": { - "test": "grunt all" + "test": "grunt all", + "clean": "rimraf dist", + "copy:json": "cpy \"src/**/*.json\" dist --parents", + "ts:default": "tsc", + "ts:test-data": "tsc -p test-data", + "test:mocha": "mocha \"dist/src/tests/**/*.js\"", + "lint:rules": "tslint -r dist/src -t verbose -c tslint.json -e \"src/tests/**\" \"src/**/*.ts\"", + "lint:tests": "tslint -r dist/src -t verbose -c src/tests/tslint.json -e src/tests/references.ts \"src/tests/**/*.ts\"", + "newtest": "npm-run-all clean copy:json ts:* test:* lint:*" }, "dependencies": { "tsutils": "^2.27.2 <2.29.0" }, "devDependencies": { "chai": "4.2.0", + "cpy-cli": "^2.0.0", "grunt": "^1.0.3", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-copy": "^1.0.0", @@ -53,6 +62,8 @@ "grunt-tslint": "^5.0.2", "load-grunt-tasks": "4.0.0", "mocha": "5.2.0", + "npm-run-all": "^4.1.3", + "rimraf": "^2.6.2", "time-grunt": "1.4.0", "tslint": "^5.11.0", "typescript": "3.1.1", diff --git a/test-data/tsconfig.json b/test-data/tsconfig.json new file mode 100644 index 000000000..6115e05f3 --- /dev/null +++ b/test-data/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "declaration": true, + "experimentalDecorators": true, + "jsx": "react", + "module": "commonjs", + "outDir": "../dist/test-data", + "removeComments": true, + "sourceMap": true, + "target": "es5" + }, + "include": [ "." ] +} From 4805ebde8f20fdc33fe062a98cfd8a0a65d21ec2 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Sun, 14 Oct 2018 03:01:08 +0300 Subject: [PATCH 03/15] Add example for testing rules with tslint --test --- package.json | 1 + .../allow-siblings/test.js.lint | 7 ++++++ .../allow-siblings/test.ts.lint | 15 +++++++++++++ .../allow-siblings/tslint.json | 8 +++++++ .../no-relative-imports/default/test.js.lint | 10 +++++++++ .../no-relative-imports/default/test.ts.lint | 22 +++++++++++++++++++ tests/no-relative-imports/default/tslint.json | 8 +++++++ 7 files changed, 71 insertions(+) create mode 100644 tests/no-relative-imports/allow-siblings/test.js.lint create mode 100644 tests/no-relative-imports/allow-siblings/test.ts.lint create mode 100644 tests/no-relative-imports/allow-siblings/tslint.json create mode 100644 tests/no-relative-imports/default/test.js.lint create mode 100644 tests/no-relative-imports/default/test.ts.lint create mode 100644 tests/no-relative-imports/default/tslint.json diff --git a/package.json b/package.json index d08b4a826..f86d1b74c 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "copy:json": "cpy \"src/**/*.json\" dist --parents", "ts:default": "tsc", "ts:test-data": "tsc -p test-data", + "test:rules": "tslint -r dist/src --test \"tests/**\"", "test:mocha": "mocha \"dist/src/tests/**/*.js\"", "lint:rules": "tslint -r dist/src -t verbose -c tslint.json -e \"src/tests/**\" \"src/**/*.ts\"", "lint:tests": "tslint -r dist/src -t verbose -c src/tests/tslint.json -e src/tests/references.ts \"src/tests/**/*.ts\"", diff --git a/tests/no-relative-imports/allow-siblings/test.js.lint b/tests/no-relative-imports/allow-siblings/test.js.lint new file mode 100644 index 000000000..059fb1805 --- /dev/null +++ b/tests/no-relative-imports/allow-siblings/test.js.lint @@ -0,0 +1,7 @@ +import OfficeApp from 'OfficeApp'; +import OfficeApp from 'common/OfficeApp'; +import OfficeApp from './OfficeApp'; +import OfficeApp from './common/OfficeApp'; +import OfficeApp from '../common/OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module path starts with reference to parent directory. Please use an absolute path or sibling files/folders: import OfficeApp from '../common/OfficeApp';] +import OfficeApp from './../common/OfficeApp'; diff --git a/tests/no-relative-imports/allow-siblings/test.ts.lint b/tests/no-relative-imports/allow-siblings/test.ts.lint new file mode 100644 index 000000000..7de522bcc --- /dev/null +++ b/tests/no-relative-imports/allow-siblings/test.ts.lint @@ -0,0 +1,15 @@ +import App = require('App'); +import App = require('common/App'); +import App = require('./App'); +import App = require('./common/App'); +import App = require('../common/App'); + ~~~~~~~~~~~~~~~~~~~~~~~~ [External module path starts with reference to parent directory. Please use an absolute path or sibling files/folders: require('../common/App')] +import App = require('./../common/App'); + +import OfficeApp from 'OfficeApp'; +import OfficeApp from 'common/OfficeApp'; +import OfficeApp from './OfficeApp'; +import OfficeApp from './common/OfficeApp'; +import OfficeApp from '../common/OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module path starts with reference to parent directory. Please use an absolute path or sibling files/folders: import OfficeApp from '../common/OfficeApp';] +import OfficeApp from './../common/OfficeApp'; diff --git a/tests/no-relative-imports/allow-siblings/tslint.json b/tests/no-relative-imports/allow-siblings/tslint.json new file mode 100644 index 000000000..261541b35 --- /dev/null +++ b/tests/no-relative-imports/allow-siblings/tslint.json @@ -0,0 +1,8 @@ +{ + "rules": { + "no-relative-imports": [true, "allow-siblings"] + }, + "jsRules": { + "no-relative-imports": [true, "allow-siblings"] + } +} diff --git a/tests/no-relative-imports/default/test.js.lint b/tests/no-relative-imports/default/test.js.lint new file mode 100644 index 000000000..02c1ee385 --- /dev/null +++ b/tests/no-relative-imports/default/test.js.lint @@ -0,0 +1,10 @@ +import OfficeApp from 'OfficeApp'; +import OfficeApp from 'common/OfficeApp'; +import OfficeApp from './OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module is being loaded from a relative path. Please use an absolute path: import OfficeApp from './OfficeApp';] +import OfficeApp from './common/OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module is being loaded from a relative path. Please use an absolute path: import OfficeApp from './common/OfficeApp';] +import OfficeApp from '../common/OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module is being loaded from a relative path. Please use an absolute path: import OfficeApp from '../common/OfficeApp';] +import OfficeApp from './../common/OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module is being loaded from a relative path. Please use an absolute path: import OfficeApp from './../common/OfficeApp';] diff --git a/tests/no-relative-imports/default/test.ts.lint b/tests/no-relative-imports/default/test.ts.lint new file mode 100644 index 000000000..927638499 --- /dev/null +++ b/tests/no-relative-imports/default/test.ts.lint @@ -0,0 +1,22 @@ +import App = require('App'); +import App = require('common/App'); + +import App = require('./App'); + ~~~~~~~~~~~~~~~~ [External module is being loaded from a relative path. Please use an absolute path: require('./App')] +import App = require('./common/App'); + ~~~~~~~~~~~~~~~~~~~~~~~ [External module is being loaded from a relative path. Please use an absolute path: require('./common/App')] +import App = require('../common/App'); + ~~~~~~~~~~~~~~~~~~~~~~~~ [External module is being loaded from a relative path. Please use an absolute path: require('../common/App')] +import App = require('./../common/App'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ [External module is being loaded from a relative path. Please use an absolute path: require('./../common/App')] + +import OfficeApp from 'OfficeApp'; +import OfficeApp from 'common/OfficeApp'; +import OfficeApp from './OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module is being loaded from a relative path. Please use an absolute path: import OfficeApp from './OfficeApp';] +import OfficeApp from './common/OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module is being loaded from a relative path. Please use an absolute path: import OfficeApp from './common/OfficeApp';] +import OfficeApp from '../common/OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module is being loaded from a relative path. Please use an absolute path: import OfficeApp from '../common/OfficeApp';] +import OfficeApp from './../common/OfficeApp'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Imported module is being loaded from a relative path. Please use an absolute path: import OfficeApp from './../common/OfficeApp';] diff --git a/tests/no-relative-imports/default/tslint.json b/tests/no-relative-imports/default/tslint.json new file mode 100644 index 000000000..af00aefe0 --- /dev/null +++ b/tests/no-relative-imports/default/tslint.json @@ -0,0 +1,8 @@ +{ + "rules": { + "no-relative-imports": true + }, + "jsRules": { + "no-relative-imports": true + } +} From dd69d8946b0bdcde2e24c952346aca5bf59c1a74 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Sun, 14 Oct 2018 07:33:26 +0300 Subject: [PATCH 04/15] Migrate custom grunt tasks to node scripts --- build-tasks/common.js | 141 +++++++++++++++++++ build-tasks/generate-default-tslint-json.js | 11 ++ build-tasks/generate-package-json-for-npm.js | 10 ++ build-tasks/generate-recommendations.js | 46 ++++++ build-tasks/generate-rule-metadata.js | 13 ++ build-tasks/generate-sdl-report.js | 74 ++++++++++ build-tasks/validate-config.js | 61 ++++++++ build-tasks/validate-documentation.js | 34 +++++ package-lock.json | 22 ++- package.json | 12 +- 10 files changed, 419 insertions(+), 5 deletions(-) create mode 100644 build-tasks/common.js create mode 100644 build-tasks/generate-default-tslint-json.js create mode 100644 build-tasks/generate-package-json-for-npm.js create mode 100644 build-tasks/generate-recommendations.js create mode 100644 build-tasks/generate-rule-metadata.js create mode 100644 build-tasks/generate-sdl-report.js create mode 100644 build-tasks/validate-config.js create mode 100644 build-tasks/validate-documentation.js diff --git a/build-tasks/common.js b/build-tasks/common.js new file mode 100644 index 000000000..678a76fb2 --- /dev/null +++ b/build-tasks/common.js @@ -0,0 +1,141 @@ +const path = require('path'); +const fs = require('fs'); +const glob = require('glob'); + +function readFile(fileName) { + try { + return fs.readFileSync(String(fileName), {encoding: 'utf8'}); + } catch (e) { + console.error(`Unable to read file: ${String(fileName)}. Error code: ${e.code}`); + process.exit(1); + } +} + +function writeFile(fileName, data) { + try { + return fs.writeFileSync(String(fileName), data, {encoding: 'utf8'}); + } catch (e) { + console.error(`Unable to write file: ${String(fileName)}. Error code: ${e.code}`); + process.exit(1); + } +} + +function readJSON(fileName) { + try { + return JSON.parse(readFile(fileName)); + } catch (e) { + console.error(`Unable to parse JSON file: ${String(fileName)}.`, e); + process.exit(1); + } +} + +function getAllRules() { + const contribRules = glob.sync('dist/build/*Rule.js'); + const baseRules = glob.sync('node_modules/tslint/lib/rules/*Rule.js'); + + return contribRules.concat(baseRules); +} + +function getMetadataFromFile(ruleFile) { + const moduleName = path.resolve(ruleFile.replace(/\.js$/, '')); + const module = require(moduleName); + if (module.Rule.metadata === undefined) { + console.warn('No metadata found for ' + moduleName); + return; + } + return module.Rule.metadata; +} + +let additionalMetadata; +function getMetadataValue(metadata, name, allowEmpty, doNotEscape) { + additionalMetadata = additionalMetadata || readJSON('additional_rule_metadata.json'); + + let value = metadata[name]; + if (value === undefined) { + if (additionalMetadata[metadata.ruleName] === undefined) { + if (allowEmpty === false) { + console.warn(`Could not read metadata for rule ${metadata.ruleName} from additional_rule_metadata.json`); + process.exit(1); + } else { + return ''; + } + } + value = additionalMetadata[metadata.ruleName][name]; + if (value === undefined) { + if (allowEmpty === false) { + console.warn(`Could not read attribute ${name} of rule ${metadata.ruleName}`); + process.exit(1); + } + return ''; + } + } + if (doNotEscape === true) { + return value; + } + value = value.replace(/^\n+/, ''); // strip leading newlines + value = value.replace(/\n/, ' '); // convert newlines + if (value.indexOf(',') > -1) { + return '"' + value + '"'; + } else { + return value; + } +} + +function kebabCase(input) { + return input.split('').reduce((memo, element) => { + if (element.toLowerCase() === element) { + memo = memo + element; + } else { + memo = memo + '-' + element.toLowerCase(); + } + return memo; + }, ''); +} + +function getAllRuleNames(options = { skipTsLintRules: false }) { + const convertToRuleNames = filename => { + filename = filename + .replace(/Rule\..*/, '') // file extension plus Rule suffix + .replace(/.*\//, ''); // leading path + + return kebabCase(filename); + }; + + const contribRules = glob.sync('src/*Rule.ts').map(convertToRuleNames); + + let baseRules = []; + if (!options.skipTsLintRules) { + baseRules = glob.sync('node_modules/tslint/lib/rules/*Rule.js').map(convertToRuleNames); + } + + const allRules = baseRules.concat(contribRules); + allRules.sort(); + + return allRules; +} + +function getAllFormatterNames() { + const convertToFormatterNames = filename => { + filename = filename + .replace(/Formatter\..*/, '') // file extension plus Formatter suffix + .replace(/.*\//, ''); // leading path + + return kebabCase(filename); + }; + + const formatters = glob.sync('src/*Formatter.ts').map(convertToFormatterNames); + formatters.sort(); + + return formatters; +} + +module.exports = { + readFile, + readJSON, + writeFile, + getAllRuleNames, + getAllFormatterNames, + getAllRules, + getMetadataFromFile, + getMetadataValue +}; diff --git a/build-tasks/generate-default-tslint-json.js b/build-tasks/generate-default-tslint-json.js new file mode 100644 index 000000000..309385978 --- /dev/null +++ b/build-tasks/generate-default-tslint-json.js @@ -0,0 +1,11 @@ +/** + * Converts recommended_ruleset.js to ./dist/build/tslint.json. + */ + +const path = require('path'); +const common = require('./common'); + +const data = require(path.resolve('recommended_ruleset.js')); +data.rulesDirectory = './'; + +common.writeFile('dist/build/tslint.json', JSON.stringify(data, undefined, 2)); diff --git a/build-tasks/generate-package-json-for-npm.js b/build-tasks/generate-package-json-for-npm.js new file mode 100644 index 000000000..29dba074c --- /dev/null +++ b/build-tasks/generate-package-json-for-npm.js @@ -0,0 +1,10 @@ +/** + * Creates a package.json file for the npm module + */ + +const common = require('./common'); + +const basePackageJson = common.readJSON('package.json'); +delete basePackageJson.devDependencies; + +common.writeFile('dist/build/package.json', JSON.stringify(basePackageJson, undefined, 2)); diff --git a/build-tasks/generate-recommendations.js b/build-tasks/generate-recommendations.js new file mode 100644 index 000000000..4d3cb3c4e --- /dev/null +++ b/build-tasks/generate-recommendations.js @@ -0,0 +1,46 @@ +/** + * Generates the recommended_ruleset.js file. + */ + +const common = require('./common'); +const groupedRows = {}; +const warnings = []; + +common.getAllRules().forEach(ruleFile => { + const metadata = common.getMetadataFromFile(ruleFile); + + const groupName = common.getMetadataValue(metadata, 'group'); + if (groupName === 'Ignored') { + return; + } + if (groupName === '') { + warnings.push('Could not generate recommendation for rule file: ' + ruleFile); + } + if (groupedRows[groupName] === undefined) { + groupedRows[groupName] = []; + } + + let recommendation = common.getMetadataValue(metadata, 'recommendation', true, true); + if (recommendation === '') { + recommendation = 'true,'; + } + const ruleName = common.getMetadataValue(metadata, 'ruleName'); + groupedRows[groupName].push(` "${ruleName}": ${recommendation}`); +}); + +if (warnings.length > 0) { + console.warn('\n' + warnings.join('\n')); + process.exit(1); +} +Object.keys(groupedRows).forEach(groupName => groupedRows[groupName].sort()); + +let data = common.readFile('templates/recommended_ruleset.js.snippet'); +data = data.replace('%security_rules%', groupedRows.Security.join('\n')); +data = data.replace('%correctness_rules%', groupedRows.Correctness.join('\n')); +data = data.replace('%clarity_rules%', groupedRows.Clarity.join('\n')); +data = data.replace('%whitespace_rules%', groupedRows.Whitespace.join('\n')); +data = data.replace('%configurable_rules%', groupedRows.Configurable.join('\n')); +data = data.replace('%deprecated_rules%', groupedRows.Deprecated.join('\n')); +data = data.replace('%accessibilityy_rules%', groupedRows.Accessibility.join('\n')); + +common.writeFile('recommended_ruleset.js', data); diff --git a/build-tasks/generate-rule-metadata.js b/build-tasks/generate-rule-metadata.js new file mode 100644 index 000000000..584744e2a --- /dev/null +++ b/build-tasks/generate-rule-metadata.js @@ -0,0 +1,13 @@ +/** + * Generates rule-metadata.json which contains a json array of all rule metadata. + */ + +const common = require('./common'); +const allMetadata = []; + +common.getAllRules().forEach(ruleFile => { + const metadata = common.getMetadataFromFile(ruleFile); + allMetadata.push(metadata); +}); + +common.writeFile('rule-metadata.json', JSON.stringify(allMetadata, undefined, 2)); diff --git a/build-tasks/generate-sdl-report.js b/build-tasks/generate-sdl-report.js new file mode 100644 index 000000000..25f4a5b12 --- /dev/null +++ b/build-tasks/generate-sdl-report.js @@ -0,0 +1,74 @@ +/** + * Generates an SDL report in csv format. + */ + +const common = require('./common'); +const rows = []; +const resolution = 'See description on the tslint or tslint-microsoft-contrib website'; +const procedure = 'TSLint Procedure'; +const header = 'Title,Description,ErrorID,Tool,IssueClass,IssueType,SDL Bug Bar Severity,' + + 'SDL Level,Resolution,SDL Procedure,CWE,CWE Description'; + +common.getAllRules().forEach(ruleFile => { + const metadata = common.getMetadataFromFile(ruleFile); + + const issueClass = common.getMetadataValue(metadata, 'issueClass'); + if (issueClass === 'Ignored') { + return; + } + const ruleName = common.getMetadataValue(metadata, 'ruleName'); + const errorId = 'TSLINT' + getHash(ruleName); + const issueType = common.getMetadataValue(metadata, 'issueType'); + const severity = common.getMetadataValue(metadata, 'severity'); + const level = common.getMetadataValue(metadata, 'level'); + const description = common.getMetadataValue(metadata, 'description'); + const cwe = common.getMetadataValue(metadata, 'commonWeaknessEnumeration', true, false); + const cweDescription = createCweDescription(metadata); + + const row = `${ruleName},${description},${errorId},tslint,${issueClass},${issueType},${severity},${level},${resolution},${procedure},${cwe},${cweDescription}`; + rows.push(row); +}); + +rows.sort(); +rows.unshift(header); + +common.writeFile('tslint-warnings.csv', rows.join('\n')); + +function getHash(input) { + // initialized with a prime number + let hash = 31; + let i = 0; + for (i = 0; i < input.length; i++) { + // multiply by prime so to get the better distribution of the values + hash = 31 * hash + input.charCodeAt(i); // run the hash function on all chars + hash = hash | 0; // convert to 32 bit signed integer + } + return Math.abs(hash).toString(32).toUpperCase(); +} + +function createCweDescription(metadata) { + const allCweDescriptions = common.readJSON('cwe_descriptions.json'); + + const cwe = common.getMetadataValue(metadata, 'commonWeaknessEnumeration', true, true); + if (cwe === '') { + return ''; + } + + let result = ''; + cwe.split(',').forEach(cweNumber => { + cweNumber = cweNumber.trim(); + const description = allCweDescriptions[cweNumber]; + if (description === undefined) { + console.warn(`Cannot find description of ${cweNumber} for rule ${metadata.ruleName} in cwe_descriptions.json`); + process.exit(1); + } + if (result !== '') { + result = result + '\n'; + } + result = result + `CWE ${cweNumber} - ${description}`; + }); + if (result !== '') { + return '"' + result + '"'; + } + return result; +} diff --git a/build-tasks/validate-config.js b/build-tasks/validate-config.js new file mode 100644 index 000000000..5bc716181 --- /dev/null +++ b/build-tasks/validate-config.js @@ -0,0 +1,61 @@ +/** + * Makes sure all the rules in the project are defined to run during the build. + */ + +const common = require('./common'); + +const tslintConfig = common.readJSON('tslint.json'); + +const rulesToSkip = new Set([ + 'align', // no need + 'ban-types', + 'comment-format', // no need + 'completed-docs', // no need + 'cyclomatic-complexity', // too strict + 'deprecation', // requires type checking + 'file-header', // no need + 'file-name-casing', // too strict + 'interface-name', // no need + 'match-default-export-name', // requires type checking + 'max-classes-per-file', // no need + 'max-file-line-count', // no need + 'member-ordering', // too strict + 'newline-before-return', // kind of a silly rule + 'newline-per-chained-call', // too strict + 'no-dynamic-delete', // too strict + 'no-empty-line-after-opening-brace', // too strict + 'no-inferrable-types', // we prefer the opposite + 'no-multiline-string', // too strict + 'no-non-null-assertion', // in fact we prefer the opposite rule + 'no-parameter-reassignment', // turn this on eventually + 'no-relative-imports', // this project uses relative imports + 'no-unexternalized-strings', // this is a VS Code specific rule + 'no-unnecessary-type-assertion', // requires type checking + 'no-unused-variable', // requires type checking + 'ordered-imports', // too difficult to turn on + 'prefer-conditional-expression', // not sure if this is needed + 'prefer-switch', // no need + 'prefer-template', // rule does not handle multi-line strings nicely + 'prefer-while', // not sure if this is needed + 'return-undefined', // requires type checking + 'type-literal-delimiter', // not sure if this is needed + 'typedef-whitespace', // too strict + 'use-default-type-parameter' // requires type checking +]); + +const errors = []; +common.getAllRuleNames().forEach(ruleName => { + if (rulesToSkip.has(ruleName)) { + return; + } + if (tslintConfig.rules[ruleName] !== true && tslintConfig.rules[ruleName] !== false) { + if (tslintConfig.rules[ruleName] === undefined || tslintConfig.rules[ruleName][0] !== true) { + errors.push('A rule was found that is not enabled on the project: ' + ruleName); + } + } +}); + +if (errors.length > 0) { + console.warn(errors.join('\n')); + process.exit(1); +} diff --git a/build-tasks/validate-documentation.js b/build-tasks/validate-documentation.js new file mode 100644 index 000000000..f529a4fa4 --- /dev/null +++ b/build-tasks/validate-documentation.js @@ -0,0 +1,34 @@ +/** + * Validates that all rules defined in src are documented in README.md + * and validates that the package.json version is the same version defined in README.md. + */ + +const common = require('./common'); + +const readmeText = common.readFile('README.md'); +const packageJson = common.readJSON('package.json'); +const validationErrors = []; + +common.getAllRuleNames({ skipTsLintRules: true }).forEach(ruleName => { + if (readmeText.indexOf(ruleName) === -1) { + validationErrors.push('A rule was found that is not documented in README.md: ' + ruleName); + } +}); + +common.getAllFormatterNames().forEach(formatterName => { + if (readmeText.indexOf(formatterName) === -1) { + validationErrors.push('A formatter was found that is not documented in README.md: ' + formatterName); + validationFailed = true; + } +}); + +if (readmeText.indexOf('[npm-' + packageJson.version + ']') === -1) { + validationErrors.push('Version not documented in README.md correctly.\n' + + 'package.json declares: ' + packageJson.version + '\n' + + 'README.md declares something different.'); +} + +if (validationErrors.length > 0) { + console.warn(validationErrors.join('\n')); + process.exit(1); +} diff --git a/package-lock.json b/package-lock.json index e17660b3c..9736476de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1848,15 +1848,15 @@ "dev": true }, "glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.2", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -1989,6 +1989,20 @@ "rimraf": "~2.6.2" }, "dependencies": { + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "grunt-cli": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", diff --git a/package.json b/package.json index f86d1b74c..1a33d45ed 100644 --- a/package.json +++ b/package.json @@ -40,13 +40,22 @@ "test": "grunt all", "clean": "rimraf dist", "copy:json": "cpy \"src/**/*.json\" dist --parents", + "copy:package": "cpy \"**/*.js\" \"**/*.json\" \"!tests/**\" \"!references.js\" \"tests/TestHelper.js\" \"tests/TestHelper.d.ts\" ../build --cwd=\"dist/src\" --parents", + "copy:meta": "cpy README.md recommended_ruleset.js dist/build --parents", "ts:default": "tsc", "ts:test-data": "tsc -p test-data", "test:rules": "tslint -r dist/src --test \"tests/**\"", "test:mocha": "mocha \"dist/src/tests/**/*.js\"", "lint:rules": "tslint -r dist/src -t verbose -c tslint.json -e \"src/tests/**\" \"src/**/*.ts\"", "lint:tests": "tslint -r dist/src -t verbose -c src/tests/tslint.json -e src/tests/references.ts \"src/tests/**/*.ts\"", - "newtest": "npm-run-all clean copy:json ts:* test:* lint:*" + "validate:documentation": "node build-tasks/validate-documentation.js", + "validate:config": "node build-tasks/validate-config.js", + "generate:recommendations": "node build-tasks/generate-recommendations.js", + "generate:default-tslint-json": "node build-tasks/generate-default-tslint-json.js", + "generate:sdl-report": "node build-tasks/generate-sdl-report.js", + "generate:rule-metadata": "node build-tasks/generate-rule-metadata.js", + "generate:package-json-for-npm": "node build-tasks/generate-package-json-for-npm.js", + "newtest": "npm-run-all clean copy:json ts:* test:* lint:* validate:* copy:package copy:meta generate:*" }, "dependencies": { "tsutils": "^2.27.2 <2.29.0" @@ -54,6 +63,7 @@ "devDependencies": { "chai": "4.2.0", "cpy-cli": "^2.0.0", + "glob": "^7.1.3", "grunt": "^1.0.3", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-copy": "^1.0.0", From 4526400b11f9ee7aebd71e0d528dd617827caeb2 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Sun, 21 Oct 2018 02:56:26 +0300 Subject: [PATCH 05/15] Add create rule task --- build-tasks/create-rule.js | 80 ++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 build-tasks/create-rule.js diff --git a/build-tasks/create-rule.js b/build-tasks/create-rule.js new file mode 100644 index 000000000..2bb087abc --- /dev/null +++ b/build-tasks/create-rule.js @@ -0,0 +1,80 @@ +const common = require('./common'); +const fs = require('fs'); + +const ruleName = getRuleName(); + +const ruleFile = camelCase(ruleName) + 'Rule'; +const sourceFileName = 'src/' + ruleFile + '.ts'; +const testsFolder = 'tests/' + ruleName; +const testFile = testsFolder + '/test.ts.lint'; +const lintFile = testsFolder + '/tslint.json'; + +validateAguments(); +createImplementationFile(); +createTestFiles(); +addToConfig(); + +console.log('Rule created'); +console.log('Rule source: ' + sourceFileName); +console.log('Test file: ' + testFile); + +function getRuleName() { + const option = process.argv.find(str => str.startsWith('--rule-name')); + + if (!option) { + return; + } + + return option.split('=')[1]; +} + +function camelCase(input) { + return input.toLowerCase().replace(/-(.)/g, (match, group1) => group1.toUpperCase()); +} + +function validateAguments() { + const USAGE_EXAMPLE = '\nUsage example:\nnpm run create-rule -- --rule-name=no-something-or-other\n'; + + if (!ruleName) { + console.log('--rule-name parameter is required.' + USAGE_EXAMPLE); + process.exit(1); + } + + if (!/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(ruleName)) { + console.log('Rule name should consist of lowercase letters and numbers separated with "-" character.' + USAGE_EXAMPLE); + process.exit(1); + } +} + +function createImplementationFile() { + const walkerName = ruleFile.charAt(0).toUpperCase() + ruleFile.substr(1) + 'Walker'; + + const ruleTemplateText = common.readFile('templates/rule.snippet'); + const ruleSource = ruleTemplateText + .replace(/%RULE_NAME%/gm, ruleName) + .replace(/%WALKER_NAME%/gm, walkerName); + + common.writeFile(sourceFileName, ruleSource); +} + +function createTestFiles() { + const testContent = '// Code that should be checked by rule'; + const tslintContent = { + rules: { + [ruleName]: true + } + }; + + fs.mkdirSync(testsFolder); + + common.writeFile(testFile, testContent); + common.writeFile(lintFile, JSON.stringify(tslintContent, undefined, 2)); +} + +function addToConfig() { + const currentRuleset = common.readJSON('tslint.json'); + + currentRuleset.rules[ruleName] = true; + + common.writeFile('tslint.json', JSON.stringify(currentRuleset, undefined, 2)); +} diff --git a/package.json b/package.json index 1a33d45ed..1f04aab23 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,8 @@ "generate:sdl-report": "node build-tasks/generate-sdl-report.js", "generate:rule-metadata": "node build-tasks/generate-rule-metadata.js", "generate:package-json-for-npm": "node build-tasks/generate-package-json-for-npm.js", - "newtest": "npm-run-all clean copy:json ts:* test:* lint:* validate:* copy:package copy:meta generate:*" + "newtest": "npm-run-all clean copy:json ts:* test:* lint:* validate:* copy:package copy:meta generate:*", + "create-rule": "node build-tasks/create-rule.js" }, "dependencies": { "tsutils": "^2.27.2 <2.29.0" From adcdf86960860ed3eeca158f4dc520d3fd04d443 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Thu, 25 Oct 2018 00:46:27 +0300 Subject: [PATCH 06/15] Remove Grunt and related packages --- Gruntfile.js | 494 ----------- package-lock.json | 1821 ++-------------------------------------- package.json | 12 +- tsconfig.testdata.json | 13 - 4 files changed, 77 insertions(+), 2263 deletions(-) delete mode 100644 Gruntfile.js delete mode 100644 tsconfig.testdata.json diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 86934da8b..000000000 --- a/Gruntfile.js +++ /dev/null @@ -1,494 +0,0 @@ -"use strict"; - -var _ = require('underscore'); - -module.exports = function(grunt) { - - let additionalMetadata; - let allCweDescriptions; - - function getAllRules() { - const contribRules = grunt.file.expand('dist/build/*Rule.js'); - const baseRules = grunt.file.expand('node_modules/tslint/lib/rules/*Rule.js'); - return contribRules.concat(baseRules); - } - - function hash(input) { - // initialized with a prime number - let hash = 31; - let i = 0; - for (i = 0; i < input.length; i++) { - // multiply by prime so to get the better distribution of the values - hash = 31 * hash + input.charCodeAt(i); // run the hash function on all chars - hash = hash | 0; // convert to 32 bit signed integer - } - return Math.abs(hash).toString(32).toUpperCase(); - } - - function getMetadataFromFile(ruleFile) { - const moduleName = './' + ruleFile.replace(/\.js$/, ''); - const module = require(moduleName); - if (module.Rule.metadata == null) { - grunt.fail.warn('No metadata found for ' + moduleName); - return; - } - return module.Rule.metadata; - } - - function createCweDescription(metadata) { - allCweDescriptions = allCweDescriptions || grunt.file.readJSON('./cwe_descriptions.json', {encoding: 'UTF-8'}); - - const cwe = getMetadataValue(metadata, 'commonWeaknessEnumeration', true, true); - if (cwe === '') { - return ''; - } - - let result = ''; - cwe.split(',').forEach(function (cweNumber) { - cweNumber = cweNumber.trim(); - const description = allCweDescriptions[cweNumber]; - if (description == null) { - grunt.fail.warn(`Cannot find description of ${cweNumber} for rule ${metadata['ruleName']} in cwe_descriptions.json`) - } - if (result !== '') { - result = result + '\n'; - } - result = result + `CWE ${cweNumber} - ${description}` - }); - if (result !== '') { - return '"' + result + '"'; - } - return result; - } - - function getMetadataValue(metadata, name, allowEmpty, doNotEscape) { - additionalMetadata = additionalMetadata || grunt.file.readJSON('./additional_rule_metadata.json', {encoding: 'UTF-8'}); - - let value = metadata[name]; - if (value == null) { - if (additionalMetadata[metadata.ruleName] == null) { - if (allowEmpty == false) { - grunt.fail.warn(`Could not read metadata for rule ${metadata.ruleName} from additional_rule_metadata.json`); - } else { - return ''; - } - } - value = additionalMetadata[metadata.ruleName][name]; - if (value == null) { - if (allowEmpty == false) { - grunt.fail.warn(`Could not read attribute ${name} of rule ${metadata.ruleName}`); - } - return ''; - } - } - if (doNotEscape == true) { - return value; - } - value = value.replace(/^\n+/, ''); // strip leading newlines - value = value.replace(/\n/, ' '); // convert newlines - if (value.indexOf(',') > -1) { - return '"' + value + '"'; - } else { - return value; - } - } - - function camelize(input) { - return _(input).reduce(function(memo, element) { - if (element.toLowerCase() === element) { - memo = memo + element; - } else { - memo = memo + '-' + element.toLowerCase(); - } - return memo; - }, ''); - } - - function getAllRuleNames(options) { - options = options || { skipTsLintRules: false } - - var convertToRuleNames = function(filename) { - filename = filename - .replace(/Rule\..*/, '') // file extension plus Rule name - .replace(/.*\//, ''); // leading path - return camelize(filename); - }; - - var contribRules = _(grunt.file.expand('src/*Rule.ts')).map(convertToRuleNames); - var baseRules = []; - if (!options.skipTsLintRules) { - baseRules = _(grunt.file.expand('node_modules/tslint/lib/rules/*Rule.js')).map(convertToRuleNames); - } - var allRules = baseRules.concat(contribRules); - allRules.sort(); - return allRules; - } - - function getAllFormatterNames() { - - var convertToRuleNames = function(filename) { - filename = filename - .replace(/Formatter\..*/, '') // file extension plus Rule name - .replace(/.*\//, ''); // leading path - return camelize(filename); - }; - - var formatters = _(grunt.file.expand('src/*Formatter.ts')).map(convertToRuleNames); - formatters.sort(); - return formatters; - } - - function camelCase(input) { - return input.toLowerCase().replace(/-(.)/g, function(match, group1) { - return group1.toUpperCase(); - }); - } - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - - clean: { - src: ['dist'], - options: { - force: true - } - }, - - copy: { - options: { - encoding: 'UTF-8' - }, - package: { - files: [ - { - expand: true, - cwd: 'dist/src', - src: [ - '**/*.js', - '**/*.json', - '!tests/**', - 'tests/TestHelper.js', - 'tests/TestHelper.d.ts', - '!references.js' - ], - dest: 'dist/build' - }, - { - expand: true, - cwd: '.', - src: [ - 'README.md', - 'recommended_ruleset.js' - ], - dest: 'dist/build' - } - ] - }, - json: { - expand: true, - cwd: '.', - src: ['src/**/*.json'], - dest: 'dist' - } - }, - - mochaTest: { - test: { - src: ['dist/src/tests/**/*.js'] - } - }, - - ts: { - default: { - tsconfig: { - tsconfig: './tsconfig.json', - passThrough: true, - updateFiles: true, - overwriteFiles: true, - } - }, - 'test-data': { - tsconfig: { - tsconfig: './tsconfig.testdata.json', - passThrough: true, - updateFiles: true, - overwriteFiles: true - } - } - }, - - tslint: { - options: { - rulesDirectory: 'dist/src', - formatter: 'verbose' - }, - prod: { - options: { - configuration: grunt.file.readJSON("tslint.json", { encoding: 'UTF-8' }) - }, - files: { - src: [ - 'src/**/*.ts', - '!src/tests/**' - ] - } - }, - tests: { - options: { - configuration: grunt.file.readJSON("src/tests/tslint.json", { encoding: 'UTF-8' }) - }, - files: { - src: [ - 'src/tests/**/*.ts', - '!src/tests/references.ts' - ] - } - } - }, - - watch: { - scripts: { - files: [ - './src/**/*.ts', - './tests/**/*.ts' - ], - tasks: [ - 'ts', - 'mochaTest', - 'tslint' - ] - } - } - - }); - - require('load-grunt-tasks')(grunt); // loads all grunt-* npm tasks - require('time-grunt')(grunt); - - grunt.registerTask('create-package-json-for-npm', 'A task that creates a package.json file for the npm module', function () { - var basePackageJson = grunt.file.readJSON('package.json', { encoding: 'UTF-8' }); - delete basePackageJson.devDependencies; - grunt.file.write('dist/build/package.json', JSON.stringify(basePackageJson, null, 2), { encoding: 'UTF-8' }); - }); - - grunt.registerTask('validate-documentation', 'A task that validates that all rules defined in src are documented in README.md\n' + - 'and validates that the package.json version is the same version defined in README.md', function () { - - var readmeText = grunt.file.read('README.md', { encoding: 'UTF-8' }); - var packageJson = grunt.file.readJSON('package.json', { encoding: 'UTF-8' }); - getAllRuleNames({ skipTsLintRules: true }).forEach(function(ruleName) { - if (readmeText.indexOf(ruleName) === -1) { - grunt.fail.warn('A rule was found that is not documented in README.md: ' + ruleName); - } - }); - getAllFormatterNames().forEach(function(formatterName) { - if (readmeText.indexOf(formatterName) === -1) { - grunt.fail.warn('A formatter was found that is not documented in README.md: ' + formatterName); - } - }); - - if (readmeText.indexOf('[npm-' + packageJson.version + ']') === -1) { - grunt.fail.warn('Version not documented in README.md correctly.\n' + - 'package.json declares: ' + packageJson.version + '\n' + - 'README.md declares something different.'); - } - }); - - grunt.registerTask('validate-config', 'A task that makes sure all the rules in the project are defined to run during the build.', function () { - - var tslintConfig = grunt.file.readJSON('tslint.json', { encoding: 'UTF-8' }); - var rulesToSkip = { - 'align': true, // no need - 'ban-types': true, - 'comment-format': true, // no need - 'completed-docs': true, // no need - 'cyclomatic-complexity': true, // too strict - 'deprecation': true, // requires type checking - 'file-header': true, // no need - 'file-name-casing': true, // too strict - 'interface-name': true, // no need - 'match-default-export-name': true, // requires type checking - 'max-classes-per-file': true, // no need - 'max-file-line-count': true, // no need - 'member-ordering': true, // too strict - 'newline-before-return': true, // kind of a silly rule - 'newline-per-chained-call': true, // too strict - 'no-dynamic-delete': true, // too strict - 'no-empty-line-after-opening-brace': true, // too strict - 'no-inferrable-types': true, // we prefer the opposite - 'no-multiline-string': true, // too strict - 'no-non-null-assertion': true, // in fact we prefer the opposite rule - 'no-parameter-reassignment': true, // turn this on eventually - 'no-relative-imports': true, // this project uses relative imports - 'no-unexternalized-strings': true, // this is a VS Code specific rule - 'no-unnecessary-type-assertion': true, // requires type checking - 'no-unused-variable': true, // requires type checking - 'ordered-imports': true, // too difficult to turn on - 'prefer-conditional-expression': true, // not sure if this is needed - 'prefer-switch': true, // no need - 'prefer-template': true, // rule does not handle multi-line strings nicely - 'prefer-while': true, // not sure if this is needed - 'return-undefined': true, // requires type checking - 'type-literal-delimiter': true, // not sure if this is needed - 'typedef-whitespace': true, // too strict - 'use-default-type-parameter': true, // requires type checking - }; - var errors = []; - getAllRuleNames().forEach(function(ruleName) { - if (rulesToSkip[ruleName]) { - return; - } - if (tslintConfig.rules[ruleName] !== true && tslintConfig.rules[ruleName] !== false) { - if (tslintConfig.rules[ruleName] == null || tslintConfig.rules[ruleName][0] !== true) { - errors.push('A rule was found that is not enabled on the project: ' + ruleName); - } - } - }); - - if (errors.length > 0) { - grunt.fail.warn(errors.join('\n')); - } - }); - - grunt.registerTask('generate-sdl-report', 'A task that generates an SDL report in csv format', function () { - - const rows = []; - const resolution = 'See description on the tslint or tslint-microsoft-contrib website'; - const procedure = 'TSLint Procedure'; - const header = 'Title,Description,ErrorID,Tool,IssueClass,IssueType,SDL Bug Bar Severity,' + - 'SDL Level,Resolution,SDL Procedure,CWE,CWE Description'; - getAllRules().forEach(function(ruleFile) { - const metadata = getMetadataFromFile(ruleFile); - - const issueClass = getMetadataValue(metadata, 'issueClass'); - if (issueClass === 'Ignored') { - return; - } - const ruleName = getMetadataValue(metadata, 'ruleName'); - const errorId = 'TSLINT' + hash(ruleName); - const issueType = getMetadataValue(metadata, 'issueType'); - const severity = getMetadataValue(metadata, 'severity'); - const level = getMetadataValue(metadata, 'level'); - const description = getMetadataValue(metadata, 'description'); - const cwe = getMetadataValue(metadata, 'commonWeaknessEnumeration', true, false); - const cweDescription = createCweDescription(metadata); - - const row = `${ruleName},${description},${errorId},tslint,${issueClass},${issueType},${severity},${level},${resolution},${procedure},${cwe},${cweDescription}`; - rows.push(row); - }); - rows.sort(); - rows.unshift(header); - grunt.file.write('tslint-warnings.csv', rows.join('\n'), {encoding: 'UTF-8'}); - - }); - - grunt.registerTask('generate-rule-metadata', 'A task that generates rule-metadata.json which contains a json array of all rule metadata', function () { - - const allMetadata = [] - - getAllRules().forEach(function(ruleFile) { - const metadata = getMetadataFromFile(ruleFile) - allMetadata.push(metadata) - }) - - grunt.file.write('rule-metadata.json', JSON.stringify(allMetadata, null, 2), {encoding: 'UTF-8'}); - }); - - grunt.registerTask('generate-recommendations', 'A task that generates the recommended_ruleset.js file', function () { - - const groupedRows = {}; - const warnings = []; - - getAllRules().forEach(function(ruleFile) { - const metadata = getMetadataFromFile(ruleFile); - - const groupName = getMetadataValue(metadata, 'group'); - if (groupName === 'Ignored') { - return; - } - if (groupName === '') { - warnings.push('Could not generate recommendation for rule file: ' + ruleFile); - } - if (groupedRows[groupName] == null) { - groupedRows[groupName] = []; - } - - let recommendation = getMetadataValue(metadata, 'recommendation', true, true); - if (recommendation === '') { - recommendation = 'true,'; - } - const ruleName = getMetadataValue(metadata, 'ruleName'); - groupedRows[groupName].push(` "${ruleName}": ${recommendation}`); - }); - - if (warnings.length > 0) { - grunt.fail.warn('\n' + warnings.join('\n')); - } - _.values(groupedRows).forEach(function (element) { element.sort(); }); - - let data = grunt.file.read('./templates/recommended_ruleset.js.snippet', {encoding: 'UTF-8'}); - data = data.replace('%security_rules%', groupedRows['Security'].join('\n')); - data = data.replace('%correctness_rules%', groupedRows['Correctness'].join('\n')); - data = data.replace('%clarity_rules%', groupedRows['Clarity'].join('\n')); - data = data.replace('%whitespace_rules%', groupedRows['Whitespace'].join('\n')); - data = data.replace('%configurable_rules%', groupedRows['Configurable'].join('\n')); - data = data.replace('%deprecated_rules%', groupedRows['Deprecated'].join('\n')); - data = data.replace('%accessibilityy_rules%', groupedRows['Accessibility'].join('\n')); - grunt.file.write('recommended_ruleset.js', data, {encoding: 'UTF-8'}); - }); - - grunt.registerTask('generate-default-tslint-json', 'A task that converts recommended_ruleset.js to ./dist/build/tslint.json', function () { - const data = require('./recommended_ruleset.js'); - data['rulesDirectory'] = './'; - grunt.file.write('./dist/build/tslint.json', JSON.stringify(data, null, 2), {encoding: 'UTF-8'}); - }); - - grunt.registerTask('create-rule', 'A task that creates a new rule from the rule templates. --rule-name parameter required', function () { - - function applyTemplates(source) { - return source.replace(/%RULE_NAME%/gm, ruleName) - .replace(/%RULE_FILE_NAME%/gm, ruleFile) - .replace(/%WALKER_NAME%/gm, walkerName); - } - - var ruleName = grunt.option('rule-name'); - if (!ruleName) { - grunt.fail.warn('--rule-name parameter is required'); - } else { - - var ruleFile = camelCase(ruleName) + 'Rule'; - var sourceFileName = './src/' + ruleFile + '.ts'; - var testFileName = './src/tests/' + ruleFile.charAt(0).toUpperCase() + ruleFile.substr(1) + 'Tests.ts'; - var walkerName = ruleFile.charAt(0).toUpperCase() + ruleFile.substr(1) + 'Walker'; - - var ruleTemplateText = grunt.file.read('./templates/rule.snippet', {encoding: 'UTF-8'}); - var testTemplateText = grunt.file.read('./templates/rule-tests.snippet', {encoding: 'UTF-8'}); - - grunt.file.write(sourceFileName, applyTemplates(ruleTemplateText), {encoding: 'UTF-8'}); - grunt.file.write(testFileName, applyTemplates(testTemplateText), {encoding: 'UTF-8'}); - - var currentRuleset = grunt.file.readJSON('./tslint.json', {encoding: 'UTF-8'}); - currentRuleset.rules[ruleName] = true; - grunt.file.write('./tslint.json', JSON.stringify(currentRuleset, null, 2), {encoding: 'UTF-8'}); - } - }); - - grunt.registerTask('all', 'Performs a cleanup and a full build with all tasks', [ - 'clean', - 'copy:json', - 'ts', - 'mochaTest', - 'tslint', - 'validate-documentation', - 'validate-config', - 'copy:package', - 'generate-recommendations', - 'generate-default-tslint-json', - 'generate-sdl-report', - 'generate-rule-metadata', - 'create-package-json-for-npm' - ]); - - grunt.registerTask('default', ['all']); - -}; diff --git a/package-lock.json b/package-lock.json index 9736476de..3a18d263c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,12 +20,6 @@ "integrity": "sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==", "dev": true }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -41,16 +35,6 @@ "color-convert": "^1.9.0" } }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -86,12 +70,6 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, "array-filter": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", @@ -155,18 +133,6 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, "atob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", @@ -272,24 +238,6 @@ } } }, - "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", - "dev": true - }, - "body": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/body/-/body-5.1.0.tgz", - "integrity": "sha1-5LoM5BCkaTYyM2dgnstOZVMSUGk=", - "dev": true, - "requires": { - "continuable-cache": "^0.3.1", - "error": "^7.0.0", - "raw-body": "~1.1.0", - "safe-json-parse": "~1.0.1" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -341,12 +289,6 @@ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, - "bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", - "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", - "dev": true - }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -370,22 +312,6 @@ "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", "dev": true }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -417,27 +343,6 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, - "chokidar": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", - "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.0", - "braces": "^2.3.0", - "fsevents": "^1.2.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "lodash.debounce": "^4.0.8", - "normalize-path": "^2.1.1", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0", - "upath": "^1.0.5" - } - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -461,12 +366,6 @@ } } }, - "coffeescript": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.10.0.tgz", - "integrity": "sha1-56qDAZF+9iGzXYo580jc3R234z4=", - "dev": true - }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -492,12 +391,6 @@ "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", "dev": true }, - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true - }, "commander": { "version": "2.15.1", "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", @@ -516,24 +409,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "continuable-cache": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/continuable-cache/-/continuable-cache-0.3.1.tgz", - "integrity": "sha1-vXJ6f67XfnH/OYWskzUakSczrQ8=", - "dev": true - }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, "cp-file": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.0.0.tgz", @@ -733,26 +614,6 @@ "which": "^1.2.9" } }, - "csproj2ts": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/csproj2ts/-/csproj2ts-1.1.0.tgz", - "integrity": "sha512-sk0RTT51t4lUNQ7UfZrqjQx7q4g0m3iwNA6mvyh7gLsgQYvwKzfdyoAgicC9GqJvkoIkU0UmndV9c7VZ8pJ45Q==", - "dev": true, - "requires": { - "es6-promise": "^4.1.1", - "lodash": "^4.17.4", - "semver": "^5.4.1", - "xml2js": "^0.4.19" - }, - "dependencies": { - "es6-promise": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", - "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", - "dev": true - } - } - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -762,25 +623,6 @@ "array-find-index": "^1.0.1" } }, - "date-time": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-1.1.0.tgz", - "integrity": "sha1-GIdtC9pMGf5w3Tv0sDTygbEqQLY=", - "dev": true, - "requires": { - "time-zone": "^0.1.0" - } - }, - "dateformat": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", - "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1", - "meow": "^3.3.0" - } - }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -871,21 +713,6 @@ } } }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "detect-newline": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true - }, "diff": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", @@ -925,16 +752,6 @@ "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", "dev": true }, - "error": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", - "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", - "dev": true, - "requires": { - "string-template": "~0.2.1", - "xtend": "~4.0.0" - } - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -968,24 +785,12 @@ "is-symbol": "^1.0.2" } }, - "es6-promise": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-0.1.2.tgz", - "integrity": "sha1-8RLCn+paCZhTn8tqL9IUQ9KPBfc=", - "dev": true - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", @@ -1008,18 +813,6 @@ "through": "^2.3.8" } }, - "eventemitter2": { - "version": "0.4.14", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", - "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", - "dev": true - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -1164,31 +957,6 @@ "micromatch": "^3.1.10" } }, - "faye-websocket": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", - "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", - "dev": true, - "requires": { - "websocket-driver": ">=0.5.1" - } - }, - "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" - } - }, - "file-sync-cmp": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz", - "integrity": "sha1-peeo/7+kk7Q7kju9TKiaU7Y7YSs=", - "dev": true - }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -1212,40 +980,6 @@ } } }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "findup-sync": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", - "dev": true, - "requires": { - "glob": "~5.0.0" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, "flatmap-stream": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/flatmap-stream/-/flatmap-stream-0.1.1.tgz", @@ -1279,634 +1013,84 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, - "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" }, "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, - "optional": true, "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "is-extglob": "^2.1.0" } - }, + } + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "globby": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + }, + "dependencies": { "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gaze": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", - "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", - "dev": true, - "requires": { - "globule": "^1.0.0" - } - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getobject": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", - "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=", - "dev": true - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", - "dev": true - }, - "globby": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", - "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "dir-glob": "^2.0.0", - "fast-glob": "^2.0.2", - "glob": "^7.1.2", - "ignore": "^3.3.5", - "pify": "^3.0.0", - "slash": "^1.0.0" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1925,33 +1109,6 @@ } } }, - "globule": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", - "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", - "dev": true, - "requires": { - "glob": "~7.1.1", - "lodash": "~4.17.10", - "minimatch": "~3.0.2" - }, - "dependencies": { - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", @@ -1964,226 +1121,6 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "grunt": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.3.tgz", - "integrity": "sha512-/JzmZNPfKorlCrrmxWqQO4JVodO+DVd5XX4DkocL/1WlLlKVLE9+SdEIempOAxDhWPysLle6afvn/hg7Ck2k9g==", - "dev": true, - "requires": { - "coffeescript": "~1.10.0", - "dateformat": "~1.0.12", - "eventemitter2": "~0.4.13", - "exit": "~0.1.1", - "findup-sync": "~0.3.0", - "glob": "~7.0.0", - "grunt-cli": "~1.2.0", - "grunt-known-options": "~1.1.0", - "grunt-legacy-log": "~2.0.0", - "grunt-legacy-util": "~1.1.1", - "iconv-lite": "~0.4.13", - "js-yaml": "~3.5.2", - "minimatch": "~3.0.2", - "mkdirp": "~0.5.1", - "nopt": "~3.0.6", - "path-is-absolute": "~1.0.0", - "rimraf": "~2.6.2" - }, - "dependencies": { - "glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "grunt-cli": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", - "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", - "dev": true, - "requires": { - "findup-sync": "~0.3.0", - "grunt-known-options": "~1.1.0", - "nopt": "~3.0.6", - "resolve": "~1.1.0" - } - } - } - }, - "grunt-contrib-clean": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-2.0.0.tgz", - "integrity": "sha512-g5ZD3ORk6gMa5ugZosLDQl3dZO7cI3R14U75hTM+dVLVxdMNJCPVmwf9OUt4v4eWgpKKWWoVK9DZc1amJp4nQw==", - "dev": true, - "requires": { - "async": "^2.6.1", - "rimraf": "^2.6.2" - }, - "dependencies": { - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - } - } - } - }, - "grunt-contrib-copy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", - "integrity": "sha1-cGDGWB6QS4qw0A8HbgqPbj58NXM=", - "dev": true, - "requires": { - "chalk": "^1.1.1", - "file-sync-cmp": "^0.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "grunt-contrib-watch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-watch/-/grunt-contrib-watch-1.1.0.tgz", - "integrity": "sha512-yGweN+0DW5yM+oo58fRu/XIRrPcn3r4tQx+nL7eMRwjpvk+rQY6R8o94BPK0i2UhTg9FN21hS+m8vR8v9vXfeg==", - "dev": true, - "requires": { - "async": "^2.6.0", - "gaze": "^1.1.0", - "lodash": "^4.17.10", - "tiny-lr": "^1.1.1" - }, - "dependencies": { - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - } - } - } - }, - "grunt-known-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.0.tgz", - "integrity": "sha1-pCdO6zL6dl2lp6OxcSYXzjsUQUk=", - "dev": true - }, - "grunt-legacy-log": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz", - "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==", - "dev": true, - "requires": { - "colors": "~1.1.2", - "grunt-legacy-log-utils": "~2.0.0", - "hooker": "~0.2.3", - "lodash": "~4.17.5" - } - }, - "grunt-legacy-log-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz", - "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==", - "dev": true, - "requires": { - "chalk": "~2.4.1", - "lodash": "~4.17.10" - } - }, - "grunt-legacy-util": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz", - "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==", - "dev": true, - "requires": { - "async": "~1.5.2", - "exit": "~0.1.1", - "getobject": "~0.1.0", - "hooker": "~0.2.3", - "lodash": "~4.17.10", - "underscore.string": "~3.3.4", - "which": "~1.3.0" - } - }, - "grunt-mocha-test": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/grunt-mocha-test/-/grunt-mocha-test-0.13.3.tgz", - "integrity": "sha512-zQGEsi3d+ViPPi7/4jcj78afKKAKiAA5n61pknQYi25Ugik+aNOuRmiOkmb8mN2CeG8YxT+YdT1H1Q7B/eNkoQ==", - "dev": true, - "requires": { - "hooker": "^0.2.3", - "mkdirp": "^0.5.0" - } - }, - "grunt-ts": { - "version": "6.0.0-beta.21", - "resolved": "https://registry.npmjs.org/grunt-ts/-/grunt-ts-6.0.0-beta.21.tgz", - "integrity": "sha512-LhcTFTSWYHZEmHAl+7jHUPsOcQ4LSKZWrNDo5FcyQTuTWs3x82M03I1nALXBZ4NJOvcTJkQmXZV8/l3W+wubZQ==", - "dev": true, - "requires": { - "chokidar": "^2.0.4", - "csproj2ts": "^1.1.0", - "detect-indent": "^4.0.0", - "detect-newline": "^2.1.0", - "es6-promise": "~0.1.1", - "jsmin2": "^1.2.1", - "lodash": "~4.17.10", - "ncp": "0.5.1", - "rimraf": "2.2.6", - "semver": "^5.3.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "rimraf": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.6.tgz", - "integrity": "sha1-xZWXVpsU2VatKcrMQr3d9fDqT0w=", - "dev": true - } - } - }, - "grunt-tslint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/grunt-tslint/-/grunt-tslint-5.0.2.tgz", - "integrity": "sha512-a9aq8HiDtnwIZAsyGCUpwnqEVFWeof2HQIhj6incOMB/IUO7NQ7aNkzVX8Y+j3HaqyCZU31wUSFyDluqIEBKXA==", - "dev": true - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -2252,48 +1189,18 @@ "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, - "hooker": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", - "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", - "dev": true - }, "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, - "http-parser-js": { - "version": "0.4.13", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.13.tgz", - "integrity": "sha1-O9bW/ebjFyyTNMOzO2wZPYD+ETc=", - "dev": true - }, - "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, "ignore": { "version": "3.3.10", "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -2336,15 +1243,6 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -2423,15 +1321,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, "is-glob": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", @@ -2494,12 +1383,6 @@ "has-symbols": "^1.0.0" } }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -2530,22 +1413,6 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, - "js-yaml": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz", - "integrity": "sha1-A3fDgBfKvHMisNH7zSWkkWQfL74=", - "dev": true, - "requires": { - "argparse": "^1.0.2", - "esprima": "^2.6.0" - } - }, - "jsmin2": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/jsmin2/-/jsmin2-1.2.1.tgz", - "integrity": "sha1-iPvi+/dfCpH2YCD9mBzWk/S/5X4=", - "dev": true - }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -2556,44 +1423,13 @@ "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "livereload-js": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-2.3.0.tgz", - "integrity": "sha512-j1R0/FeGa64Y+NmqfZhyoVRzcFlOZ8sNlKzHjh4VvLULFACZhn68XrX5DFg2FhMvSMJmROuFxRSa560ECWKBMg==", - "dev": true - }, - "load-grunt-tasks": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-4.0.0.tgz", - "integrity": "sha512-w5JYPHpZgMxu9XFR9N9MEzyX8E0mLhQkwQ1qVP4mb3gmuomw8Ww8J49NHMbXqyQliq2LUCqdU7/wW96IVuPCKw==", - "dev": true, - "requires": { - "arrify": "^1.0.0", - "multimatch": "^2.0.0", - "pkg-up": "^2.0.0", - "resolve-pkg": "^1.0.0" - } + "dev": true }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true }, "locate-path": { "version": "2.0.0", @@ -2613,18 +1449,6 @@ } } }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", - "dev": true - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, "loud-rejection": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", @@ -2685,24 +1509,6 @@ "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", "dev": true }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - } - }, "merge2": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", @@ -2739,12 +1545,6 @@ "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, "minimist-options": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", @@ -2840,25 +1640,6 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "multimatch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", - "dev": true, - "requires": { - "array-differ": "^1.0.0", - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "minimatch": "^3.0.0" - } - }, - "nan": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.0.tgz", - "integrity": "sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw==", - "dev": true, - "optional": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -2878,12 +1659,6 @@ "to-regex": "^3.0.1" } }, - "ncp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-0.5.1.tgz", - "integrity": "sha1-dDmFMW49tFkoG1hxaehFc1oFQ58=", - "dev": true - }, "nested-error-stacks": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", @@ -2896,15 +1671,6 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -2917,15 +1683,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, "npm-run-all": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.3.tgz", @@ -2999,18 +1756,6 @@ } } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -3099,21 +1844,6 @@ "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-ms": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", - "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", - "dev": true - }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -3126,15 +1856,6 @@ "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", "dev": true }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -3153,17 +1874,6 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "pathval": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", @@ -3179,76 +1889,12 @@ "through": "~2.3" } }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - } - } - }, - "plur": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", - "integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", - "dev": true - }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, - "pretty-ms": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", - "integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", - "dev": true, - "requires": { - "is-finite": "^1.0.1", - "parse-ms": "^1.0.0", - "plur": "^1.0.0" - } - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, "ps-tree": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", @@ -3258,97 +1904,12 @@ "event-stream": "~3.3.0" } }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, "quick-lru": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", "dev": true }, - "raw-body": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.7.tgz", - "integrity": "sha1-HQJ8K/oRasxmI7yo8AAWVyqH1CU=", - "dev": true, - "requires": { - "bytes": "1", - "string_decoder": "0.10" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -3359,12 +1920,6 @@ "safe-regex": "^1.1.0" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, "repeat-element": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", @@ -3377,36 +1932,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - }, - "resolve-from": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", - "dev": true - }, - "resolve-pkg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-1.0.0.tgz", - "integrity": "sha1-4ZoV54rKLhJEYdySsuOUPvk0lNk=", - "dev": true, - "requires": { - "resolve-from": "^2.0.0" - } - }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -3434,12 +1959,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "safe-json-parse": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-json-parse/-/safe-json-parse-1.0.1.tgz", - "integrity": "sha1-PnZyPjjf3aE8mx0poeB//uSzC1c=", - "dev": true - }, "safe-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", @@ -3449,30 +1968,12 @@ "ret": "~0.1.10" } }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -3726,12 +2227,6 @@ "extend-shallow": "^3.0.0" } }, - "sprintf-js": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.1.tgz", - "integrity": "sha1-Nr54Mgr+WAH2zqPueLblqrlA6gw=", - "dev": true - }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -3763,12 +2258,6 @@ "through": "~2.3.4" } }, - "string-template": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", - "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", - "dev": true - }, "string.prototype.padend": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", @@ -3780,12 +2269,6 @@ "function-bind": "^1.0.2" } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -3795,24 +2278,6 @@ "ansi-regex": "^2.0.0" } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1" - } - }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", @@ -3822,80 +2287,12 @@ "has-flag": "^3.0.0" } }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, "through": { "version": "2.3.8", "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "time-grunt": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/time-grunt/-/time-grunt-1.4.0.tgz", - "integrity": "sha1-BiIT5mDJB+hvRAVWwB6mWXtxJCA=", - "dev": true, - "requires": { - "chalk": "^1.0.0", - "date-time": "^1.1.0", - "figures": "^1.0.0", - "hooker": "^0.2.3", - "number-is-nan": "^1.0.0", - "pretty-ms": "^2.1.0", - "text-table": "^0.2.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "time-zone": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-0.1.0.tgz", - "integrity": "sha1-Sncotqwo2w4Aj1FAQ/1VW9VXO0Y=", - "dev": true - }, - "tiny-lr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-1.1.1.tgz", - "integrity": "sha512-44yhA3tsaRoMOjQQ+5v5mVdqef+kH6Qze9jTpqtVufgYjYt08zyZAwNwwVBj3i1rJMnR52IxOW0LK0vBzgAkuA==", - "dev": true, - "requires": { - "body": "^5.1.0", - "debug": "^3.1.0", - "faye-websocket": "~0.10.0", - "livereload-js": "^2.3.0", - "object-assign": "^4.1.0", - "qs": "^6.4.0" - } - }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -3938,12 +2335,6 @@ "repeat-string": "^1.6.1" } }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - }, "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", @@ -4042,16 +2433,6 @@ "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", "dev": true }, - "underscore.string": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz", - "integrity": "sha1-LCo/n4PmR2L9xF5s6sZRQoZCE9s=", - "dev": true, - "requires": { - "sprintf-js": "^1.0.3", - "util-deprecate": "^1.0.2" - } - }, "union-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", @@ -4127,12 +2508,6 @@ } } }, - "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", - "dev": true - }, "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", @@ -4145,12 +2520,6 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, "validate-npm-package-license": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", @@ -4161,22 +2530,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "websocket-driver": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", - "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", - "dev": true, - "requires": { - "http-parser-js": ">=0.4.0", - "websocket-extensions": ">=0.1.1" - } - }, - "websocket-extensions": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", - "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", - "dev": true - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -4192,28 +2545,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "xml2js": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", - "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", - "dev": true, - "requires": { - "sax": ">=0.6.0", - "xmlbuilder": "~9.0.1" - } - }, - "xmlbuilder": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, "yargs-parser": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", diff --git a/package.json b/package.json index 1f04aab23..f17cf91e9 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "license": "MIT", "analyze": true, "scripts": { - "test": "grunt all", + "test": "npm-run-all clean copy:json ts:* test:* lint:* validate:* copy:package copy:meta generate:*", "clean": "rimraf dist", "copy:json": "cpy \"src/**/*.json\" dist --parents", "copy:package": "cpy \"**/*.js\" \"**/*.json\" \"!tests/**\" \"!references.js\" \"tests/TestHelper.js\" \"tests/TestHelper.d.ts\" ../build --cwd=\"dist/src\" --parents", @@ -55,7 +55,6 @@ "generate:sdl-report": "node build-tasks/generate-sdl-report.js", "generate:rule-metadata": "node build-tasks/generate-rule-metadata.js", "generate:package-json-for-npm": "node build-tasks/generate-package-json-for-npm.js", - "newtest": "npm-run-all clean copy:json ts:* test:* lint:* validate:* copy:package copy:meta generate:*", "create-rule": "node build-tasks/create-rule.js" }, "dependencies": { @@ -65,18 +64,9 @@ "chai": "4.2.0", "cpy-cli": "^2.0.0", "glob": "^7.1.3", - "grunt": "^1.0.3", - "grunt-contrib-clean": "^2.0.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-watch": "^1.1.0", - "grunt-mocha-test": "0.13.3", - "grunt-ts": "^6.0.0-beta.21", - "grunt-tslint": "^5.0.2", - "load-grunt-tasks": "4.0.0", "mocha": "5.2.0", "npm-run-all": "^4.1.3", "rimraf": "^2.6.2", - "time-grunt": "1.4.0", "tslint": "^5.11.0", "typescript": "3.1.1", "underscore": "1.9.1" diff --git a/tsconfig.testdata.json b/tsconfig.testdata.json deleted file mode 100644 index f35116599..000000000 --- a/tsconfig.testdata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "experimentalDecorators": true, - "jsx": "react", - "module": "commonjs", - "outDir": "dist/test-data", - "removeComments": true, - "sourceMap": true, - "target": "es5" - }, - "include": [ "test-data" ] -} From a00532381a2d12873f95a01ec9b72896ab722b51 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Thu, 25 Oct 2018 00:55:03 +0300 Subject: [PATCH 07/15] Use ES2015 template literals for build tasks --- build-tasks/create-rule.js | 6 ++--- build-tasks/generate-recommendations.js | 10 ++----- .../templates/recommended_ruleset.template.js | 19 +++++++------- .../templates/rule.template.js | 8 +++--- recommended_ruleset.js | 1 - templates/rule-tests.snippet | 26 ------------------- 6 files changed, 19 insertions(+), 51 deletions(-) rename templates/recommended_ruleset.js.snippet => build-tasks/templates/recommended_ruleset.template.js (83%) rename templates/rule.snippet => build-tasks/templates/rule.template.js (91%) delete mode 100644 templates/rule-tests.snippet diff --git a/build-tasks/create-rule.js b/build-tasks/create-rule.js index 2bb087abc..733bc416a 100644 --- a/build-tasks/create-rule.js +++ b/build-tasks/create-rule.js @@ -49,10 +49,8 @@ function validateAguments() { function createImplementationFile() { const walkerName = ruleFile.charAt(0).toUpperCase() + ruleFile.substr(1) + 'Walker'; - const ruleTemplateText = common.readFile('templates/rule.snippet'); - const ruleSource = ruleTemplateText - .replace(/%RULE_NAME%/gm, ruleName) - .replace(/%WALKER_NAME%/gm, walkerName); + const ruleTemplate = require('./templates/rule.template'); + const ruleSource = ruleTemplate({ruleName, walkerName}); common.writeFile(sourceFileName, ruleSource); } diff --git a/build-tasks/generate-recommendations.js b/build-tasks/generate-recommendations.js index 4d3cb3c4e..6e8595edc 100644 --- a/build-tasks/generate-recommendations.js +++ b/build-tasks/generate-recommendations.js @@ -34,13 +34,7 @@ if (warnings.length > 0) { } Object.keys(groupedRows).forEach(groupName => groupedRows[groupName].sort()); -let data = common.readFile('templates/recommended_ruleset.js.snippet'); -data = data.replace('%security_rules%', groupedRows.Security.join('\n')); -data = data.replace('%correctness_rules%', groupedRows.Correctness.join('\n')); -data = data.replace('%clarity_rules%', groupedRows.Clarity.join('\n')); -data = data.replace('%whitespace_rules%', groupedRows.Whitespace.join('\n')); -data = data.replace('%configurable_rules%', groupedRows.Configurable.join('\n')); -data = data.replace('%deprecated_rules%', groupedRows.Deprecated.join('\n')); -data = data.replace('%accessibilityy_rules%', groupedRows.Accessibility.join('\n')); +const recommendedTemplate = require('./templates/recommended_ruleset.template'); +const data = recommendedTemplate(groupedRows); common.writeFile('recommended_ruleset.js', data); diff --git a/templates/recommended_ruleset.js.snippet b/build-tasks/templates/recommended_ruleset.template.js similarity index 83% rename from templates/recommended_ruleset.js.snippet rename to build-tasks/templates/recommended_ruleset.template.js index 40dc90930..76c0b347f 100644 --- a/templates/recommended_ruleset.js.snippet +++ b/build-tasks/templates/recommended_ruleset.template.js @@ -1,4 +1,5 @@ -/** +module.exports = (rows) => +`/** * These rule settings are a broad, general recommendation for a good default configuration. * This file is exported in the npm/nuget package as ./tslint.json. */ @@ -9,41 +10,41 @@ module.exports = { * Security Rules. The following rules should be turned on because they find security issues * or are recommended in the Microsoft Secure Development Lifecycle (SDL) */ -%security_rules% +${rows.Security.join('\n')} /** * Common Bugs and Correctness. The following rules should be turned on because they find * common bug patterns in the code or enforce type safety. */ -%correctness_rules% +${rows.Correctness.join('\n')} /** * Code Clarity. The following rules should be turned on because they make the code * generally more clear to the reader. */ -%clarity_rules% +${rows.Clarity.join('\n')} /** * Accessibility. The following rules should be turned on to guarantee the best user * experience for keyboard and screen reader users. */ -%accessibilityy_rules% +${rows.Accessibility.join('\n')} /** * Whitespace related rules. The only recommended whitespace strategy is to pick a single format and * be consistent. */ -%whitespace_rules% +${rows.Whitespace.join('\n')} /** * Controversial/Configurable rules. */ -%configurable_rules% +${rows.Configurable.join('\n')} /** * Deprecated rules. The following rules are deprecated for various reasons. */ -%deprecated_rules% +${rows.Deprecated.join('\n')} } }; - +`; diff --git a/templates/rule.snippet b/build-tasks/templates/rule.template.js similarity index 91% rename from templates/rule.snippet rename to build-tasks/templates/rule.template.js index dd305ba29..bf38840f8 100644 --- a/templates/rule.snippet +++ b/build-tasks/templates/rule.template.js @@ -1,4 +1,5 @@ -import * as ts from 'typescript'; +module.exports = ({ruleName, walkerName}) => +`import * as ts from 'typescript'; import * as Lint from 'tslint'; import {ExtendedMetadata} from './utils/ExtendedMetadata'; @@ -12,7 +13,7 @@ const FAILURE_STRING: string = 'Some error message: '; // TODO: Define an error export class Rule extends Lint.Rules.AbstractRule { public static metadata: ExtendedMetadata = { - ruleName: '%RULE_NAME%', + ruleName: '${ruleName}', type: 'maintainability', // one of: 'functionality' | 'maintainability' | 'style' | 'typescript' description: '... add a meaningful one line description', options: null, // tslint:disable-line:no-null-keyword @@ -32,10 +33,11 @@ export class Rule extends Lint.Rules.AbstractRule { } } -class %WALKER_NAME% extends Lint.RuleWalker { +class ${walkerName} extends Lint.RuleWalker { protected visitNode(node: ts.Node): void { console.log(ts.SyntaxKind[node.kind] + ' ' + node.getText()); super.visitNode(node); } } +`; diff --git a/recommended_ruleset.js b/recommended_ruleset.js index 49e0a5aea..b15ae4ebe 100644 --- a/recommended_ruleset.js +++ b/recommended_ruleset.js @@ -272,4 +272,3 @@ module.exports = { "valid-typeof": false, } }; - diff --git a/templates/rule-tests.snippet b/templates/rule-tests.snippet deleted file mode 100644 index db6aa092c..000000000 --- a/templates/rule-tests.snippet +++ /dev/null @@ -1,26 +0,0 @@ -import {TestHelper} from './TestHelper'; - -/** - * Unit tests. - */ -describe('%RULE_FILE_NAME%', () : void => { - - const ruleName : string = '%RULE_NAME%'; - - it('should pass on xxx', () : void => { - const script : string = ` - // todo: add passing example - `; - - TestHelper.assertViolations(ruleName, script, [ ]); - }); - - it('should fail on xxx', () : void => { - const script : string = ` - // todo: add failing example and update assertions - `; - - TestHelper.assertViolations(ruleName, script, [ ]); - }); - -}); From d87ecad811f632cb1f8f835de5690be932387b1e Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Thu, 25 Oct 2018 06:34:58 +0300 Subject: [PATCH 08/15] Update VS Code debug tasks --- .vscode/launch.json | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 39e19e974..23c7dfee4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,14 +4,26 @@ { "type": "node", "request": "launch", - "name": "Run Tests", - "program": "${workspaceFolder}/node_modules/.bin/grunt", + "name": "Run Mocha Tests", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", "args": [ - "mochaTest" - ], - "outFiles": [ - "${workspaceFolder}/dist/src/**/*.js" + "--no-timeouts", + "--colors", + "${workspaceFolder}/dist/src/tests/**/*.js" ] + }, + { + "type": "node", + "request": "launch", + "name": "Run TSLint Tests", + "program": "${workspaceFolder}/node_modules/tslint/bin/tslint", + "args": [ + "--test", + "-r", + "dist/src", + "tests/**" + ], + "outputCapture": "std" } ] -} \ No newline at end of file +} From 51054ab60276acf2106eda4f7073d9fc11950763 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Thu, 25 Oct 2018 07:33:28 +0300 Subject: [PATCH 09/15] Add simler watcher tasks and update README with relevant info --- README.md | 45 +++++++++++++++++++++++++++++++++++++-------- package.json | 1 + 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e69694ac1..c659b1ed0 100644 --- a/README.md +++ b/README.md @@ -166,28 +166,57 @@ Formatter Name | Description | Since ## Development -To develop tslint-microsoft-contrib simply clone the repository, install dependencies and run grunt: +To develop `tslint-microsoft-contrib` simply clone the repository, install dependencies and run `npm test`: git clone git@github.com:Microsoft/tslint-microsoft-contrib.git --config core.autocrlf=input --config core.eol=lf cd tslint-microsoft-contrib npm install - grunt all - grunt create-rule --rule-name=no-something-or-other + npm test + +You can create new rule from template with `create-rule` script: + + npm run create-rule -- --rule-name=no-something-or-other + +> NOTE: `--` is required before script arguments. + +This script will create file for rule implementation (inside `src`) as well as folder with rule tests (inside `test`). + +More information about writing rule tests can be found in [TSLint doccumentation](https://palantir.github.io/tslint/develop/testing-rules/) + ### Debug code -If command fails because of file access permissions, prefix it with sudo. +**VS Code** + +This repo provides pre-configured launch tasks for VS Code debugging rules and tests. + +* Pick `Run Mocha Tests` to debug rules which have Mocha unit tests inside `src/tests` folder. - npm install -g node-inspector +* Pick `Run TSLint Tests` to debug rules that have tests in TSLint format inside `tests` folder. -Then run: +**Node.js** - node-debug grunt mochaTest +Starting from Node.js v6.3 has built-in debugger that can be used with Chrom DevTools. For earlier versions use [`node-inspector`](https://www.npmjs.com/package/node-inspector) package. -The `node-debug` command will load Node Inspector in your default browser (works in Chrome and Opera only). +To debug rules that have Mocha tests use: + + node --inspect-brk ./node_modules/mocha/bin/_mocha --no-timeouts --colors "dist/src/tests/**/*.js" + +To debug rules that have tests in TSLint format use: + + node --inspect-brk ./node_modules/tslint/bin/tslint --test -r dist/src "tests/**" + + +Then open [chrome://inspect/](chrome://inspect/), click on `inspect` link for proper target in Remote Target section and add `tslint-microsoft-contrib` folder to Workspace (in Sources tab). Set a breakpoint somewhere in your code and resume execution. Your breakpoint should be hit. +You can use `npm start` watcher that will rebuild TS files from `src` before launching debug commands. + +> NOTE: Run `npm test` before `npm start` to copy all required files to `dist` folder. + +> NOTE: If breakpoins are not hit you can try to use `inlineSourceMaps` instead of `sourceMaps` in `tsconfig.json` + ### Creating a new Release Refer to the [Releases Wiki Page](https://github.com/Microsoft/tslint-microsoft-contrib/wiki/Releases) diff --git a/package.json b/package.json index f17cf91e9..54a400ef7 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "analyze": true, "scripts": { "test": "npm-run-all clean copy:json ts:* test:* lint:* validate:* copy:package copy:meta generate:*", + "start": "tsc --watch", "clean": "rimraf dist", "copy:json": "cpy \"src/**/*.json\" dist --parents", "copy:package": "cpy \"**/*.js\" \"**/*.json\" \"!tests/**\" \"!references.js\" \"tests/TestHelper.js\" \"tests/TestHelper.d.ts\" ../build --cwd=\"dist/src\" --parents", From af697081f61d8d2997cf0f5c1a8db9e991ff7639 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Thu, 25 Oct 2018 08:43:45 +0300 Subject: [PATCH 10/15] Remove unnecessary Grunt install step on CI --- .travis.yml | 5 +---- appveyor.yml | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d3beb574..4cc9d7b8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,4 @@ node_js: - '6' - '8' -before_script: - - npm install -g grunt-cli - -sudo: false \ No newline at end of file +sudo: false diff --git a/appveyor.yml b/appveyor.yml index 531bca9aa..8c04a2a6b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,6 @@ environment: install: # Get the latest stable version of Node.js - ps: Install-Product node $env:nodejs_version - - npm install -g grunt-cli - npm install test_script: From 6671ecaca38f1934fe6985343967299f5c0e2665 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Fri, 26 Oct 2018 21:48:55 +0300 Subject: [PATCH 11/15] Fix forrmatting and typos in README.md --- README.md | 59 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index c659b1ed0..e02ff2950 100644 --- a/README.md +++ b/README.md @@ -34,21 +34,23 @@ You can use that build by setting your npm version of `tslint-microsoft-contrib` ### Configure your Grunt build task -Add the new rulesDirectory to your tslint task: - - grunt.initConfig({ - tslint: { - options: { - rulesDirectory: 'node_modules/tslint-microsoft-contrib', - configuration: grunt.file.readJSON("tslint.json") - }, - files: { - src: ['src/file1.ts', 'src/file2.ts'] - } - } - }) - -The tslint.json file does not change format when using this package. Just add our rule definitions to your existing tslint.json file. +Add the new `rulesDirectory` to your `tslint` task: + +```js +grunt.initConfig({ + tslint: { + options: { + rulesDirectory: 'node_modules/tslint-microsoft-contrib', + configuration: grunt.file.readJSON("tslint.json") + }, + files: { + src: ['src/file1.ts', 'src/file2.ts'] + } + } +}) +``` + +The `tslint.json` file does not change format when using this package. Just add our rule definitions to your existing `tslint.json` file. ### Which Rules Should I Turn On? @@ -157,7 +159,7 @@ Rule Name | Description | Since ### Supported Formatters -These formatters assume that you use the UTF-8 file encoding. They may not work if you have a different encoding, especially if your encoding uses a 2-byte line ending (such as \r\n on Windows). +These formatters assume that you use the UTF-8 file encoding. They may not work if you have a different encoding, especially if your encoding uses a 2-byte line ending (such as `\r\n` on Windows). Formatter Name | Description | Since :---------- | :------------ | ------------- @@ -168,14 +170,18 @@ Formatter Name | Description | Since To develop `tslint-microsoft-contrib` simply clone the repository, install dependencies and run `npm test`: - git clone git@github.com:Microsoft/tslint-microsoft-contrib.git --config core.autocrlf=input --config core.eol=lf - cd tslint-microsoft-contrib - npm install - npm test +```shell +git clone git@github.com:Microsoft/tslint-microsoft-contrib.git --config core.autocrlf=input --config core.eol=lf +cd tslint-microsoft-contrib +npm install +npm test +``` You can create new rule from template with `create-rule` script: - npm run create-rule -- --rule-name=no-something-or-other +```shell +npm run create-rule -- --rule-name=no-something-or-other +``` > NOTE: `--` is required before script arguments. @@ -200,12 +206,15 @@ Starting from Node.js v6.3 has built-in debugger that can be used with Chrom Dev To debug rules that have Mocha tests use: - node --inspect-brk ./node_modules/mocha/bin/_mocha --no-timeouts --colors "dist/src/tests/**/*.js" +```shell +node --inspect-brk ./node_modules/mocha/bin/_mocha --no-timeouts --colors "dist/src/tests/**/*.js" +``` To debug rules that have tests in TSLint format use: - node --inspect-brk ./node_modules/tslint/bin/tslint --test -r dist/src "tests/**" - +```shell +node --inspect-brk ./node_modules/tslint/bin/tslint --test -r dist/src "tests/**" +``` Then open [chrome://inspect/](chrome://inspect/), click on `inspect` link for proper target in Remote Target section and add `tslint-microsoft-contrib` folder to Workspace (in Sources tab). @@ -215,7 +224,7 @@ You can use `npm start` watcher that will rebuild TS files from `src` before lau > NOTE: Run `npm test` before `npm start` to copy all required files to `dist` folder. -> NOTE: If breakpoins are not hit you can try to use `inlineSourceMaps` instead of `sourceMaps` in `tsconfig.json` +> NOTE: If breakpoints are not hit you can try to use `inlineSourceMaps` instead of `sourceMaps` in `tsconfig.json` ### Creating a new Release From 4b84e48a8e43c0285168d4f6ade8176444dcc3f0 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Fri, 26 Oct 2018 23:27:52 +0300 Subject: [PATCH 12/15] Sorted most scripts alphabeticallt. Renamed ts > tsc --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 54a400ef7..f6329a5c7 100644 --- a/package.json +++ b/package.json @@ -37,26 +37,26 @@ "license": "MIT", "analyze": true, "scripts": { - "test": "npm-run-all clean copy:json ts:* test:* lint:* validate:* copy:package copy:meta generate:*", - "start": "tsc --watch", "clean": "rimraf dist", "copy:json": "cpy \"src/**/*.json\" dist --parents", - "copy:package": "cpy \"**/*.js\" \"**/*.json\" \"!tests/**\" \"!references.js\" \"tests/TestHelper.js\" \"tests/TestHelper.d.ts\" ../build --cwd=\"dist/src\" --parents", "copy:meta": "cpy README.md recommended_ruleset.js dist/build --parents", - "ts:default": "tsc", - "ts:test-data": "tsc -p test-data", - "test:rules": "tslint -r dist/src --test \"tests/**\"", - "test:mocha": "mocha \"dist/src/tests/**/*.js\"", - "lint:rules": "tslint -r dist/src -t verbose -c tslint.json -e \"src/tests/**\" \"src/**/*.ts\"", - "lint:tests": "tslint -r dist/src -t verbose -c src/tests/tslint.json -e src/tests/references.ts \"src/tests/**/*.ts\"", - "validate:documentation": "node build-tasks/validate-documentation.js", - "validate:config": "node build-tasks/validate-config.js", + "copy:package": "cpy \"**/*.js\" \"**/*.json\" \"!tests/**\" \"!references.js\" \"tests/TestHelper.js\" \"tests/TestHelper.d.ts\" ../build --cwd=\"dist/src\" --parents", + "create-rule": "node build-tasks/create-rule.js", "generate:recommendations": "node build-tasks/generate-recommendations.js", "generate:default-tslint-json": "node build-tasks/generate-default-tslint-json.js", "generate:sdl-report": "node build-tasks/generate-sdl-report.js", "generate:rule-metadata": "node build-tasks/generate-rule-metadata.js", "generate:package-json-for-npm": "node build-tasks/generate-package-json-for-npm.js", - "create-rule": "node build-tasks/create-rule.js" + "lint:rules": "tslint -r dist/src -t verbose -c tslint.json -e \"src/tests/**\" \"src/**/*.ts\"", + "lint:tests": "tslint -r dist/src -t verbose -c src/tests/tslint.json -e src/tests/references.ts \"src/tests/**/*.ts\"", + "start": "tsc --watch", + "test:mocha": "mocha \"dist/src/tests/**/*.js\"", + "test:rules": "tslint -r dist/src --test \"tests/**\"", + "test": "npm-run-all clean copy:json tsc:* test:* lint:* validate:* copy:package copy:meta generate:*", + "tsc:src": "tsc", + "tsc:test-data": "tsc -p test-data", + "validate:config": "node build-tasks/validate-config.js", + "validate:documentation": "node build-tasks/validate-documentation.js" }, "dependencies": { "tsutils": "^2.27.2 <2.29.0" From 0a99c1bed12357d6a952a03bf0b6764da1a8bee8 Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Sat, 27 Oct 2018 00:25:05 +0300 Subject: [PATCH 13/15] Split common.js. Use destructuring for requires. --- build-tasks/common/files.js | 34 +++++++++++++++ build-tasks/{common.js => common/meta.js} | 34 +-------------- build-tasks/create-rule.js | 12 +++--- build-tasks/generate-default-tslint-json.js | 4 +- build-tasks/generate-package-json-for-npm.js | 6 +-- build-tasks/generate-recommendations.js | 15 ++++--- build-tasks/generate-rule-metadata.js | 9 ++-- build-tasks/generate-sdl-report.js | 45 +++++++++++++------- build-tasks/validate-config.js | 7 +-- build-tasks/validate-documentation.js | 11 ++--- 10 files changed, 99 insertions(+), 78 deletions(-) create mode 100644 build-tasks/common/files.js rename build-tasks/{common.js => common/meta.js} (80%) diff --git a/build-tasks/common/files.js b/build-tasks/common/files.js new file mode 100644 index 000000000..a38f89ab8 --- /dev/null +++ b/build-tasks/common/files.js @@ -0,0 +1,34 @@ +const fs = require('fs'); + +function readFile(fileName) { + try { + return fs.readFileSync(fileName, { encoding: 'utf8' }); + } catch (e) { + console.error(`Unable to read file: ${ fileName }. Error code: ${ e.code }`); + process.exit(1); + } +} + +function writeFile(fileName, data) { + try { + return fs.writeFileSync(fileName, data, { encoding: 'utf8' }); + } catch (e) { + console.error(`Unable to write file: ${ fileName }. Error code: ${ e.code }`); + process.exit(1); + } +} + +function readJSON(fileName) { + try { + return JSON.parse(readFile(fileName)); + } catch (e) { + console.error(`Unable to parse JSON file: ${ fileName }.`, e); + process.exit(1); + } +} + +module.exports = { + readFile, + readJSON, + writeFile +}; diff --git a/build-tasks/common.js b/build-tasks/common/meta.js similarity index 80% rename from build-tasks/common.js rename to build-tasks/common/meta.js index 678a76fb2..8f8f96e0b 100644 --- a/build-tasks/common.js +++ b/build-tasks/common/meta.js @@ -1,33 +1,6 @@ const path = require('path'); -const fs = require('fs'); const glob = require('glob'); - -function readFile(fileName) { - try { - return fs.readFileSync(String(fileName), {encoding: 'utf8'}); - } catch (e) { - console.error(`Unable to read file: ${String(fileName)}. Error code: ${e.code}`); - process.exit(1); - } -} - -function writeFile(fileName, data) { - try { - return fs.writeFileSync(String(fileName), data, {encoding: 'utf8'}); - } catch (e) { - console.error(`Unable to write file: ${String(fileName)}. Error code: ${e.code}`); - process.exit(1); - } -} - -function readJSON(fileName) { - try { - return JSON.parse(readFile(fileName)); - } catch (e) { - console.error(`Unable to parse JSON file: ${String(fileName)}.`, e); - process.exit(1); - } -} +const {readJSON} = require('./files'); function getAllRules() { const contribRules = glob.sync('dist/build/*Rule.js'); @@ -130,11 +103,8 @@ function getAllFormatterNames() { } module.exports = { - readFile, - readJSON, - writeFile, - getAllRuleNames, getAllFormatterNames, + getAllRuleNames, getAllRules, getMetadataFromFile, getMetadataValue diff --git a/build-tasks/create-rule.js b/build-tasks/create-rule.js index 733bc416a..444b0e4b0 100644 --- a/build-tasks/create-rule.js +++ b/build-tasks/create-rule.js @@ -1,4 +1,4 @@ -const common = require('./common'); +const { readJSON, writeFile } = require('./common/files'); const fs = require('fs'); const ruleName = getRuleName(); @@ -52,7 +52,7 @@ function createImplementationFile() { const ruleTemplate = require('./templates/rule.template'); const ruleSource = ruleTemplate({ruleName, walkerName}); - common.writeFile(sourceFileName, ruleSource); + writeFile(sourceFileName, ruleSource); } function createTestFiles() { @@ -65,14 +65,14 @@ function createTestFiles() { fs.mkdirSync(testsFolder); - common.writeFile(testFile, testContent); - common.writeFile(lintFile, JSON.stringify(tslintContent, undefined, 2)); + writeFile(testFile, testContent); + writeFile(lintFile, JSON.stringify(tslintContent, undefined, 2)); } function addToConfig() { - const currentRuleset = common.readJSON('tslint.json'); + const currentRuleset = readJSON('tslint.json'); currentRuleset.rules[ruleName] = true; - common.writeFile('tslint.json', JSON.stringify(currentRuleset, undefined, 2)); + writeFile('tslint.json', JSON.stringify(currentRuleset, undefined, 2)); } diff --git a/build-tasks/generate-default-tslint-json.js b/build-tasks/generate-default-tslint-json.js index 309385978..e27266c42 100644 --- a/build-tasks/generate-default-tslint-json.js +++ b/build-tasks/generate-default-tslint-json.js @@ -3,9 +3,9 @@ */ const path = require('path'); -const common = require('./common'); +const { writeFile } = require('./common/files'); const data = require(path.resolve('recommended_ruleset.js')); data.rulesDirectory = './'; -common.writeFile('dist/build/tslint.json', JSON.stringify(data, undefined, 2)); +writeFile('dist/build/tslint.json', JSON.stringify(data, undefined, 2)); diff --git a/build-tasks/generate-package-json-for-npm.js b/build-tasks/generate-package-json-for-npm.js index 29dba074c..13acdb4ec 100644 --- a/build-tasks/generate-package-json-for-npm.js +++ b/build-tasks/generate-package-json-for-npm.js @@ -2,9 +2,9 @@ * Creates a package.json file for the npm module */ -const common = require('./common'); +const { readJSON, writeFile } = require('./common/files'); -const basePackageJson = common.readJSON('package.json'); +const basePackageJson = readJSON('package.json'); delete basePackageJson.devDependencies; -common.writeFile('dist/build/package.json', JSON.stringify(basePackageJson, undefined, 2)); +writeFile('dist/build/package.json', JSON.stringify(basePackageJson, undefined, 2)); diff --git a/build-tasks/generate-recommendations.js b/build-tasks/generate-recommendations.js index 6e8595edc..4caed15c9 100644 --- a/build-tasks/generate-recommendations.js +++ b/build-tasks/generate-recommendations.js @@ -2,14 +2,15 @@ * Generates the recommended_ruleset.js file. */ -const common = require('./common'); +const { writeFile } = require('./common/files'); +const { getAllRules, getMetadataFromFile, getMetadataValue } = require('./common/meta'); const groupedRows = {}; const warnings = []; -common.getAllRules().forEach(ruleFile => { - const metadata = common.getMetadataFromFile(ruleFile); +getAllRules().forEach(ruleFile => { + const metadata = getMetadataFromFile(ruleFile); - const groupName = common.getMetadataValue(metadata, 'group'); + const groupName = getMetadataValue(metadata, 'group'); if (groupName === 'Ignored') { return; } @@ -20,11 +21,11 @@ common.getAllRules().forEach(ruleFile => { groupedRows[groupName] = []; } - let recommendation = common.getMetadataValue(metadata, 'recommendation', true, true); + let recommendation = getMetadataValue(metadata, 'recommendation', true, true); if (recommendation === '') { recommendation = 'true,'; } - const ruleName = common.getMetadataValue(metadata, 'ruleName'); + const ruleName = getMetadataValue(metadata, 'ruleName'); groupedRows[groupName].push(` "${ruleName}": ${recommendation}`); }); @@ -37,4 +38,4 @@ Object.keys(groupedRows).forEach(groupName => groupedRows[groupName].sort()); const recommendedTemplate = require('./templates/recommended_ruleset.template'); const data = recommendedTemplate(groupedRows); -common.writeFile('recommended_ruleset.js', data); +writeFile('recommended_ruleset.js', data); diff --git a/build-tasks/generate-rule-metadata.js b/build-tasks/generate-rule-metadata.js index 584744e2a..2916bce98 100644 --- a/build-tasks/generate-rule-metadata.js +++ b/build-tasks/generate-rule-metadata.js @@ -2,12 +2,13 @@ * Generates rule-metadata.json which contains a json array of all rule metadata. */ -const common = require('./common'); +const { writeFile } = require('./common/files'); +const { getAllRules, getMetadataFromFile } = require('./common/meta'); const allMetadata = []; -common.getAllRules().forEach(ruleFile => { - const metadata = common.getMetadataFromFile(ruleFile); +getAllRules().forEach(ruleFile => { + const metadata = getMetadataFromFile(ruleFile); allMetadata.push(metadata); }); -common.writeFile('rule-metadata.json', JSON.stringify(allMetadata, undefined, 2)); +writeFile('rule-metadata.json', JSON.stringify(allMetadata, undefined, 2)); diff --git a/build-tasks/generate-sdl-report.js b/build-tasks/generate-sdl-report.js index 25f4a5b12..1210f5f34 100644 --- a/build-tasks/generate-sdl-report.js +++ b/build-tasks/generate-sdl-report.js @@ -2,37 +2,52 @@ * Generates an SDL report in csv format. */ -const common = require('./common'); +const { readJSON, writeFile } = require('./common/files'); +const { getAllRules, getMetadataFromFile, getMetadataValue } = require('./common/meta'); +const allCweDescriptions = readJSON('cwe_descriptions.json'); const rows = []; const resolution = 'See description on the tslint or tslint-microsoft-contrib website'; const procedure = 'TSLint Procedure'; const header = 'Title,Description,ErrorID,Tool,IssueClass,IssueType,SDL Bug Bar Severity,' + 'SDL Level,Resolution,SDL Procedure,CWE,CWE Description'; -common.getAllRules().forEach(ruleFile => { - const metadata = common.getMetadataFromFile(ruleFile); +getAllRules().forEach(ruleFile => { + const metadata = getMetadataFromFile(ruleFile); - const issueClass = common.getMetadataValue(metadata, 'issueClass'); + const issueClass = getMetadataValue(metadata, 'issueClass'); if (issueClass === 'Ignored') { return; } - const ruleName = common.getMetadataValue(metadata, 'ruleName'); + const ruleName = getMetadataValue(metadata, 'ruleName'); const errorId = 'TSLINT' + getHash(ruleName); - const issueType = common.getMetadataValue(metadata, 'issueType'); - const severity = common.getMetadataValue(metadata, 'severity'); - const level = common.getMetadataValue(metadata, 'level'); - const description = common.getMetadataValue(metadata, 'description'); - const cwe = common.getMetadataValue(metadata, 'commonWeaknessEnumeration', true, false); + const issueType = getMetadataValue(metadata, 'issueType'); + const severity = getMetadataValue(metadata, 'severity'); + const level = getMetadataValue(metadata, 'level'); + const description = getMetadataValue(metadata, 'description'); + const cwe = getMetadataValue(metadata, 'commonWeaknessEnumeration', true, false); const cweDescription = createCweDescription(metadata); - const row = `${ruleName},${description},${errorId},tslint,${issueClass},${issueType},${severity},${level},${resolution},${procedure},${cwe},${cweDescription}`; + const row = [ + ruleName, + description, + errorId, + 'tslint', + issueClass, + issueType, + severity, + level, + resolution, + procedure, + cwe, + cweDescription + ].join(','); rows.push(row); }); rows.sort(); rows.unshift(header); -common.writeFile('tslint-warnings.csv', rows.join('\n')); +writeFile('tslint-warnings.csv', rows.join('\n')); function getHash(input) { // initialized with a prime number @@ -47,9 +62,7 @@ function getHash(input) { } function createCweDescription(metadata) { - const allCweDescriptions = common.readJSON('cwe_descriptions.json'); - - const cwe = common.getMetadataValue(metadata, 'commonWeaknessEnumeration', true, true); + const cwe = getMetadataValue(metadata, 'commonWeaknessEnumeration', true, true); if (cwe === '') { return ''; } @@ -68,7 +81,7 @@ function createCweDescription(metadata) { result = result + `CWE ${cweNumber} - ${description}`; }); if (result !== '') { - return '"' + result + '"'; + return `"${result}"`; } return result; } diff --git a/build-tasks/validate-config.js b/build-tasks/validate-config.js index 5bc716181..170c09dbe 100644 --- a/build-tasks/validate-config.js +++ b/build-tasks/validate-config.js @@ -2,9 +2,10 @@ * Makes sure all the rules in the project are defined to run during the build. */ -const common = require('./common'); +const { readJSON } = require('./common/files'); +const { getAllRuleNames } = require('./common/meta'); -const tslintConfig = common.readJSON('tslint.json'); +const tslintConfig = readJSON('tslint.json'); const rulesToSkip = new Set([ 'align', // no need @@ -44,7 +45,7 @@ const rulesToSkip = new Set([ ]); const errors = []; -common.getAllRuleNames().forEach(ruleName => { +getAllRuleNames().forEach(ruleName => { if (rulesToSkip.has(ruleName)) { return; } diff --git a/build-tasks/validate-documentation.js b/build-tasks/validate-documentation.js index f529a4fa4..97a102670 100644 --- a/build-tasks/validate-documentation.js +++ b/build-tasks/validate-documentation.js @@ -3,19 +3,20 @@ * and validates that the package.json version is the same version defined in README.md. */ -const common = require('./common'); +const { readFile, readJSON } = require('./common/files'); +const { getAllFormatterNames, getAllRuleNames } = require('./common/meta'); -const readmeText = common.readFile('README.md'); -const packageJson = common.readJSON('package.json'); +const readmeText = readFile('README.md'); +const packageJson = readJSON('package.json'); const validationErrors = []; -common.getAllRuleNames({ skipTsLintRules: true }).forEach(ruleName => { +getAllRuleNames({ skipTsLintRules: true }).forEach(ruleName => { if (readmeText.indexOf(ruleName) === -1) { validationErrors.push('A rule was found that is not documented in README.md: ' + ruleName); } }); -common.getAllFormatterNames().forEach(formatterName => { +getAllFormatterNames().forEach(formatterName => { if (readmeText.indexOf(formatterName) === -1) { validationErrors.push('A formatter was found that is not documented in README.md: ' + formatterName); validationFailed = true; From a145cdc70f29bb943d75fbc3e504dd04ca84475f Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Sat, 27 Oct 2018 00:37:29 +0300 Subject: [PATCH 14/15] Remove unnecessary test-data compilation --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index f6329a5c7..4812ac343 100644 --- a/package.json +++ b/package.json @@ -52,9 +52,8 @@ "start": "tsc --watch", "test:mocha": "mocha \"dist/src/tests/**/*.js\"", "test:rules": "tslint -r dist/src --test \"tests/**\"", - "test": "npm-run-all clean copy:json tsc:* test:* lint:* validate:* copy:package copy:meta generate:*", + "test": "npm-run-all clean copy:json tsc:src test:* lint:* validate:* copy:package copy:meta generate:*", "tsc:src": "tsc", - "tsc:test-data": "tsc -p test-data", "validate:config": "node build-tasks/validate-config.js", "validate:documentation": "node build-tasks/validate-documentation.js" }, From 36ac80f140384bb00680c198e316600b0a7241cf Mon Sep 17 00:00:00 2001 From: IllusionMH Date: Sat, 27 Oct 2018 02:00:46 +0300 Subject: [PATCH 15/15] Return colorful outpur for errors. Format template literals --- build-tasks/common/files.js | 7 ++++--- build-tasks/common/meta.js | 10 +++++----- build-tasks/create-rule.js | 9 +++++---- build-tasks/generate-recommendations.js | 5 +++-- build-tasks/generate-sdl-report.js | 7 ++++--- build-tasks/validate-config.js | 3 ++- build-tasks/validate-documentation.js | 3 ++- package.json | 1 + 8 files changed, 26 insertions(+), 19 deletions(-) diff --git a/build-tasks/common/files.js b/build-tasks/common/files.js index a38f89ab8..8988a0479 100644 --- a/build-tasks/common/files.js +++ b/build-tasks/common/files.js @@ -1,10 +1,11 @@ const fs = require('fs'); +const { red } = require('chalk'); function readFile(fileName) { try { return fs.readFileSync(fileName, { encoding: 'utf8' }); } catch (e) { - console.error(`Unable to read file: ${ fileName }. Error code: ${ e.code }`); + console.log(red(`Unable to read file: ${ fileName }. Error code: ${ e.code }`)); process.exit(1); } } @@ -13,7 +14,7 @@ function writeFile(fileName, data) { try { return fs.writeFileSync(fileName, data, { encoding: 'utf8' }); } catch (e) { - console.error(`Unable to write file: ${ fileName }. Error code: ${ e.code }`); + console.log(red(`Unable to write file: ${ fileName }. Error code: ${ e.code }`)); process.exit(1); } } @@ -22,7 +23,7 @@ function readJSON(fileName) { try { return JSON.parse(readFile(fileName)); } catch (e) { - console.error(`Unable to parse JSON file: ${ fileName }.`, e); + console.log(red(`Unable to parse JSON file: ${ fileName }. \n ${ e }`)); process.exit(1); } } diff --git a/build-tasks/common/meta.js b/build-tasks/common/meta.js index 8f8f96e0b..7b8c477c3 100644 --- a/build-tasks/common/meta.js +++ b/build-tasks/common/meta.js @@ -1,6 +1,6 @@ const path = require('path'); const glob = require('glob'); -const {readJSON} = require('./files'); +const { readJSON } = require('./files'); function getAllRules() { const contribRules = glob.sync('dist/build/*Rule.js'); @@ -13,8 +13,8 @@ function getMetadataFromFile(ruleFile) { const moduleName = path.resolve(ruleFile.replace(/\.js$/, '')); const module = require(moduleName); if (module.Rule.metadata === undefined) { - console.warn('No metadata found for ' + moduleName); - return; + console.log(red('No metadata found for ' + moduleName)); + process.exit(1); } return module.Rule.metadata; } @@ -27,7 +27,7 @@ function getMetadataValue(metadata, name, allowEmpty, doNotEscape) { if (value === undefined) { if (additionalMetadata[metadata.ruleName] === undefined) { if (allowEmpty === false) { - console.warn(`Could not read metadata for rule ${metadata.ruleName} from additional_rule_metadata.json`); + console.log(red(`Could not read metadata for rule ${ metadata.ruleName } from additional_rule_metadata.json`)); process.exit(1); } else { return ''; @@ -36,7 +36,7 @@ function getMetadataValue(metadata, name, allowEmpty, doNotEscape) { value = additionalMetadata[metadata.ruleName][name]; if (value === undefined) { if (allowEmpty === false) { - console.warn(`Could not read attribute ${name} of rule ${metadata.ruleName}`); + console.log(red(`Could not read attribute ${ name } of rule ${ metadata.ruleName }`)); process.exit(1); } return ''; diff --git a/build-tasks/create-rule.js b/build-tasks/create-rule.js index 444b0e4b0..2d511eb54 100644 --- a/build-tasks/create-rule.js +++ b/build-tasks/create-rule.js @@ -1,7 +1,9 @@ -const { readJSON, writeFile } = require('./common/files'); const fs = require('fs'); +const { red } = require('chalk'); +const { readJSON, writeFile } = require('./common/files'); const ruleName = getRuleName(); +validateAguments(); const ruleFile = camelCase(ruleName) + 'Rule'; const sourceFileName = 'src/' + ruleFile + '.ts'; @@ -9,7 +11,6 @@ const testsFolder = 'tests/' + ruleName; const testFile = testsFolder + '/test.ts.lint'; const lintFile = testsFolder + '/tslint.json'; -validateAguments(); createImplementationFile(); createTestFiles(); addToConfig(); @@ -36,12 +37,12 @@ function validateAguments() { const USAGE_EXAMPLE = '\nUsage example:\nnpm run create-rule -- --rule-name=no-something-or-other\n'; if (!ruleName) { - console.log('--rule-name parameter is required.' + USAGE_EXAMPLE); + console.log(red('--rule-name parameter is required.' + USAGE_EXAMPLE)); process.exit(1); } if (!/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(ruleName)) { - console.log('Rule name should consist of lowercase letters and numbers separated with "-" character.' + USAGE_EXAMPLE); + console.log(red('Rule name should consist of lowercase letters and numbers separated with "-" character.' + USAGE_EXAMPLE)); process.exit(1); } } diff --git a/build-tasks/generate-recommendations.js b/build-tasks/generate-recommendations.js index 4caed15c9..9283d967a 100644 --- a/build-tasks/generate-recommendations.js +++ b/build-tasks/generate-recommendations.js @@ -2,6 +2,7 @@ * Generates the recommended_ruleset.js file. */ +const { red } = require('chalk'); const { writeFile } = require('./common/files'); const { getAllRules, getMetadataFromFile, getMetadataValue } = require('./common/meta'); const groupedRows = {}; @@ -26,11 +27,11 @@ getAllRules().forEach(ruleFile => { recommendation = 'true,'; } const ruleName = getMetadataValue(metadata, 'ruleName'); - groupedRows[groupName].push(` "${ruleName}": ${recommendation}`); + groupedRows[groupName].push(` "${ ruleName }": ${ recommendation }`); }); if (warnings.length > 0) { - console.warn('\n' + warnings.join('\n')); + console.log('\n' + red(warnings.join('\n'))); process.exit(1); } Object.keys(groupedRows).forEach(groupName => groupedRows[groupName].sort()); diff --git a/build-tasks/generate-sdl-report.js b/build-tasks/generate-sdl-report.js index 1210f5f34..d733b4214 100644 --- a/build-tasks/generate-sdl-report.js +++ b/build-tasks/generate-sdl-report.js @@ -2,6 +2,7 @@ * Generates an SDL report in csv format. */ +const { red } = require('chalk'); const { readJSON, writeFile } = require('./common/files'); const { getAllRules, getMetadataFromFile, getMetadataValue } = require('./common/meta'); const allCweDescriptions = readJSON('cwe_descriptions.json'); @@ -72,16 +73,16 @@ function createCweDescription(metadata) { cweNumber = cweNumber.trim(); const description = allCweDescriptions[cweNumber]; if (description === undefined) { - console.warn(`Cannot find description of ${cweNumber} for rule ${metadata.ruleName} in cwe_descriptions.json`); + console.log(red(`Cannot find description of ${ cweNumber } for rule ${ metadata.ruleName } in cwe_descriptions.json`)); process.exit(1); } if (result !== '') { result = result + '\n'; } - result = result + `CWE ${cweNumber} - ${description}`; + result = result + `CWE ${ cweNumber } - ${ description }`; }); if (result !== '') { - return `"${result}"`; + return `"${ result }"`; } return result; } diff --git a/build-tasks/validate-config.js b/build-tasks/validate-config.js index 170c09dbe..1a6f86993 100644 --- a/build-tasks/validate-config.js +++ b/build-tasks/validate-config.js @@ -2,6 +2,7 @@ * Makes sure all the rules in the project are defined to run during the build. */ +const { yellowBright } = require('chalk'); const { readJSON } = require('./common/files'); const { getAllRuleNames } = require('./common/meta'); @@ -57,6 +58,6 @@ getAllRuleNames().forEach(ruleName => { }); if (errors.length > 0) { - console.warn(errors.join('\n')); + console.log(yellowBright(errors.join('\n'))); process.exit(1); } diff --git a/build-tasks/validate-documentation.js b/build-tasks/validate-documentation.js index 97a102670..b674de604 100644 --- a/build-tasks/validate-documentation.js +++ b/build-tasks/validate-documentation.js @@ -3,6 +3,7 @@ * and validates that the package.json version is the same version defined in README.md. */ +const { yellowBright } = require('chalk'); const { readFile, readJSON } = require('./common/files'); const { getAllFormatterNames, getAllRuleNames } = require('./common/meta'); @@ -30,6 +31,6 @@ if (readmeText.indexOf('[npm-' + packageJson.version + ']') === -1) { } if (validationErrors.length > 0) { - console.warn(validationErrors.join('\n')); + console.log(yellowBright(validationErrors.join('\n'))); process.exit(1); } diff --git a/package.json b/package.json index 4812ac343..bc48b3822 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ }, "devDependencies": { "chai": "4.2.0", + "chalk": "^2.4.1", "cpy-cli": "^2.0.0", "glob": "^7.1.3", "mocha": "5.2.0",