Closed lucascampelo closed 7 years ago
Hi @lucascampelo,
I'm diving in, i'll let you know.
So i did some tests and the following syntax is indeed not working:
require('sonar-web-frontend-reporters').ES5.Reporters
But for me this one is working:
var SonarWebReporters = require('sonar-web-frontend-reporters/build/reporters');
var sonarWebReporters = new SonarWebReporters('Sonar Web Reporters', {
"eslint": {
"src": "src/**/*.js",
"report": "reports/sonar/eslint.json",
"rulesFile": ".eslintrc"
}
});
sonarWebReporters.launchReporters(function () {
console.log('All reporters have been processed');
});
Great @ValentinGot. For a while, this solution works for me. But the second error quoted on my first comment it's caused by src
option. Seems this options don't accept multiple values like
src: ['src/**/*.js','!src/bower_components/**']
.
My report file size is around 51MB. I'm using a .eslintignore
file too but seems not matching.
Indeed, the src
property don't accept multiple values.
I'm adding the feature right now. It will be available in the next release (3.0.1), this week-end.
For the .eslintignore
, we will investigate, meanwhile you will be able to do your work with the multi-globs feature.
Can you show some demo using SonarWebReporters
?
With ES5 backward compatibility, you will have to do something like that:
var SonarWebReporters = require('sonar-web-frontend-reporters/build/reporters');
var sonarWebReporters = new SonarWebReporters('Sonar Web Reporters', {
"eslint": {
"src": [ "src/**/*.js", "!src/bower_components/**" ],
"report": "reports/sonar/eslint.json",
"rulesFile": ".eslintrc"
}
});
sonarWebReporters.launchReporters(function () {
console.log('All reporters have been processed');
});
This example don't work for me. src
parameter is directly passed to Glob, which require a string, causing an error. After read glob
docs, I'm using something like that:
var SonarWebReporters = require('sonar-web-frontend-reporters/build/reporters');
var sonarWebReporters = new SonarWebReporters('Sonar Web Reporters', {
"eslint": {
"src": "src{/fileone.js,/subfolder/**/*.js}",
"report": "reports/sonar/eslint.json",
"rulesFile": ".eslintrc"
}
});
sonarWebReporters.launchReporters(function () {
console.log('All reporters have been processed');
});
I'm tried to exclude a folder or file, but this feature was removed in v6+.
Thank you for help.
Yep for now the glob parameter is requiring a string, but you will be able to pass an array when i'll publish the 3.0.1.
Released in 3.1.0.
First of all, I would like to thank your job here. This plugins is really good. I'm trying to use v3.0.0 with node v4.5.0 but seems not working as expected. Even using the plugin with backward compatibility (ES5), the following error is displayed:
I've tried using
require('sonar-web-frontend-reporters').ES5.Reporters
orrequire('sonar-web-frontend-reporters/build/reporters)
but both are causing errors. Using this second, the error is another:How to proceed ?