-
Notifications
You must be signed in to change notification settings - Fork 18
Fix false negatives for babel decorators #161
Conversation
fwiw the code should let you override it via a babel config, but it doesn't seem to work... i think this is because of it using an old plugin name. if you update this to be |
Thanks again @43081j! Seems working locally for me! |
Friendly ping to previous committers like @hudochenkov, @jeddy3 and @bartlangelaan to feel a little more confident to be able to merge and release this! (in fact, I don't know if I can release a new version after merge the PR) |
extract.js
Outdated
@@ -94,7 +94,7 @@ const plugins = [ | |||
'jsx', | |||
'typescript', | |||
'objectRestSpread', | |||
['decorators', { decoratorsBeforeExport: false }], | |||
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: 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.
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }], | |
['decorators', { decoratorsBeforeExport: true }], |
@43081j testing one more time...
Seems like this doesn't work:
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
But it works with:
['decorators', { decoratorsBeforeExport: 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.
really? i did try it locally and it worked fine, though i altered the file in node_modules directly. i had to install the plugin, though. maybe thats what you were missing? ideally i think we should check which is the correct one going forward according to babel
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.
I also just edit the node_modules/@stylelint/postcss-css-in-js/extract.js
directly.
I did not install any dependencies. We should?
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.
we really should be using what babel recommend and that seems to be the @babel/plugin-proposal-decorators
plugin, so i personally would take this opportunity to update to that. but yeah that means we should probably require it as a peer dependency, or tell consumers if they want to use decorators they should install it.
one for the stylelint maintainers to decide i think. separately the parser shouldn't be eating up the babel errors either, so people are aware they're missing the dependency
Is there a path forward for this? From what I can tell, even if I install |
I'm waiting an answer from the Stylelint Team (@hudochenkov, @jeddy3 or @bartlangelaan). |
Can we have a test for this change? |
Sorry, I'm not familiar with it. Can you help me with this? Thanks in advance! |
@@ -94,7 +94,7 @@ const plugins = [ | |||
'jsx', | |||
'typescript', | |||
'objectRestSpread', | |||
['decorators', { decoratorsBeforeExport: false }], | |||
['decorators', { decoratorsBeforeExport: 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.
I'm afraid, this doesn't help in my case.
Superseded by https://github.com/stylelint/postcss-css-in-js/issues/236 and released in |
Closes stylelint/stylelint#4761
All info here: stylelint/stylelint#4761 (comment)