prettier-plugin-multiline-arrays icon indicating copy to clipboard operation
prettier-plugin-multiline-arrays copied to clipboard

Used in prettier_action but got an error

Open minchu0x37 opened this issue 1 year ago • 2 comments

I am using prettier_action in GitHub Actions and the prettier-plugin-multiline-arrays plugin, but I encountered an error when running it. The error is shown below. 1721295068734

My config as blow: `jobs: prettier: runs-on: ubuntu-latest

steps:
  - name: Checkout
    uses: actions/checkout@v3
    with:
      ref: ${{ github.event.pull_request.head.ref }}
  - name: Install prettier plugins
    run: |
      npm install prettier-plugin-multiline-arrays
  - name: Prettify code
    uses: creyD/[email protected]
    with:
      prettier_options: --config .prettierrc --check ./**/*.ts
      prettier_plugins: 'prettier-plugin-multiline-arrays'

The .prettierrc file is :{ "plugins": ["prettier-plugin-multiline-arrays"], "multilineArraysWrapThreshold": 3, "semi": true, "trailingComma": "all", "singleQuote": true, "printWidth": 120 }`

Why did this error occur?

minchu0x37 avatar Jul 18 '24 09:07 minchu0x37

That error happens when the plugin's preprocess callback isn't called by Prettier. Specifically, this function was never called: https://github.com/electrovir/prettier-plugin-multiline-arrays/blob/b1fb14403fb94cd1a25e8e0ac6e72e982bcdcb79/src/printer/original-printer.ts#L5-L7

I have no idea why that issue would happen that this specific situation 🤔

electrovir avatar Jul 18 '24 13:07 electrovir

I am also very confused. It runs successfully locally, but it fails when running in GitHub Actions. 🤔

minchu0x37 avatar Jul 19 '24 02:07 minchu0x37

I'm going to close this as won't fix since I don't use the prettier_action GitHub Action. I welcome outside debugging and/or contributions though!

electrovir avatar Dec 14 '24 22:12 electrovir