ui5-community / generator-ui5-project

Generator for UI5-based web-apps which use the official UI5 tooling and support multiple deployment targets such as the SAP Business Technology Platform
Apache License 2.0
33 stars 25 forks source link

eslint always looks for "xml", even if oConfig.viewtype=="JSON" #33

Closed nicoschoenteich closed 2 years ago

nicoschoenteich commented 2 years ago

Easy-Ui5 version:

Node.js: v16.9.1 yeoman-environment: 3.9.1 generator-easy-ui5: 3.2.1 home: /Users/i533499/Documents/coding/generator-easy-ui5 pluginsHome: /Users/i533499/Documents/coding/generator-easy-ui5/plugin-generators Available generators:

Steps to reproduce the problem:

  1. Run yo easy-ui5 project
  2. Create a new app
  3. Select JSON as view type

What is the expected result?

lint-fix should run smoothly after installation.

What happens instead?

Screenshot 2022-02-11 at 10 54 49

This is related to @lboehm's PR a few weeks ago. eslint specifically looks for xml. I guess we should look for a different pattern or make this dependent on oConfig.viewtype.

vobu commented 2 years ago

just .02€: is it really worth any effort to support json view types? they should go away asap anyway 😸

nicoschoenteich commented 2 years ago

Good point, I won't be the one making the call here but I don't disagree 😉

wridgeu commented 2 years ago

just .02€: is it really worth any effort to support json view types? they should go away asap anyway 😸

I agree. With all the best practices / guidance out there what one should use or what would be best. And the generator trying to be part of this guiding force i.e. https://github.com/ui5-community/generator-ui5-project/issues/21. I don't think supporting every possible use-case, especially going against these "best practices", is a good thing. Could also be 'annoying' in regards to maintainability in the long run (maybe, possibly ... ^^).

On the other hand ... it's possible to use json views and therefore part of UI5 ... so ... yeah, my .01€ 😅

nicoschoenteich commented 2 years ago

@petermuessig What's your take on this? Should we remove JSON views altogether? Or should we keep supporting them? Or something in between?

petermuessig commented 2 years ago

The default should be the XMLViews IMO.

But the error of lint can also be supressed by adding a command line option: https://eslint.org/docs/user-guide/command-line-interface#--no-error-on-unmatched-pattern

--no-error-on-unmatched-pattern

This is what I would suggest to fix immediately to add this parameter to the eslint execution and as a second step, the default should become XMLViews and JSONViews can be seen as optional.