Improvements for linting with nx run-many and outputFile #8769
dennisluitwieler
started this conversation in
Feature Requests
Replies: 2 comments 8 replies
-
Beta Was this translation helpful? Give feedback.
6 replies
-
Has anyone found a solution that avoids editing each configuration file individually, or did NX make this possible since this discussion was opened 🙂? We're currently managing around 250 libraries. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a suggestion for an improvement on using nx run-many for linting.
When you run lint with an outputFile, every module keeps overwriting the same outputfile, so you end up with the result of the last library being processed. For example:
nx run-many --all --target=lint --outputFile=./output.json --format=json
Possible improvements:
Option 1: Running the linter on multiple projects combines the results of each module into 1 output file (in this case in json format). This would require no change to the command itself, but only to the actual outputFile.
Option 2: The run-many command supports some wildcard or regex option to change the outputFile for each library (for instance having the library name as part of the output filename. This would make it possible for other tooling to combine these files into 1 combined json file. This would require some token or wildcard kind-of support for the outputFile parameter.
Examples:
Example:
nx run-many --all --target=lint --outputDir=./report/ --format=json
Example:
Use case
The output of the linter can be used to feed a complete linter report to static code analysis tools such as SonarQube.
I believe this is a very common usecase that developers keep having to build themselves. At least for us, it is definitely a much needed feature, but our only option at the moment is to create a custom command that dynamically calls the linter for each module with a different output filename and then use some tooling to merge the reports.
It would be awesome if it would be a feature supported by nx.
Beta Was this translation helpful? Give feedback.
All reactions