diff --git a/.github/problem-matchers/stylelint.json b/.github/problem-matchers/stylelint.json new file mode 100644 index 00000000..193cc1a2 --- /dev/null +++ b/.github/problem-matchers/stylelint.json @@ -0,0 +1,21 @@ +{ + "problemMatcher": [ + { + "owner": "stylelint", + "pattern": [ + { + "regexp": "^([^\\s].*)$", + "file": 1 + }, + { + "regexp": "^\\s*(\\d+):(\\d+)\\s+(\\S+)\\s+(.+?)\\s+(\\S+)$", + "line": 1, + "column": 2, + "message": 4, + "code": 5, + "loop": true + } + ] + } + ] +} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 5f910277..e9d494a9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -21,6 +21,9 @@ concurrency: jobs: lint-check: runs-on: "ubuntu-latest" + env: + STYLELINT_MATCHER_OWNER: "stylelint" + STYLELINT_MATCHER_PATH: "./.github/problem-matchers/stylelint.json" steps: - uses: "actions/checkout@v4" with: @@ -29,4 +32,13 @@ jobs: with: node-version: 22 - run: "npm clean-install" - - run: "npm run lint:ci" + - name: "Set up Stylelint Problem Matcher" + run: "echo '::add-matcher::${{env.STYLELINT_MATCHER_PATH}}'" + - name: "Run `lint:check` script." + run: |- + # Disable ANSI color codes in Stylelint default "string" formatter + export NO_COLOR=1 + npm run lint:check + - if: "always()" + name: "Remove Stylelint Problem Matcher" + run: "echo '::remove-matcher owner=${{env.STYLELINT_MATCHER_OWNER}}::'" diff --git a/package.json b/package.json index c828ab46..8e373e2c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "lint:check": "npm-run-all --sequential --continue-on-error lint:check:*", "lint:check:css": "stylelint src/**/*.css", "lint:check:js": "eslint . --max-warnings 0", - "lint:ci": "npm-run-all --sequential --continue-on-error lint:check:js \"lint:check:css -- --formatter github\"", "lint:fix": "npm-run-all --parallel --continue-on-error \"lint:check:* -- --fix\"", "start": "webpack serve --open --config webpack.dev.js", "test": "jest"