-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Do not require plugins to set 'since' field #4038
Conversation
@@ -81,10 +81,9 @@ function inferParser(filepath, plugins) { | |||
pluginsLoaded: true | |||
}).languages.find( | |||
language => | |||
typeof language.since === "string" && |
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.
language.since !== null
? We should omit unreleased languages here.
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.
Good catch.
src/common/support.js
Outdated
return semver.gte(version, language.since); | ||
} | ||
return true; | ||
}) |
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.
How about
language.since
? semver.gte(version, language.since)
: language.since !== null
?
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.
Yeah I originally had a ternary but it looked messy/hard to reason about so I switched it to if/else.
Fixes the issue raised in prettier/plugin-php#55