Commit eb163201 authored by Clement Bois's avatar Clement Bois 🥔
Browse files

fix: revert NODE_LINT_CACHE_ARGS

parent 9cd9971a
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -113,6 +113,8 @@ In addition to a textual report in the console, this job produces the following
| ------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `$NODE_PROJECT_DIR/reports/npm-audit.native.json` | [JSON](https://docs.npmjs.com/cli/v9/commands/npm-audit#json) | [DefectDojo integration](https://docs.defectdojo.com/supported_tools/parsers/file/npm_audit_7_plus/)<br/>_This report is generated only if DefectDojo template is detected, if needed, you can force it with `$DEFECTDOJO_NPMAUDIT_REPORTS`_ |

You might need to exclude cache folders like `.bun`. The way to exclude these files differs between tools (For `eslint` set `run lint --ignore-pattern .bun --ignore-pattern .yarn --ignore-pattern .npm` in `NODE_LINT_ARGS`).

### `node-build` job

The Node template features a job `node-build` that performs **build and tests** all at once. You can disable the build using the variable **NODE_BUILD_DISABLED**
+4 −6
Original line number Diff line number Diff line
@@ -739,8 +739,6 @@ node-build:
node-lint:
  extends: .node-base
  stage: build
  variables:
    NODE_LINT_CACHE_ARGS: --ignore-pattern .bun --ignore-pattern .yarn --ignore-pattern .npm
  script:
    - mkdir -p -m 777 reports
    # maybe generate ESLint report for SonarQube
@@ -752,9 +750,9 @@ node-lint:
        log_info "SonarQube detected: producing ESLint JSON report..."
        if [ "$NODE_MANAGER" = "pnpm" ]
        then
          $NODE_MANAGER $NODE_LINT_ARGS --format=json --output-file=reports/node-lint.xslint.json $NODE_LINT_CACHE_ARGS || true
          $NODE_MANAGER $NODE_LINT_ARGS --format=json --output-file=reports/node-lint.xslint.json || true
        else
          $NODE_MANAGER $NODE_LINT_ARGS -- --format=json --output-file=reports/node-lint.xslint.json $NODE_LINT_CACHE_ARGS || true
          $NODE_MANAGER $NODE_LINT_ARGS -- --format=json --output-file=reports/node-lint.xslint.json || true
        fi
      fi
    # maybe add eslint-formatter-gitlab
@@ -769,9 +767,9 @@ node-lint:
    - |
      if [ "$NODE_MANAGER" = "pnpm" ]
      then
        ESLINT_CODE_QUALITY_REPORT=reports/node-lint.gitlab.json $NODE_MANAGER $NODE_LINT_ARGS --format=gitlab $NODE_LINT_CACHE_ARGS
        ESLINT_CODE_QUALITY_REPORT=reports/node-lint.gitlab.json $NODE_MANAGER $NODE_LINT_ARGS --format=gitlab
      else
        ESLINT_CODE_QUALITY_REPORT=reports/node-lint.gitlab.json $NODE_MANAGER $NODE_LINT_ARGS -- --format=gitlab $NODE_LINT_CACHE_ARGS
        ESLINT_CODE_QUALITY_REPORT=reports/node-lint.gitlab.json $NODE_MANAGER $NODE_LINT_ARGS -- --format=gitlab
      fi
  artifacts:
    when: always # store artifact even if test Failed