Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Fix babel parsing plugins (typescript) #2

Merged
merged 1 commit into from Mar 12, 2020

Conversation

jacobrienstra
Copy link

I was mystified as to why stylelint stopped working when I switched from .jsx to .tsx, and it turns out it was this. It was overriding that set of plugins with Babel's automatically detected ones, and if you had babel typescript installed in a gatsby plugin, which babel missed. I believe it may also fix it if you were using tsc and not babel.

I imagine there are some other problems this might solve too though. Please give feedback! I'm happy to change things on request, especially if someone tests this and discovers that it spawns another bug.

Which issue, if any, is this issue related to?

gucong3000#55
This is closed but the fix for it broke on other cases, like mine.

Is there anything in the PR that needs further explanation?

I believe that by putting the babel options second, they'll override any conflicting plugins defined in the stylelint list there. If this isn't the case, then perhaps something more precise is required.

I was mystified as to why stylelint stopped working when I switched from .jsx to .tsx, and it turns out it was this. It was overriding that set of plugins with Babel's automatically detected ones, and so would fail if you were using tsc, or in my case, had babel typescript installed in a gatsby plugin, which babel missed.

I imagine there are some other problems this might solve too though. Please give feedback or edit yourself, I'm not able to thoroughly test this.
@jeddy3
Copy link
Member

jeddy3 commented Mar 12, 2020

Thank you for the pull request. I accidentally skipped over it when I was catching on my stylelint notifications last week after a week away. I think I'm the only one watching this repository at the moment, which is why no else has replied.

We only recently forked the syntax, and we haven't even got around to setting up the continuous integration yet! We did, however, complete a bunch of work in preparation for the forking, and we now have definite lists of:

So, your pull request—the first in this fork—is an exciting step in the right direction.

I'll merge your pull request, but there are a few things to do to see it go live. I've created issues for:

I hope to start on these this week, but help is appreciated.

There's lots more to do, especially when it comes to feature parity and squashing bugs.


I've invited you to stylelint organisation so that, if you want, any further pull requests can be made directly from a clone rather than a fork.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants