electrovir/prettier-plugin-multiline-arrays

Used in prettier_action but got an error

minchu0x37 opened this issue · 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/prettier_action@v4.3
    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?

That error happens when the plugin's preprocess callback isn't called by Prettier. Specifically, this function was never called:

export function setOriginalPrinter(input: Printer) {
originalPrinter = input;
}

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

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