-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
feat: ✨ Support ESLint 8 #696
Conversation
These are breaking changes as the ESLint API has changed with version 8
src/index.js
Outdated
if (Array.isArray(eslintConfig.globals)) { | ||
const tempGlobals = {}; | ||
eslintConfig.globals.forEach(g => { | ||
const [key,value] = g.split(':'); | ||
tempGlobals[key] = value; | ||
}); | ||
eslintConfig.globals = tempGlobals; | ||
} | ||
|
||
eslintConfig.overrideConfig = { | ||
rules: eslintConfig.rules, | ||
parser: eslintConfig.parser, | ||
globals: eslintConfig.globals, | ||
parserOptions: eslintConfig.parserOptions, | ||
ignorePatterns: eslintConfig.ignorePattern, | ||
...eslintConfig.overrideConfig, | ||
}; | ||
|
||
delete eslintConfig.rules; | ||
delete eslintConfig.parser; | ||
delete eslintConfig.parserOptions; | ||
delete eslintConfig.globals; | ||
delete eslintConfig.ignorePattern; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config accepted by the ESLint API is different now. Anything that overrides the config (rules, parser, parserOptions, globals, ignorePattern, etc) needs to be in overrideConfig
not the root object. To lessen the upgrade overhead, I chose to transform the arguments and not make the user change their parameters.
Also, globals
must be an object now and not an array.
.eslintrc.js
Outdated
@@ -10,7 +10,8 @@ const config = { | |||
named: "never", | |||
asyncArrow: "always" | |||
} | |||
] | |||
], | |||
"import/no-import-module-exports": "off" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated eslint-config-kentcdodds
package is set to error on this rule.
@@ -0,0 +1,4 @@ | |||
module.exports = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The eslint-config-kentcdodds
update changed some rules including removing the quotes and arrow parenthesis rules.
🙏 TY @DanielKlys7 |
Is there a timeframe for this release? |
Bump 🙌🏽 |
any updates? |
Friendly ping @DanielKlys7 @idahogurl |
@bernardocs I do not have write permissions to this repo so I cannot merge. |
Maybe a friendly ping to some of the guys who merge other PR's ... @zimme @hamzahamidi @kylemh 👀 |
I haven't touched this codebase in so long I'm not really comfortable reviewing anything without having the time to get familiar with it again first and I'm sorry to say I don't really have time as I'm too busy with my startup and my family currently. I can probably help with repo write access, for anyone that's created a few PRs and want to help maintain the package. |
@zimme Completely understandable. Could I get write access? |
@zimme I'm not gonna be able to address this one until early May. I'm traveling a little too much to have time for OSS right now. I wouldn't mind another member 😁 If you can add @idahogurl , I say go for it. I don't have the ability. |
For reference, @idahogurl I'd recommend not simply merging your PR if you do get write access. For some reason, your PR didn't go through our CI. I tried tackling this one awhile ago in #505 but have had no luck passing CI with the brief time I had available for this project. Maybe a |
BREAKING CHANGES: The `format` function is now asynchronous. Closes prettier#656
ah interesting i still need to manually tell GitHub actions you're allowed to run?! |
Codecov Report
@@ Coverage Diff @@
## master #696 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 262 281 +19
Branches 67 77 +10
=========================================
+ Hits 262 281 +19
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. this will decrease the scope of that other PR
🙏 My sincere thanks on behalf of the community and personally |
looks like the release didn't automatically occur. I'll sort this out ASAP, but if @idahogurl gets write permissions then I presume she'll fix it ASAP! |
🎉 This PR is included in version 14.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Don't forget to check if prettier-eslint-cli needs updating to work with the new prettier-eslint. |
I'm struggling to get this working, as I posted here: prettier/prettier-eslint-cli#427 (comment)
... and yet I'm still seeing:
Is there anything obvious that I've done wrong? |
@georgecrawford There was a hotfix that came out. Upgrade to 14.0.1 |
Hmm. Thanks @idahogurl but I still have the exact same problem with:
Looking further into it, the issue seems to be that
I know Thanks for any advice you can give! |
@georgecrawford I'm going to create a PR to update the CLI. |
Amazing. Thanks so much!
…____________________
George
On 27 Apr 2022, at 16:18, Rebecca Vest ***@***.***> wrote:
@georgecrawford <https://github.com/georgecrawford> I'm going to create a PR to update the CLI.
—
Reply to this email directly, view it on GitHub <#696 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAUWAJJFST3O536MW4SIHDVHFLC7ANCNFSM5MWQYIGA>.
You are receiving this because you were mentioned.
|
@georgecrawford Appears this is going to be harder than I thought. I ran the tests after I installed the packages and all the tests are failing for me. It uses RxJs which I am not familiar with whatsoever. I'm using Node 12 not Node 8 so don't know if that affects it. You could write a Node script that loops through files, runs the You could look into using worker threads which requires Node 14+ |
Hello, @idahogurl |
@georgecrawford @smartdev322 prettier-eslint-cli version 6.01 is now out. https://github.com/prettier/prettier-eslint-cli/releases/tag/v6.0.0 |
Closes #656
These are breaking changes as the ESLint API has changed with version 8.
Major change is that
format
is now asynchronous. This is because theexecuteOnText
function (nowlintText
) https://github.com/eslint/eslint/blob/851f1f18bd1a5da32c1b645bfcb28fadc627ad9e/lib/eslint/eslint.js#L572 is asynchronous. I would have made my changes backward compatible, but there is no backward compatible method for the asynchronous change.