Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 995 Bytes

File metadata and controls

39 lines (25 loc) · 995 Bytes

Debugging


How to run example in the repository ?

yarn run example examples/example.ts --config examples/.prettierrc

How to debug the plugin using node debugger ?

You can set a debugger anywhere in the code and then use following command:

yarn run compile && node --inspect-brk ./node_modules/.bin/prettier --config examples/.prettierrc --plugin lib/src/index.js examples/example.ts

How to debug the unit test using debugger ?

You can set a debugger anywhere in the code and then use following command:

node --inspect-brk ./node_modules/.bin/vitest --run

Or, to debug a single unit test file

 node --inspect-brk ./node_modules/.bin/vitest --run <name-or-relative-path-of-the-file-file>

How to run prettier in any codebase using the plugin ?

First, install the @ianvs/prettier-plugin-sort-imports and then use following command:

./node_modules/.bin/prettier --write '**/*.{ts,tsx,js}'