-
Notifications
You must be signed in to change notification settings - Fork 22
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
Use of enums in object declaration causes failure with --align-object-properties & TypeScript #692
Comments
Now reproduced with |
Thanks for trying this. This clearly pointed to my configuration, so I culled my
With this settings enabled, prettierx produces the error. Thanks again. |
I just reproduced it with Reproduced with both brodybits@brodybits-mini-mac-book prettierx % ./bin/prettierx.js --align-object-properties info.ts
info.ts[error] info.ts: TypeError: Cannot read property 'raw' of undefined
[error] at getPropertyPadding (/Users/brodybits/prettierx/src/language-js/print/property.js:144:20)
[error] at AstPath.call (/Users/brodybits/prettierx/src/common/ast-path.js:66:20)
[error] at printProperty (/Users/brodybits/prettierx/src/language-js/print/property.js:186:32)
[error] at printPathNoParens (/Users/brodybits/prettierx/src/language-js/printer-estree.js:374:14)
[error] at Object.genericPrint [as print] (/Users/brodybits/prettierx/src/language-js/printer-estree.js:90:19)
[error] at callPluginPrintFunction (/Users/brodybits/prettierx/src/main/ast-to-doc.js:133:21)
[error] at mainPrintInternal (/Users/brodybits/prettierx/src/main/ast-to-doc.js:76:17)
[error] at mainPrint (/Users/brodybits/prettierx/src/main/ast-to-doc.js:56:14)
[error] at /Users/brodybits/prettierx/src/language-js/print/object.js:122:18
[error] at AstPath.each (/Users/brodybits/prettierx/src/common/ast-path.js:95:7)
brodybits@brodybits-mini-mac-book prettierx % ./bin/prettierx.js --align-object-properties --parser=typescript info.ts
info.ts[error] info.ts: TypeError: Cannot read property 'raw' of undefined
[error] at getPropertyPadding (/Users/brodybits/prettierx/src/language-js/print/property.js:144:20)
[error] at AstPath.call (/Users/brodybits/prettierx/src/common/ast-path.js:66:20)
[error] at printProperty (/Users/brodybits/prettierx/src/language-js/print/property.js:186:32)
[error] at printPathNoParens (/Users/brodybits/prettierx/src/language-js/printer-estree.js:374:14)
[error] at Object.genericPrint [as print] (/Users/brodybits/prettierx/src/language-js/printer-estree.js:90:19)
[error] at callPluginPrintFunction (/Users/brodybits/prettierx/src/main/ast-to-doc.js:133:21)
[error] at mainPrintInternal (/Users/brodybits/prettierx/src/main/ast-to-doc.js:76:17)
[error] at mainPrint (/Users/brodybits/prettierx/src/main/ast-to-doc.js:56:14)
[error] at /Users/brodybits/prettierx/src/language-js/print/object.js:122:18
[error] at AstPath.each (/Users/brodybits/prettierx/src/common/ast-path.js:95:7) |
Fixed here ... #700 |
Tested with Prettierx version:
0.19.0
andmaster (0.19.1-dev)
The following code fragment
Causes prettierX to fail when the
--align-object-properties
option is set.Without the
--align-object-properties
, formatting works as usual.Kind Regards
The text was updated successfully, but these errors were encountered: