SAP / ui5-linter

A static code analysis tool for UI5
Apache License 2.0
39 stars 0 forks source link

Option to use a different yaml file #144

Open marianfoo opened 3 weeks ago

marianfoo commented 3 weeks ago

Is your feature request related to a problem? Please describe.

I´d like to run the ui5-linter for my Component. Out of the box this does not work because of the type: module in my ui5.yaml file. Because of this i think this is more a feature request then bug.

Recreate the problem:

git clone https://github.com/spreadsheetimporter/ui5-cc-spreadsheetimporter
cd packages/ui5-cc-spreadsheetimporter
ui5lint

Output when i run ui5lint:


⚠️  Process Failed With Error

Error Message:
Projects of type module have more than one source path

Error comes from https://github.com/SAP/ui5-project/blob/a085232514ebdd8ad11f5fd49323b0c0bb5c240b/lib/specifications/types/Module.js#L31

Describe the solution you'd like

I use the middleware ui5-middleware-ui5 to use the Component in my UI5 App, so use a special yaml file for this anyway ui5-serve.yaml change the type to application.

Most simple solution would that there would be a option so i can use the ui5-serve.yaml instead of the default ui5.yaml. I did not see the option in the cli yet. Something like ui5lint --configFile ui5-serve.yaml

Additional context

I think i need to change my type in the ui5.yaml anyway, because application fits better to my project, right? Either way, a option to change the default yaml file would be great

RandomByte commented 3 weeks ago

This is a very reasonable enhancement.

We could also add support for projects of type module. But from what I can see this still wouldn't help you since your ui5.yaml only refers to the build result and not the sources (which you would probably want to lint).

I think i need to change my type in the ui5.yaml anyway, because application fits better to my project, right?

I think this is yet another case where the Component type would be a good fit: https://github.com/SAP/ui5-tooling/issues/45

Thanks for reporting!

marianfoo commented 3 weeks ago

Thank you for confirming the enhancement.

I know the issue and just now remember what I wanted to ask you at UI5con: When is the Component Type coming? 😃 Would be perfect for 4.0 😉

RandomByte commented 3 weeks ago

See https://github.com/SAP/ui5-tooling/issues/45#issuecomment-2152106687 😉

marianfoo commented 3 weeks ago

See SAP/ui5-tooling#45 (comment) 😉

Would be great to see it in 4.X :) If you need any help or testing this feature just shout out

matz3 commented 3 weeks ago

Internal reference: CPOUI5FOUNDATION-855