-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate with ESLint #45
Comments
Challenges
Proposal
PS: I'm sorry if this sounds too harsh, but I've spoken to multiple SAP developers working on real projects, and nobody could understand why or see the value in this new linting tool... |
I think this is a big misunderstanding. For sure, ESLint is the 1st choice for linting JavaScript / TypeScript and its other derivates. The UI5 linter doesn't want to replace ESLint. It therefore won't get rules that exist already in ESLint or better could be added there (the linter's repository might in fact become the home for such rules / for a UI5 specific ESLint plugin, should we decide to implement it).. And yes, the UI5 linter contains several custom parsers. But that's not the point. There's one big difference to ESLint rules and @RandomByte already explained it above. To reliably find usages of deprecated APIs, it's not sufficient to scan a local AST as ESLint rules do. You have to build up a project-wide understanding of types to judge whether a For sure, we could find ways to bypass this, creating a project view on our own and accessing it from within our rules. But that's a substantial development effort (I'll come to this in a second). And there's no guarantee that such an approach then will survive a major version update of ESLint (multi threaded execution of rules which works well with isolated AST-visiting rules, but obviously adds additional effort for shared project information). If ESLint doesn't provide a way to maintain a project view, we're at risk that our workaround doesn't work anymore. Reg. the effort: one of the major requirements for the UI5 linter was a quick availability. That's why substantial development efforts was not so weird as a counter argument from our point of view. We therefore decided not to re-invent the wheel and rather integrate with the TypeScript compiler. You might argue that we at least could integrate all those checks that can be implemented on a per-file base as ESLint rules. That's true, but at least currently we think it's more beneficial for UI5 developers if a single tool helps them to identify UI5 specific potential for improvement in their code. Last but not least, if we later find out that our requirements regarding the code scans are fufilled by a newer ESLint version, we will check if / how we can integrate into it. Again, UI5 linter isn't there to replace ESLint, it's rather an addition (additional tool). Maybe, from that point of view, the name choice was a bit misleading (it's rather a UI5 deprecation and best practice checker). But we thought that the term "linter" is so familiar to developers that it's the best choice to explain the purpose of the tool. |
Requirement
Provide an ESLint plugin to easily integrate UI5 linter checks into existing development workflows.
Challenges
Or why this was not our initial design goal
manifest.json
orui5.yaml
, we would need to provide a set of custom processors or even a custom parsertypescript
(required for linting and transpilation), while typescript-eslint requires projects to define the dependency themselvesProposal
ui5lint
should just work for the majority of today's UI5 projects. Projects should typically not need to be modifiedThe text was updated successfully, but these errors were encountered: