Closed mattwcole closed 4 years ago
Prettier fails to recognise TypeScript when this plugin is installed and a custom Babel config is used.
npx create-react-app my-app --template typescript cd my-app yarn add prettier prettier-plugin-import-sort import-sort-style-module -D
package.json:
"importSort": { ".js, jsx, .ts, tsx": { "style": "module" } }
yarn prettier --write . # works great, imports sorted echo {} > .babelrc yarn prettier --write . # typescript no longer recognised yarn remove prettier-plugin-import-sort yarn prettier --write . # back to working
My mistake, I was missing "parser": "typescript" in the package.json!
"parser": "typescript"
Prettier fails to recognise TypeScript when this plugin is installed and a custom Babel config is used.
Steps to reproduce
package.json: