Skip to content

Do not require plugins to set 'since' field#4038

Merged
azz merged 2 commits intoprettier:masterfrom
azz:plugin-since
Feb 24, 2018
Merged

Do not require plugins to set 'since' field#4038
azz merged 2 commits intoprettier:masterfrom
azz:plugin-since

Conversation

@azz
Copy link
Copy Markdown
Member

@azz azz commented Feb 24, 2018

Fixes the issue raised in prettier/plugin-php#55

Comment thread src/main/options.js
pluginsLoaded: true
}).languages.find(
language =>
typeof language.since === "string" &&
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Comment thread src/common/support.js Outdated
return semver.gte(version, language.since);
}
return true;
})
Copy link
Copy Markdown
Member

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

?

Copy link
Copy Markdown
Member Author

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.

@azz azz merged commit a066812 into prettier:master Feb 24, 2018
@azz azz deleted the plugin-since branch February 24, 2018 08:00
@lock lock Bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 18, 2019
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants