Codesandbox-client: Possible to configure ESLint?

Created on 19 May 2019  ·  20Comments  ·  Source: codesandbox/codesandbox-client

❔ Question

Is it currently possible to configure ESLint at all? I can see that it's running, but its options don't appear in the VSCode preferences. I'm trying to find a way to change how it treats React pragma (so it doesn't consider preact's h to be "unused") but so far I've had no luck! I've tried to add my own .eslintrc.json but it didn't seem to take.

Link to sandbox: link

stale 🤔 Improvement

Most helpful comment

Yep! We definitely want to support it, I was playing a bit with making that work before. I thought the "easiest" way would be to start supporting the eslint extension of VSCode, which handles the configuration resolving automatically. The challenge right now is that we need to install all custom eslint plugins that are defined in package.json, that's the last thing needed to make it work methinks.

All 20 comments

@CompuIves I have the same question, I am getting eslint errors in Dojo sandboxes for valid syntax.

Link to sandbox: link

Yep! We definitely want to support it, I was playing a bit with making that work before. I thought the "easiest" way would be to start supporting the eslint extension of VSCode, which handles the configuration resolving automatically. The challenge right now is that we need to install all custom eslint plugins that are defined in package.json, that's the last thing needed to make it work methinks.

I think your issue @agubler will be fixed with this! #1991

Awesome thanks @CompuIves 🎉

Is this on a roadmap? Is there a CodeSandbox roadmap somewhere?

@jsejcksn seems like #1991 was merged in but just needs explicit configuration added to CodeSandbox -- unless I'm missing something. Would also love to see this as needing === is not preferred for some people's preferences.

Any news about this? How to configure this or anything like that.

Any progress here @CompuIves? I'm getting false positives with eslint no-undef in my sandbox due to the lack of eslint/TS integration. The ability to have a custom eslint config or even disable eslint entirely would also be acceptable workarounds. (I'd rather not disable it manually in every file.)

@NickCarducci That’s not eslint doing the formatting, that’s Prettier. You should be able to put a prettier-ignore comment above the line you don’t want formatted using the syntax you described (though finding exactly the right place to put it to get the effect you want can be challenging).

I found a decent workaround so far by just disabling specific rules at the top of my files
/* eslint-disable no-undef, no-unused-vars */

This doesn't work for create react app apps as far as I can see. It's literally just that one rule that I want to disable!

Hey!

This was never implemented at least until now, you will still need to do a workaround like @FrankSandqvist mentioned

Thanks @SaraVieira , that workaround would be acceptable but it doesn't seem to be working for me: https://codesandbox.io/s/disable-unused-vars-example-syt2t?file=/src/App.tsx

Hey

In your case it needs to be these three:

/* eslint-disable no-undef, @typescript-eslint/no-unused-vars, no-unused-vars */

because you are using TS and need to disable that too :(

https://codesandbox.io/s/disable-unused-vars-example-forked-fz6ki?file=/src/App.tsx:0-80

Oh brilliant thank you so much! Red squigglies be gone :-)

Nice! Sorry, we do not allow for custom config yet :(

This issue has automatically been marked stale because there has been no activity in a while. Please leave a comment if the issue has not been resolved, or if it is not stale for any other reason. After 2 weeks, this issue will automatically be closed, unless a comment is made or the stale label is removed.

Please leave a comment if the issue has not been resolved, or if it is not stale for any other reason.

Hey

Thank you for bringing this to our attention, I have just added it to our internal backlog that we do want to make public but for now, it's all in notion.

I will be closing but to make sure what we have in GitHub is just issues and all our feature requests are tracked in our roadmap.

We will definitely make an announcement when this is done

Again, thank you!

Just in case given what I read from the discussion, getting the option to configure it for real (rather than just a pure way to disable it entirely) would be immensely helpful for me.

My main goal was to reproduce / ensure I could reproduce a would-be bug with some specific plugin of eslint, and for this, to make a working codesandbox example with the behaviour shown clearly.

Thank you very much for the tool and best of luck with your work on it. ❤️

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CompuIves picture CompuIves  ·  3Comments

oliversturm picture oliversturm  ·  3Comments

faceyspacey picture faceyspacey  ·  3Comments

yazaabed picture yazaabed  ·  3Comments

donavon picture donavon  ·  3Comments