refactor(eslint): switch to new eslint api - #663
Conversation
|
I'm not quite sure what to make of these changes - apologies for phrasing it that way, but it's honest. In addition to removing a bunch of tests and fixtures, you've removed the I'd highly suggest rebasing this branch to major, and then doing only the bare minimum of changes. Also, when making changes that are this sweeping in a collaborative repo, it's important to document (or at least comment on lines in the PR) as to why deletions and changes were made. A PR description should be verbose. As it is, you've got me scratching my head and I don't know why anything in this PR was done, and I'm afraid we can't merge this. Edit: I just realized how many commits went to master and force pushed master back to |
|
Yeah, this went over quite clumsily up until now. It's my first time collaborating on such a large project, which also is a monorepo using At the end of this I'd actually like to bump this package to v9.0.0, as it'll bring with it some changes to the API, which come from moving on from deprecated ESLint APIs to their new equivalents under the hood. Can I already change the version in the Thanks for being so understanding, man! |
|
First off, I really appreciate the effort you've put in on this changeset. Unfortunately you're a bit off target. The changes to the README (not including the fixes like the urls to What I'd recommend is taking a step back and opening a new PR based on this one, which only applies the new API, even if the tests don't pass, and then allow us all to collaborate on a resolution so we can keep the tests in place. From there, we can work on updating the README appropriately. I think on this one you fell into the age-old trap of trying to do too much in a single iteration, something we're all guilty of from time to time regardless of experience. |
|
@robinloeffel there's a ton of changes to the README that I'd like to see. would you mind if I updated your branch directly? |
shellscape
left a comment
There was a problem hiding this comment.
So I think that the API change is a good one, but the one thing that'll keep this PR from being merged is the discrepancy in the testing. We went from 11 tests in master to 2 in this PR - I don't think I've ever seen a move to a new version of a thing reduce the number of tests. They typically increase in number and coverage. Coverage dropped on this branch significantly as well:
master
11 tests passed
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 91.89 | 97.06 | 100 | 91.89 |
index.js | 91.89 | 97.06 | 100 | 91.89 | 14-19
----------|---------|----------|---------|---------|-------------------
feat/easlint-ise-new-api
2 tests passed
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 83.33 | 63.64 | 100 | 81.25 |
index.js | 83.33 | 63.64 | 100 | 81.25 | 28-29,51,54,57,61
----------|---------|----------|---------|---------|-------------------
I'd like to see the test fixtures reinstated, and even if they're redundant for coverage, run against the plugin for a test. We'll absolutely have to have equal, if not better coverage, and the tests should be rock solid.
Yeah, feel free! I'll get back to the testing issue asap, but it may be some days. I recently tested positive for Covid and am still recovering. |
|
😷 oh man, I'm so sorry! Please rest up and take care of yourself. Here's hoping you're on the mend quickly! |
|
Hey @shellscape Sorry for my being absent, but I just couldn't manage contributing here. You can go ahead and remove me from the team, if you want, as I don't see me taking an active role for a while. Cheers, man! |
|
Checking in and reviewing PRs would absolutely be helpful! We'll leave you on, and no worries about the lack of time, we all understand. We'll continue your work here when we're able to. |
|
Alright, then we'll continue like so. Thanks for being so cool about it! |
486cc69 to
34ba4ce
Compare
|
A fair amount of time has passed since this PR received any love, so we're going to close it for the time being. If anyone would like to take up this work, please open a new PR and we'll continue from there. |
Rollup Plugin Name:
eslintThis PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
Description
With version 7 of ESLint came some changes to its API. The original version of this plugin made use of the now-deprecated
CLIEngineclass, which lies at the heart of every ESLint integration.The changes introduced in this PR are as follows:
CLIEngineto newESLintclass (see below)avasetup (see below)formattercan't be used anymorenodeversion more exactlyBreaking Changes to the API
The only change to the plugin's API for the end-user is that a
formatter, which is an option directly passed to ESLint, can't be afunctionanymore in v7.Simpler
avatestsThe previous version of this package used a neat trick where one would use a custom inline
formatterfunction to write the results we're getting from ESLint to variables inside of the tests. Now, sadly, this isn't possible anymore, as aformattercan only be a string pointing either to an in-built formatter likestylish, an npm package or a formatter on the file system.Without polluting the plugin with unnecessary logic for the end-user, I didn't find a way to achieve the same level of depth in regards to testing with the previous version. I played around with returning a
metaprop and accessing it from within an inline plugin, but since this plugin uses theloadhook and doesn't always return code—only if ESLint's autofixed something—this way doesn't really work. Switching back to thetransformhook would result in the plugin suffering from the same interop bug withtypescriptas before, see TrySound/rollup-plugin-eslint#47.I'm not happy with this at all, however, and would appreciate any input on how to improve this setup. If no one has an idea, I'd still like to proceed and merge, as the improvements in other aspects are quite large, and re-visit this topic at a later stage.