vscode-styled-jsx
vscode-styled-jsx copied to clipboard
Syntax highlighting breaks when jsx is explicitly set to `true`
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?
I made a PR to potentially fix this: https://github.com/iFwu/vscode-styled-jsx/pull/16
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;
}
}
(https://github.com/zeit/styled-jsx/issues/90)
It will eliminate the error in VSCode.
@iFwu Any progress on this?