{"_id":"@cfi2017/tslint-teamcity-reporter","_rev":"1-d662b9dbb2c6afa721d4aed4ac783934","name":"@cfi2017/tslint-teamcity-reporter","dist-tags":{"latest":"3.2.6"},"versions":{"3.2.6":{"name":"@cfi2017/tslint-teamcity-reporter","version":"3.2.6","description":"A TSLint formatter/reporter for use in TeamCity which groups by files using TeamCity Test Suite","main":"./index.js","types":"./index.d.ts","scripts":{"prepublishOnly":"npm-run-all -s validate build","validate":"npm-run-all -p lint test","dev":"npm-run-all -p dev:*","dev:babel":"babel ./src -x \".ts\" --out-dir ./ --watch","dev:ts":"tsc --noEmit --allowJs --watch","build":"npm-run-all -s clean build:*","build:babel":"babel ./src -x \".ts\" -x \".js\" --out-dir ./","build:ts":"tsc -p ./tsconfig.build.json","test":"cross-env NODE_ENV=test nyc --all mocha \"./test/**/*.spec.{ts,js}\"","test:dev":"mocha -w --watch-extensions ts,js \"./test/**/*.spec.{ts,js}\"","clean":"npm-run-all clean:*","clean:test":"shx rm -rf coverage .nyc_output","clean:npm":"shx rm -rf lib tmp index.js","lint":"npm-run-all lint:*","lint:js":"eslint src --ext .js --cache","lint:ts":"tslint src/**/*.ts -c tslint.json -p tsconfig.json -t verbose","prettify":"prettier --write \"src/**/*.{js,ts,json}\"","precommit":"lint-staged","demo":"tslint test/_fixtures/*.ts -t ./index.js"},"lint-staged":{"linters":{"src/**/*.{js,ts,json}":["prettier --write","git add"],"src/**/*.js":["npm run lint:js"],"src/**/*.ts":["npm run lint:ts"]}},"pre-push":["validate"],"author":{"name":"Arjan van Wijk","email":"thanarie@gmail.com","url":"thanarie"},"homepage":"https://www.thanarie.nl/","license":"MIT","keywords":["tslint","teamcity","reporter","formatter"],"bugs":{"url":"https://github.com/ThaNarie/tslint-teamcity-reporter/issues"},"repository":{"type":"git","url":"https://github.com/ThaNarie/tslint-teamcity-reporter.git"},"devDependencies":{"@babel/cli":"^7.1.5","@babel/core":"^7.1.6","@babel/plugin-proposal-class-properties":"^7.1.0","@babel/plugin-proposal-json-strings":"^7.0.0","@babel/plugin-syntax-dynamic-import":"^7.0.0","@babel/plugin-syntax-import-meta":"^7.0.0","@babel/plugin-transform-runtime":"^7.1.0","@babel/preset-env":"^7.1.6","@babel/preset-stage-3":"^7.0.0","@babel/preset-typescript":"^7.1.0","@babel/register":"^7.0.0","@types/chai":"^4.0.10","@types/mocha":"^2.2.44","@types/node":"^12.7.2","@types/sinon":"^4.1.2","@types/sinon-chai":"^2.7.29","babel-eslint":"^8.0.3","babel-plugin-istanbul":"^4.1.5","chai":"^4.1.2","coveralls":"^2.11.6","cross-env":"^5.1.1","eslint":"^4.13.1","eslint-config-airbnb-base":"^12.1.0","eslint-config-prettier":"^2.9.0","eslint-friendly-formatter":"^3.0.0","eslint-import-resolver-typescript":"^1.0.2","eslint-plugin-chai-friendly":"^0.4.1","eslint-plugin-import":"^2.8.0","eslint-plugin-prettier":"^2.4.0","husky":"^0.14.3","jsdom":"^11.5.1","jsdom-global":"^3.0.2","lint-staged":"^6.0.0","mocha":"^4.0.1","npm-run-all":"^4.1.2","nyc":"^14.1.1","prettier":"^1.9.2","shx":"^0.2.2","sinon":"^4.1.3","sinon-chai":"^2.14.0","tslint":"^5.11.0","tslint-config-airbnb":"^5.4.2","tslint-config-prettier":"^1.6.0","typescript":"^2.6.2"},"dependencies":{"@babel/runtime-corejs2":"^7.1.5"},"licenseText":"Copyright (c) 2018 Tha Narie\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n","_id":"@cfi2017/tslint-teamcity-reporter@3.2.6","dist":{"shasum":"e1beff4b6ff3fdb2cce615aa90deebbae25029fd","integrity":"sha512-kYSjzNnEli4i4pHOVolk+adu+rFV4gD2kUGkM4wIsIWiPJOp//wu03eYjknotulAQDw7a5lvUZ3Gi7974+4tNg==","tarball":"https://registry.npmjs.org/@cfi2017/tslint-teamcity-reporter/-/tslint-teamcity-reporter-3.2.6.tgz","fileCount":19,"unpackedSize":28322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZSLlCRA9TVsSAnZWagAAT/MP/3002LZg4mp+cqu71Ot3\nrjDLC/FD4M2k5VP0m+sH6o5kBYAoFI3EVDVNX6IE1d72HWwPuNRRwd+hfNey\nqhHZ7lRGXG5EoQn5TNG9N7FWoA9/o9ceXnbthiFsupfkFEvJ16NYijN+jv+a\ndTQLpifw3zp/QZNUDmBrrsg//p/D5RYU5CQhgrB4ZW6reI3fJWWCIvtl/kuK\nVN2WaNPBUAD7TzhsuE4e9qp2ArGzItHGY7BiR+kQ2hBMP06BCExea/fuRAcZ\nQjRkFj8khtzO2aaSGYu8yLCtKSvzfac0CdNk65arb1v9ldrfLumyPfz0Zd+y\n4h6loxqdhwq8U97BkDPIZOKSLjOsr3sFlHC9k4mUsKlHzL4bjfkzu+S8P7FR\nmLFzwOGoDG9HaY8JBQQ89oqrDxuloLQCSJoRLHEozBO+tW6tNeM3TA+hxFod\nZxSvWsbo4XA3lsjxj+jUDVeJZEF0cTHSKCdaM1BAN1Fk4OwGLd4j6EVf28hw\nfB+bQYzPZkLHWRUW9TKR75tInR+Sw7c9GRjFdE7Rey81EfdjyAFEWmgxa6ON\nyJSY59l2Uq9d5V/SMGmQaLfumfDLhsFSYK97ZoJT51XnQ5GLd5ynqtTr5Jcb\nYwj62GRWaygmIjFN5rBFrL+iAEBoi3giww0YUVvgltnS2IGj6uM7iIo1MDvf\nxVGu\r\n=XKMp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/2IWmewXBP3HOjvKmxH9bxsTw8s7Hyv7hqpJsye1NAAiBBYlOB8nYMaP7H2iYdcmCjGzUsxPyHr5HIW+vQRDkSGg=="}]},"maintainers":[{"name":"cfi2017","email":"carlo@swiss.dev"}],"_npmUser":{"name":"cfi2017","email":"carlo@swiss.dev"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tslint-teamcity-reporter_3.2.6_1566909156366_0.8974881182133938"},"_hasShrinkwrap":false}},"time":{"created":"2019-08-27T12:32:36.146Z","3.2.6":"2019-08-27T12:32:36.512Z","modified":"2022-04-04T22:23:42.190Z"},"maintainers":[{"name":"cfi2017","email":"carlo@swiss.dev"}],"description":"A TSLint formatter/reporter for use in TeamCity which groups by files using TeamCity Test Suite","homepage":"https://www.thanarie.nl/","keywords":["tslint","teamcity","reporter","formatter"],"repository":{"type":"git","url":"https://github.com/ThaNarie/tslint-teamcity-reporter.git"},"author":{"name":"Arjan van Wijk","email":"thanarie@gmail.com","url":"thanarie"},"bugs":{"url":"https://github.com/ThaNarie/tslint-teamcity-reporter/issues"},"license":"MIT","readme":"# tslint-teamcity-reporter\n\nA TSLint formatter/reporter for use in TeamCity which groups by files using TeamCity Test Suite\n\n**Note: v3.0.0 is completely rewritten to keep it more maintainable\n(borrowing from [eslint-teamcity](https://github.com/andreogle/eslint-teamcity) and [tslint](https://github.com/palantir/tslint/) internal tests),\nand will be a breaking change to your configuration and output.**\n\n#### Changes\n\n* From the CLI, the formatter can now be specified as `-t ./node_modules/tslint-teamcity-reporter/index.js`\n* The lint errors reported as tests are now grouped by file\n  * This means that on the top-level, you only see failed files, not individual errors\n  * The individual errors are now displayed as error output for each file\n  * This means that the 'failed test count' will drop significantly, please take into account in your overall metrics\n  * If you liked the old approach better, please let me know in a ticket, and I can add it back as an option\n* Warnings are now treated as such, will show up in the logs and at the bottom of a failed test\n\n## Installation\n\n```sh\nyarn add tslint-teamcity-reporter\n```\n\n```sh\nnpm i -D tslint-teamcity-reporter\n```\n\n## Usage\n\nUse it with:\n\n#### TSLint CLI\n\n```\ntslint files/**/*.ts -t ./node_modules/tslint-teamcity-reporter/index.js\n```\n\n#### grunt-tslint\n\n```js\nmodule.exports = grunt => {\n  grunt.loadNpmTasks('grunt-tslint');\n\n  grunt.initConfig({\n    tslint: {\n      options: {\n        configuration: './tslint.json',\n        formatter: 'tslint-teamcity-reporter',\n      },\n      files: {\n        src: ['**/*.ts'],\n      },\n    },\n  });\n\n  grunt.registerTask('default', ['tslint']);\n};\n\n```\n\n#### gulp-tslint\n\n```js\nconst gulp = require('gulp');\nconst tslint = require('gulp-tslint');\n\ngulp.task('tslint', () =>\n  gulp\n    .src('**/*.ts')\n    .pipe(\n      tslint({\n        configuration: './tslint.json',\n        formatter: 'tslint-teamcity-reporter',\n        formattersDirectory: 'anything-but-falsy', // passing a falsy value will resolve in `null` and throw an error in tslint\n      }),\n    )\n    .pipe(tslint.report()),\n);\n\ngulp.task('default', ['tslint']);\n```\n\n### Configuration\n\nThere are several ways that you can configure tslint-teamcity.\nYou don't have to configure anything by default, you just have the option to if you would like.\nSettings are looked for in the following priority:\n\n#### 1. As a second argument\nIf you run tslint-teamcity-reporter by requiring it in your code, you can pass a second argument to the function:\n```js\nimport { Formatter } from 'tslint-teamcity-reporter';\n\nconst formatter = new Formatter();\nconst options = {\n  reporter: 'inspections',\n  reportName: 'My TSLint Violations',\n  errorStatisticsName: 'My TSLint Error Count',\n  warningStatisticsName: 'My TSLint Warning Count',\n};\nconsole.log(formatter.format(tslintFailures, options));\n```\n\n#### 2. From your package.json\nIf you have a package.json file in the current directory, you can add an extra \"tslint-teamcity-reporter\" property to it:\n\n```json\n{\n  \"tslint-teamcity-reporter\": {\n    \"reporter\": \"inspections\",\n    \"report-name\": \"My TSLint Violations\",\n    \"error-statistics-name\": \"My TSLint Error Count\",\n    \"warning-statistics-name\": \"My TSLint Warning Count\"\n  }\n}\n```\n\n#### 3. ENV variables\n\n```sh\nexport TSLINT_TEAMCITY_REPORTER=\"inspections\"\nexport TSLINT_TEAMCITY_REPORT_NAME=\"My Formatting Problems\"\nexport TSLINT_TEAMCITY_ERROR_STATISTICS_NAME=\"My Error Count\"\nexport TSLINT_TEAMCITY_WARNING_STATISTICS_NAME=\"My Warning Count\"\n```\n\nYou can also output your current settings to the log if you set:\n\n```sh\nexport TSLINT_TEAMCITY_DISPLAY_CONFIG=true\n```\n\n#### Output type\nBy default, the output is displayed as tests on a TeamCity build (`\"reporter\": \"errors\"`). You can change it to be displayed as \"Inspections\" in a separate tab by setting the `\"reporter\": \"inspections\"` option.\n\n\n## Building\n\nIn order to build tslint-teamcity-reporter, ensure that you have [Git](http://git-scm.com/downloads)\nand [Node.js](http://nodejs.org/) installed.\n\nClone a copy of the repo:\n```sh\ngit clone https://github.com/ThaNarie/tslint-teamcity-reporter.git\n```\n\nChange to the tslint-teamcity-reporter directory:\n```sh\ncd tslint-teamcity-reporter\n```\n\nInstall dev dependencies:\n```sh\nyarn\n```\n\nUse one of the following main scripts:\n```sh\nyarn build            # build this project\nyarn dev              # run compilers in watch mode, both for babel and typescript\nyarn test             # run the unit tests incl coverage\nyarn test:dev         # run the unit tests in watch mode\nyarn lint             # run eslint and tslint on this project\n```\n\nWhen installing this module, it adds a pre-commit hook, that runs lint and prettier commands\nbefore committing, so you can be sure that everything checks out.\n\n\n## Contribute\n\nView [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n\n## LICENSE\n\nThanks to [eslint-teamcity](https://github.com/andreogle/eslint-teamcity), [jshint-teamcity](https://github.com/hongymagic/jshint-teamcity) and [tslint](https://github.com/palantir/tslint/).\n\n[MIT](./LICENSE) © Tha Narie\n\n\n","readmeFilename":"README.md"}