andreogle / eslint-teamcity Goto Github PK
View Code? Open in Web Editor NEWA (now deprecated) ESLint formatter plugin for TeamCity. Use eslint-formatter-teamcity instead
License: MIT License
A (now deprecated) ESLint formatter plugin for TeamCity. Use eslint-formatter-teamcity instead
License: MIT License
See title
Would it be possible to have this formatter only run if actually running on TeamCity?
I've seen that the jest teamcity reporter does something like this:
const onTeamCity = 'TEAMCITY_VERSION' in process.env;
if(onTeamCity){
// work the magic
} else {
// pass to default reporter?
// require('eslint/lib/formatters/stylish')
}
What do you think?
eslint-teamcity version: 2.2.0
for example
[00:04:08]##teamcity[inspection typeId='prettier/prettier' message='line 14, col 1, Insert `|0x00b7|0x00b7`' file='src/utils/respondWithBoards.js' line='14' SEVERITY='ERROR']
or
##teamcity[inspection typeId='prettier/prettier' message='line 8, col 1, Replace `|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7R.pipe(|0x23ce|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7R.dissoc("_id"),|0x23ce|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7R.dissoc("plant"),` with `|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7|0x00b7R.pipe(R.dissoc("_id"),|0x00b7R.dissoc("plant"),|0x00b7doc|0x00b7=>`' file='src/utils/respondWithBoards.js' line='8' SEVERITY='ERROR']
which causes lots of failures to parse by teamcity
Hey ho.
According to the EsLint docs for formatters you can use formatters in a more generic way when use the following naming scheme: eslint-formatter-$NAME$
.
What about renaming this package to eslint-formatter-teamcity
, so that it can be used with eslint -f teamcity
.
E.g. for those using Yarn's pnp mode this would be beneficial.
What do you think?
current version group errors in one file to 1 test, and display errors as staktrace of the test.
but it is'nt truthly - if we have different errors in one file we dosn't have new error, because this file(test) was failed in previous build of the branch.
I have been running into this issue on a project that I am working on. When I run this from a scripts in my package.json
"lint-js-teamcity": "eslint . -f node_modules/eslint-html-reporter/reporter-team-city.js -o ESLintReport.html"
It lints everything and produces the html file but it fails right after. Not sure exactly why.
node version: 6.11.0
npm version: 3.10.10
npm ERR! Tell the author that this fails on your system:
npm ERR! eslint . -f node_modules/eslint-html-reporter/reporter-team-city.js -o ESLintReport.html
Hi,
I have implemented this as a build step on teamcity, but the only place that warnings appear to be reported is in the build log.
Do you know how to report the warnings up onto the UI? you show a screenshot with the errors but i cannot tell where that screen is on the UI?
I am using Teamcity 9.1.7.
Thanks for the really useful package, just trying to understand how to utilise the reporting feature.
A further issue i have, is that we do not use a package.json file, only a gulpfile.js to run this, which means we lose the configuration options. Can these be added as command line params? or is there another way to configure the package when it runs? I would like to enable the summary reporting.
This will allow writing just eslint --format teamcity
, see https://eslint.org/docs/developer-guide/working-with-custom-formatters#packaging-the-custom-formatter
https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-Inspectiontype
we may report eslint violations as inspection errors, not tests
If we are use that we must push any new error type as ispection type: example:
##teamcity[inspectionType id='indent' name='' description='' category='eslint']
and then error:
##teamcity[inspection typeId='' message='line 10, col 1, Expected indentation of 0 spaces but found 1. (indent)' file='/temp/anyPath/file.js' line='1' additional attribute='ERROR']
The package is generating the output:
##teamcity[inspectionType id='' category='ESLint Violations' name='' description='ESLint Violations']
##teamcity[inspection typeId='' message='line 84, col 18, Parsing error: Unexpected token i' file='MyFile.js' line='84' SEVERITY='ERROR']
Which is causing teamcity to show the error:
[21:27:46][Step 5/17] Attributes id, name, category, description are required to 'inspectionType' service message
[21:27:46][Step 5/17] Attributes 'typeId' and 'file' are required to 'inspection' service message
The offending code is:
for (let i = 0, length = this.formControlOptions.length; i < length; i++) { }
This code is invalid because our config is set to ES5:
{
"parserOptions": { "ecmaVersion": 5 },
"rules": {
"arrow-body-style": ["error", "never"]
}
}
Would it be possible to add a default Id to avoid this issue please?
P.S. Thanks for creating this package!
Don't think this is an eslint-teamcity issues, but
https://youtrack.jetbrains.com/issue/TW-62998
Wondering if this has ever been seen before?
I'm getting no file details in my "inspections report" on my Windows TC instance.
The reason is that the file paths are emitted incorrectly. They need to be slashes also on Windows.
Note: The TSLint version of this reporter had already the same issue: ThaNarie/tslint-teamcity-reporter#10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.