From 8580bb99178c2dece69de9782d3be0adfd4eb075 Mon Sep 17 00:00:00 2001 From: Eric Hayes Date: Tue, 29 Nov 2022 13:47:44 -0600 Subject: [PATCH 1/2] ci: make linting not required --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c712fe5..3c3b87d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,6 @@ jobs: test: - needs: lint name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }} runs-on: ${{ matrix.os }} From 89a4155f96f00cd59f346f9cbb04659678aa8bb6 Mon Sep 17 00:00:00 2001 From: Eric Hayes Date: Tue, 29 Nov 2022 13:48:44 -0600 Subject: [PATCH 2/2] stylelint: report errors in the exitCode (#191) (#209) Without this flag, it's hard to determine programmatically (i.e. in CI) that our code didn't pass the linter. Co-authored-by: Evan Noronha --- src/linters/stylelint/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/linters/stylelint/index.js b/src/linters/stylelint/index.js index 449fd6c..81bb37b 100644 --- a/src/linters/stylelint/index.js +++ b/src/linters/stylelint/index.js @@ -22,6 +22,11 @@ function stylelint({fix} = {}) { ); } +function handleLinterFailure(error) { + process.exitCode = 1 + console.error(error); +} + module.exports.stylelint = stylelint; module.exports.runStylelint = function runStylelint() { @@ -29,7 +34,7 @@ module.exports.runStylelint = function runStylelint() { try { stylelint(); } catch (error) { - console.error(error); + handleLinterFailure(error); } }; @@ -38,6 +43,6 @@ module.exports.runStylelintFix = function runStylelintFix() { try { stylelint({fix: true}); } catch (error) { - console.error(error); + handleLinterFailure(error); } };