diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 5fd5a46ba493..de29a629c851 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -28,3 +28,18 @@ jobs: env: BUILD_TYPE: presubmit TEST_TYPE: units + lint: + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + with: + fetch-depth: 300 + persist-credentials: false + - name: Use Node.js 18 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + with: + node-version: 18 + - run: npm install + - run: npm run lint + name: Run monorepo linter diff --git a/bin/linter.mjs b/bin/linter.mjs index c9181cfde83b..a547f96c207c 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -45,9 +45,7 @@ async function run() { } catch (err) { console.error('\nLinter failed:', err.message); // Setting exit code 1 to indicate failure. In the CI pipeline, - // a non-zero exit code will cause the check to fail and block the PR. - // Note: TypeScript (tsc) compile failures and ESLint errors (severity 2) - // are blocking. + // continue-on-error is used to ensure this does not block PRs. process.exitCode = 1; } } @@ -114,27 +112,18 @@ async function checkEslint(filesToCheck) { } let hasBlockingErrors = false; - let hasFormattingErrors = false; for (const fileResult of results) { for (const message of fileResult.messages) { // message.severity === 2 indicates an error-level rule configuration. if (message.severity === 2) { hasBlockingErrors = true; - if (message.ruleId === 'prettier/prettier') { - hasFormattingErrors = true; - } } } } if (hasBlockingErrors) { - console.error('\n[ERROR] Blocking ESLint violations were detected. ESLint errors are blocking and must be fixed.'); - if (hasFormattingErrors) { - console.log( - `\nTo fix formatting issues, run:\n ./node_modules/.bin/eslint --fix ${filesToCheck.map(f => `"${f}"`).join(' ')}`, - ); - } + console.error('\n[ERROR] ESLint violations were detected.'); return false; }