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
Upgrade ESLint to 6 #236
Upgrade ESLint to 6 #236
Conversation
Codecov Report
@@ Coverage Diff @@
## master #236 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 2 2
Lines 208 208
Branches 42 42
=====================================
Hits 208 208 Continue to review full report at Codecov.
|
@robertpaul01 I feel like you didn’t read anything. No it can’t be merged. |
@kylemh lmfao |
Hell yeah, well why didn't you say so!?
This is totally correct - didn't realize fs was mocked separately as part of the Jest setup, so I needed to pass it the mock implementation, or - better yet - I'll just spy on the original mock fn implementation. Unfortunately, even with the corrections, I am still seeing 5 function calls versus 2. To be clear: I tried both the
Doesn't seem like the safest strategy, which is why I tried opening up this issue for discussion. I agree with you and think these tests are "janky", but the library main contributors should be the one to see in finality. |
@kylemh: Based on what @robertpaul01 wrote, the way prettier-eslint interacts with eslint@6 causes .eslintignore to be read multiple times during the test. That test should now assert that IMHO The test in question is testing more of the internal details of eslint than it should. That test is just trying to ensure that |
Thank you all for making it a discussion y'all ❤️ @zimme if you feel asserting the number of calls is necessary let me know, and I'll add a comment to this pull request as contextual information. Otherwise, this PR should be ready. |
I'll make sure to carve out some time this week for this so we can get a new major version out with support for eslint 6 |
Has any progress been made on this? |
I started to look at this today, however family life intervened and here we are me hoping to get a few hours available this week to look at this and hopefully merge |
Clearly zimme will get to it when he can. No need to request for more updates. |
@zimme Any update for this PR? |
I will try my best to test and merge this within a week. |
@zimme is there any way I can help? |
@zimme Hi Simon, first I want to say, thank you! we are still waiting for you. I know this is hard that maintainers to maintain a popular public repository, but you know, a lot of people and repository waiting for this merge. Thank you again! |
Feel free to put up a donation link so everyone who wants it done can chip in to help |
I'm willing to donate, but I don't think that should be the motivation for @zimme to pull the trigger on this. My frustration is that this PR is ready to be merged, and there isn't anything I can do to help. Is there no other course of action? Is someone else eligible to review and merge this? |
Just because it's ready to be merged doesn't mean it's ready to be used in everybody's application. We had a discussion at the top of the PR on a point that we think we have a good understanding of now, but - as an author of a popular open source library - the hesitation becomes around not wanting to bump versions before they're as certain as possible. If this ships and actually leads to bugs, now the author has created their own stress to correct everything ASAP. If they don't, issues increase and notifications blow up increasing more stress. Please stop bumping this thread. They'll release it when they release it. |
Why not just release under a beta tag and let early adopters find the bugs for you? Seems like everyone's happy then... |
@zimme care to release a beta tag with this merged? I can subscribe to the repo and pay attention to issues. If we get any from the beta, I can make the reversion PR and ping you. |
|
Unfortnately, React Native 0.60.0 specifies this version of ESLint as a requirement. (0.62.0-rc1 removes the requirement.) Note that `prettier-eslint` is not yet fully compatible with ESLint 6, although an open PR exists which should remedy this: prettier/prettier-eslint#236
Sorry to ask, but what is the workaround to get prettier to work with eslint 6? |
Assuming you install the relevant dependencies, you’ll want a lint config like this: module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
extends: [
'prettier',
'prettier/react',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'prettier',
],
rules: {
// Prettier Plugin Rules
'prettier/prettier': 'error',
},
}; |
Codecov Report
@@ Coverage Diff @@
## master #236 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 208 208
Branches 42 42
=========================================
Hits 208 208 Continue to review full report at Codecov.
|
Ready to merge and tag at your discretion @hamzahamidi |
@kylemh it appears the pr no longer passes. I'll take a look |
@kylemh The checks pass now |
I'll merge this branch as a breakingChange: Eslint 6+ |
🎉 This PR is included in version 10.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
@hamzahamidi FYI looks like things may have gotten lost in between PRs getting merged and reverted. It looks like master is still pointing to eslint@5 Line 25 in b2ae087
|
Strange. It was here: 95169c5 |
Ok I'll ready another pr. |
Resolves #222
Summary
For those uninterested in seeing the conversation below, we simply upgraded the dependency and removed an assertion regarding the number of times
fs.readFileSync
is called, as it is an integration detail that ESLint controls - not this library.Original Post
So... logging the calls of
fsMock.readFileSync
yields:The following test
logs error if it cannot read the file...
sets and resets the mock at the test-level, instead of the test lifecycle; however, when I attempt this workaround...I'm met with many other broken tests:
I skimmed the changelog for ESLint since v5, but couldn't find a reasoning for the increased calls; so I'm left to imagine that
a) It is invalid and the way the tests are written currently need a massive overhaul to avoid leaking into other . tests.
OR
b) It is valid, but I'm unsure how to document the extra calls.