Skip to content

[Bug]: Stylelint's github formatter is deprecated #191

@tyrann0us

Description

@tyrann0us

Description of the bug

wp-scripts-lint.yml uses Stylelint's built-in github formatter:

run: ./node_modules/.bin/wp-scripts lint-style ${{ inputs.STYLELINT_ARGS }} --formatter github

This formatter was deprecated in Stylelint 16.8.2 (https://github.com/stylelint/stylelint/releases/tag/16.8.2; see stylelint/stylelint#7909).

Reproduction instructions

  1. Use the wp-scripts-lint.yml workflow.
  2. See the following deprecation warning in the "Lint style files" step: "Notice: The github formatter is deprecated".

Expected behavior

No deprecation warning.

Environment info

No response

Relevant log output

Additional context

The deprecation warning includes a link to https://stylelint.io/awesome-stylelint/#formatters, which suggests https://github.com/csstools/postcss-plugins/tree/main/plugins-stylelint/formatter-github or https://github.com/xt0rted/stylelint-actions-formatters as alternative GitHub formatters.
A more straightforward but untested approach could be to fetch the matcher JSON from https://github.com/xt0rted/stylelint-problem-matcher/blob/main/src/problem-matcher.json like we do with actionlint:

- name: Set up problem matchers for actionlint
run: |
curl -s -o actionlint-matcher.json https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json
echo "::add-matcher::${GITHUB_WORKSPACE}/actionlint-matcher.json"

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions