open-index/open-npm huggingface dataset:
npm package: @rehearsal/action
Description: RehearsalJS GitHub Action
Latest version: 1.0.0

# Rehearsal GitHub Action

Runs Rehearsal Update to keep your TypeScript project ready for the latest TypeScript version. 

The action updates a project code where it's possible and creates tickets (issues) for issues that need engineer interaction.

Learn about [@rehearsal/migrate](https://github.com/rehearsal-js/rehearsal-js/tree/master/packages/migrate) if you want to migrate your project from JavaScript to TypeScript.

# Features

- Creates a Pull Request with code changes to make a project ready for the upcoming TypeScript version
- Opens Tickets (Issues) with suggested code changes have to be made by engineer
- Provides a report in [SARIF](https://github.com/microsoft/sarif-tutorials) format compatible with [Checkup](https://checkupjs.github.io/) and [SARIF Viewer for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=MS-SarifVSCode.sarif-viewer)  

# Usage

Create a `rehearsal.yml` file in `.github/workflows` directory to configure the action. 
See [action.yml](https://github.com/rehearsal-js/action/blob/master/action.yml) for available input parameters. 

The configuration could look like this:

```yaml
name: Rehearsal TS Upgrade

on:
  workflow_dispatch:
  schedule:
    - cron: '0 8 * * 1'

jobs:
  rehearse:
    name: Run Upgrade
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: rehearsal-js/action@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
```

# License

The scripts and documentation in this project has released under the [BSD-2-Clause](https://github.com/rehearsal-js/action/blob/master/LICENSE.md)
npm package: @rehearsal/cli
Description: Rehearsal CLI
Latest version: 2.3.2

# @rehearsal/cli

Rehearsal is a CLI tool with 3 commands (Graph | Move | Fix), which aim to improve the experience of both migrating to TypeScript and once migrated, upgrading your repo to future versions of TypeScript.

## Docs

https://github.com/rehearsal-js/rehearsal-js
npm package: @rehearsal/codefixes
Description: Rehearsal Dependency Codefixes Collection
Latest version: 2.3.2

# @rehearsal/codefixes

Rehearsal Dependency Transforms Collection based on [TSC Diagnostic](https://github.com/microsoft/TypeScript/blob/main/src/compiler/diagnosticMessages.json)

Rehearsal leverages the TypeScript Language Service for file transformation. The supported transforms are enumerated in [`./src/codefixesMessages.json`](./src/codefixesMessages.json). This file is used to generate runtime TypeScript code that is leveraged during transformation, tests and generates [documentation](../../Supported-Fixes.md).

# Adding New Codefixes in Rehearsal (TypeScript Language Service)

To add a new codefix to Rehearsal, which uses the TypeScript Language Service for file transformation, follow these steps:

1. Identify the codefix you want to add from the [list of codefixes](https://github.com/microsoft/TypeScript/tree/main/src/services/codefixes) in TypeScript.

2. Open the file [./src/codefixesMessages.json](./src/codefixesMessages.json) in Rehearsal and add a new entry with the following information:

- `entry key`: This should be the same as the codefix's `fixName`. You can find it from the values of the first parameter of `createCodeFixAction*` functions related to the codefix file.
- `title` and `description`: These will be used in the generated [Supported-Fixes.md](./Supported-Fixes.md) documentation.
- `messages`: These are the codes of messages related to the codefix. You can find them from the values of the third parameter of `createCodeFixAction*` functions in the codefix file.
- `diagnostics`: These are the diagnostic codes related to the codefix. You can find them from the values of the first parameter of the `registerCodeFix` function in the codefix file.

3. Create new directories in [./test/fixtures/ts-codefixes](./test/fixtures/ts-codefixes/) to add failing and passing fixtures for the newly added codefix.

4. Write a test within [./test/codefixes.test.ts](./test/codefixes.test.ts) to test the functionality of the codefix. It's essential to add the test for the codefix; otherwise, the test suite will fail.

5. Run `pnpm generate` command to regenerate the documentation and the runtime codefix objects.

6. Finally, run `pnpm test` to ensure that the newly added codefix passes all the tests. This step verifies the correctness and reliability of the codefix.

By following these steps, you can successfully add a new codefix to Rehearsal and make it available for use in TypeScript Language Service transformations.