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

Syntax highlighting breaks when jsx is explicitly set to true #15

Open
IsaiahByDayah opened this issue Oct 15, 2018 · 3 comments
Open

Comments

@IsaiahByDayah
Copy link

We recently changed out project to require explicit values for boolean props and now the great highlighting this plugin provides doesnt work. Looking at the source it seems its a matter of extending this line to account for <style jsx={true}> but could be completely mistaken?

@IsaiahByDayah
Copy link
Author

I made a PR to potentially fix this: #16

@iFwu
Copy link
Owner

iFwu commented Nov 1, 2018

I'm currently working on it, and you can temporarily use

{
  "compilerOptions": {
    "jsx": "preserve"
  }
}

in your tsconfig.json or jsconfig.json;
and add the following declaration in your typings file.

// custom.d.ts
import 'react';

declare module 'react' {
  interface StyleHTMLAttributes<T> extends React.HTMLAttributes<T> {
    jsx?: boolean;
    global?: boolean;
  }
}

(vercel/styled-jsx#90)

It will eliminate the error in VSCode.

@dangayle
Copy link

@iFwu Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants