Skip to content

fix(eslint-plugin): [unified-signatures] no parameters function #10881

fix(eslint-plugin): [unified-signatures] no parameters function

fix(eslint-plugin): [unified-signatures] no parameters function #10881

Workflow file for this run

name: CI
on:
push:
branches:
- main
- v6
pull_request:
branches:
- '**'
merge_group:
env:
PRIMARY_NODE_VERSION: 18
# Only set the read-write token if we are on the main branch
NX_CLOUD_ACCESS_TOKEN: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && secrets.NX_CLOUD_ACCESS_TOKEN || '' }}
defaults:
run:
shell: bash
#
# Workflow for how the CI spawns jobs:
# 1) Run the install and cache the install artefacts
# 2) Run the build and cache the output
# - In parallel we also any steps that don't need the build (like prettier)
# 3) Run the steps that depend on the build
#
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
install:
name: Checkout and Install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
build:
name: Build All Packages
needs: [install]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
uses: ./.github/actions/prepare-build
lint_without_build:
name: Lint
needs: [install]
runs-on: ubuntu-latest
strategy:
matrix:
lint-task: ['check-spelling', 'check-format', 'lint-markdown']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Run Check
run: yarn ${{ matrix.lint-task }}
lint_with_build:
name: Lint
# because we lint with our own tooling, we need to build
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
lint-task: ['lint', 'typecheck']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
uses: ./.github/actions/prepare-build
- name: Run Check
run: yarn ${{ matrix.lint-task }}
integration_tests:
name: Run integration tests on primary Node.js version
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
uses: ./.github/actions/prepare-build
- name: Run integrations tests
run: yarn test-integration
env:
CI: true
unit_tests:
name: Run Unit Tests
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
# just run on the oldest and latest supported versions and assume the intermediate versions are good
node-version: [14, 18]
package:
[
'ast-spec',
'eslint-plugin',
'eslint-plugin-internal',
'eslint-plugin-tslint',
'parser',
'scope-manager',
'type-utils',
'typescript-estree',
'utils',
'visitor-keys',
]
env:
# Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app
NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -'
COLLECT_COVERAGE: false
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ matrix.node-version }}
- name: Build
uses: ./.github/actions/prepare-build
# collect coverage on the primary node version
# we don't collect coverage on other node versions so they run faster
# note that we don't do this as a single `run` with a flag because some
# packages don't collect coverage on purpose, so forcing `--coverage=true`
# would override the config
- name: Run unit tests with coverage for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION == matrix.node-version
run: npx nx test ${{ matrix.package }}
env:
CI: true
- name: Run unit tests for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION != matrix.node-version
run: npx nx test ${{ matrix.package }} --coverage=false
env:
CI: true
- name: Store coverage for uploading
if: env.PRIMARY_NODE_VERSION == matrix.node-version
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.package }}-coverage
path: packages/${{ matrix.package }}/coverage/lcov.info
# Sadly 1 day is the minimum
retention-days: 1
## TODO - re-enable once we fix them
# https://github.com/typescript-eslint/typescript-eslint/issues/6508
# website_tests:
# permissions:
# contents: read # to fetch code (actions/checkout)
# name: Website tests
# # We technically do not need to wait for build within the pipeline any more because the build we care about is happening within Netlify, however,
# # it is highly likely that if the CI one fails, the Netlify one will as well, so in order to not waste unncessary Github Actions minutes/resources,
# # we do still keep this requirement here.
# needs: [build]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 2
# - name: Install
# uses: ./.github/actions/prepare-install
# with:
# node-version: ${{ env.PRIMARY_NODE_VERSION }}
# - name: Install Playwright Browsers
# run: npx playwright install --with-deps
# - name: Wait for Netlify deployment
# uses: probablyup/wait-for-netlify-action@v3.4.0
# id: waitForDeployment
# with:
# site_id: '128d21c7-b2fe-45ad-b141-9878fcf5de3a'
# max_timeout: 300 # 5 minutes
# env:
# NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
# - name: Run Playwright tests against the Netlify deployment
# run: yarn playwright test --reporter=list
# working-directory: packages/website
# env:
# PLAYWRIGHT_TEST_BASE_URL: ${{ steps.waitForDeployment.outputs.url }}
# - if: always()
# uses: actions/upload-artifact@v3
# with:
# name: playwright-report
# path: packages/website/playwright-report
upload_coverage:
name: Upload Codecov Coverage
needs: [unit_tests]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download coverage reports
uses: actions/download-artifact@v3
with:
path: coverage
- name: Publish code coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/**/lcov.info
flags: unittest
name: codecov
publish_canary_version:
name: Publish the latest code as a canary version
runs-on: ubuntu-latest
needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Build
uses: ./.github/actions/prepare-build
# Fetch all history for all tags and branches in this job because lerna needs it
- run: |
git fetch --prune --unshallow
- name: Publish all packages to npm
run: npx lerna publish --loglevel=verbose --canary --exact --force-publish --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish_canary_version_v6:
name: Publish the next major version code as a canary version
runs-on: ubuntu-latest
needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
if: github.ref == 'refs/heads/v6'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Build
uses: ./.github/actions/prepare-build
# Fetch all history for all tags and branches in this job because lerna needs it
- run: |
git fetch --prune --unshallow
- name: Publish all packages to npm
run: npx lerna publish premajor --loglevel=verbose --canary --exact --force-publish --yes --dist-tag rc-v6
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}