Closed gwhitney closed 2 years ago
:tada: This PR is included in version 6.0.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Hmm, I'm still seeing
jsxBracketSameLine is deprecated.
with 6.0.1, and prettier-eslint
14.0.3 (and prettier
2.6.2)—not yet quite sure why, or what's the right fix.
I find that I don't get that output if I remove the lines corresponding to these in my node_modules/prettier-eslint/dist/utils.js
. I intend to investigate more and hopefully report back tomorrow with my findings. 🙂
Ah, here's what I think is happening.
react/jsx-closing-bracket-location
is active (not off) in my ESLint config. The specific setting (according to eslint --print-config .eslintrc.yaml
) is:
"react/jsx-closing-bracket-location": [
"error",
"line-aligned"
],
prettier-eslint
(since https://github.com/prettier/prettier-eslint/commit/59ef52be61ccbd07a3ffc734ea1ecf49c5f46918) notices that ESLint setting and uses it to set an appropriate value for the Prettier setting jsxBracketSameLine
. But Prettier deprecated that setting in https://github.com/prettier/prettier/commit/4992d972034b19acce9603a8444c95250cb1be8a (released in Prettier 2.4.0, it looks like), so I'm getting the deprecation warning.
In fact, for my specific choice of react/jsx-closing-bracket-location
('line-aligned'), prettier-eslint
is choosing false
for jsxBracketSameLine
, to turn the setting off. But, I guess understandably, newer Prettier prefers that people don't touch the setting at all, even to say "turn it off".
Should prettier-eslint
solve this by no longer trying to set jsxBracketSameLine
? https://github.com/prettier/prettier/commit/4992d972034b19acce9603a8444c95250cb1be8a proposed bracketSameLine
as a replacement, but I'd guess that's only available in Prettier 2.4.0+.
@chrisbobbe I'm thinking we use their proposed solution of bracketSameLine
, prettier-eslint
currently uses ^2.5.1
anyway as seen here https://github.com/prettier/prettier-eslint/blob/3746d674f3810d19156c3060c401adf536d999b8/package.json#L28
Great, that sounds good to me! Shall I make a PR?
@chrisbobbe That would be wonderful!
Just sent prettier/prettier-eslint#749 🙂
By removing the default value for jsx-bracket-same-line (which is just
undefined
anyway), no option value at all for jsxBracketSameLine will be generated if none is specified. Then if a recent version of prettier is in use for which that option is deprecated, it won't complain.Resolves #428.