Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delimiter-dangle triggers on interface #381

Closed
SimeonC opened this issue Dec 20, 2018 · 3 comments · Fixed by #392 · May be fixed by ajesse11x/create-react-app#5 or hamidraza/zcui-vue-pwa#100
Closed

delimiter-dangle triggers on interface #381

SimeonC opened this issue Dec 20, 2018 · 3 comments · Fixed by #392 · May be fixed by ajesse11x/create-react-app#5 or hamidraza/zcui-vue-pwa#100

Comments

@SimeonC
Copy link

SimeonC commented Dec 20, 2018

In an interface I don't think this should trigger the delimiter-dangle rule. Mostly because prettier keeps adding in the semi-colon and in this situation it is more like a class definition than an object definition so I think the semi-colon on renderNode should be there.

interface RenderMarkInterface {
  renderMark: (props: *) => Element<*> | Node | null;
  renderNode?: null; // This line throws "Unexpected trailing delimiter (flowtype/delimiter-dangle)
}
@gajus gajus added the bug label Dec 20, 2018
@gajus
Copy link
Owner

gajus commented Dec 20, 2018

PR is welcome.

SimeonC added a commit to SimeonC/eslint-plugin-flowtype that referenced this issue Apr 2, 2019
@SimeonC
Copy link
Author

SimeonC commented Apr 2, 2019

Took me ages but I finally got around to creating a PR for this. Ended up adding a second argument to delimiter-dangle so the behaviour of interface types can be properly controlled. Turns out that the AST parser thinks that an interface is an Object annotation, whereas it's closer to a Class annotation.

SimeonC added a commit to SimeonC/eslint-plugin-flowtype that referenced this issue Apr 2, 2019
SimeonC added a commit to SimeonC/eslint-plugin-flowtype that referenced this issue Apr 10, 2019
@gajus
Copy link
Owner

gajus commented Aug 2, 2019

🎉 This issue has been resolved in version 3.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment