feat: support preprocessors in configuration #420
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Legacy pipeline: knip v5 has typescript and @types/node as peer dependencies | |
| name: Tests (against typescript@5.0.4 in Node.js v20) | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: &paths # All package sources (knip lints across the monorepo and analyzes the repo itself) | |
| - 'packages/**' | |
| - '!packages/docs/**/*.md' | |
| - '!packages/docs/**/*.mdx' | |
| # Root workspace / dependency / lint / knip-on-self config | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - 'pnpm-workspace.yaml' | |
| - '.oxlintrc.json' | |
| - '.oxfmtrc.json' | |
| - 'knip.json' | |
| # This workflow file | |
| - '.github/workflows/ci-legacy-5.0.4.yml' | |
| push: | |
| branches: | |
| - '**' | |
| paths: *paths | |
| # Automatically cancel in-progress actions on the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: | |
| - macos-latest | |
| - ubuntu-latest | |
| - windows-latest | |
| node: | |
| - 20 | |
| - 22 | |
| runs-on: ${{ matrix.os }} | |
| name: ${{ matrix.os }} (Node v${{ matrix.node }}) | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5 | |
| with: | |
| version: 10 | |
| package_json_file: packages/knip/package.json | |
| - run: echo "manage-package-manager-versions=false" >> .npmrc | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build knip | |
| run: pnpm run build | |
| working-directory: packages/knip | |
| - name: Install earliest supported peer dependencies | |
| run: pnpm add typescript@5.0.4 @types/node@20 --config.trustPolicy=allow | |
| working-directory: packages/knip | |
| - name: Type-check against TS 5.0.4 | |
| run: | | |
| node -e "let f=require('fs'),p='tsconfig.json';f.writeFileSync(p,f.readFileSync(p,'utf8').replace(/.*(?:rewriteRelativeImportExtensions|erasableSyntaxOnly).*\n/g,''))" | |
| pnpm tsc --noEmit | |
| working-directory: packages/knip | |
| - name: Test knip | |
| run: pnpm test --runtime node --smoke | |
| working-directory: packages/knip | |
| - name: Run knip | |
| run: ./packages/knip/bin/knip.js --reporter github-actions | |
| - name: Run knip in strict mode | |
| run: ./packages/knip/bin/knip.js --production --strict |