You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran 4.0.0-alpha.3 and 4.0.0-alpha.4 on my large monorepo codebase, and found a couple places where the parsing crashed, with a useless error message:
$ yarn prettier --write […]/devices.service.ts
[error] […]/devices.service.ts: SyntaxError: Unexpected token (48:76)
[error] // and thus follows all the lines of the file.
module.exports={overrides: [{// prettier will strip newlines out of package.json files unless you tell it to use the json parserfiles: ["package.json","**/package.json"],options: {parser: "json"},},],printWidth: 100,semi: true,singleQuote: false,// Single quotes are common in text-stringstrailingComma: "all",// Improves refactoring / minimizes git-conflictstabWidth: 2,useTabs: true,// @ianvs/prettier-plugin-sort-importsimportOrder: ["<THIRD_PARTY_MODULES>","","^@hca","","^[.]+"],importOrderTypeScriptVersion: "4.9.5",// Doesn't need to be tracked automatically, see https://github.com/IanVS/prettier-plugin-sort-imports#importordertypescriptversion if curiousimportOrderParserPlugins: ["typescript","decorators-legacy","classProperties"],// @prettier/plugin-xmlxmlWhitespaceSensitivity: "ignore",};
Contribute to @ianvs/prettier-plugin-sort-imports
I'm willing to fix this bug 🥇
The text was updated successfully, but these errors were encountered:
I have a workaround for our repo (remove the jsx parser plugin) -- all our code is typescript-based, so this isn't a problem for us. Not sure what mixed ts/tsx/js/jsx codebases are supposed to do.
This fixes a few issues with parser plugins.
It fixes#78
by removing the `jsx` parser plugin when the file is named `.ts`
(typescript requires the use of `.tsx` extension for jsx).
It also applies similar logic for .vue files, ensuring that the correct
parser plugins are used, with similar logic to the vue compiler itself.
Your Environment
Describe the bug
I ran 4.0.0-alpha.3 and 4.0.0-alpha.4 on my large monorepo codebase, and found a couple places where the parsing crashed, with a useless error message:
To Reproduce
jsx
in yourimportOrderParserPlugins
When running inside this repo's test-cases, I get this useful log message:
Expected behavior
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Contribute to @ianvs/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: