2.3.2 • Published 6 months ago

@rehearsal/codefixes v2.3.2

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
6 months ago

@rehearsal/codefixes

Rehearsal Dependency Transforms Collection based on TSC Diagnostic

Rehearsal leverages the TypeScript Language Service for file transformation. The supported transforms are enumerated in ./src/codefixesMessages.json. This file is used to generate runtime TypeScript code that is leveraged during transformation, tests and generates documentation.

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 in TypeScript.

  2. Open the file ./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 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.
  1. Create new directories in ./test/fixtures/ts-codefixes to add failing and passing fixtures for the newly added codefix.

  2. Write a test within ./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.

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

  4. 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.

1.2.0

9 months ago

1.0.5

10 months ago

1.2.2

9 months ago

1.2.1

9 months ago

2.2.0

8 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.1.1

10 months ago

1.1.0

10 months ago

2.3.0

7 months ago

2.1.1

8 months ago

2.3.2

6 months ago

2.3.1

6 months ago

2.1.0

9 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

3.0.5-beta

12 months ago

3.0.2-beta

12 months ago

1.0.4

11 months ago

1.0.3

11 months ago

3.0.0-beta

12 months ago

3.0.6-beta

12 months ago

2.0.2-beta

1 year ago

2.0.1-beta

1 year ago

3.0.1-beta

12 months ago

3.0.9-beta

11 months ago

3.0.4-beta

12 months ago

3.0.7-beta

12 months ago

3.0.3-beta

12 months ago

3.0.8-beta

11 months ago

1.0.16-beta

1 year ago

1.0.19-beta

1 year ago

1.0.20-beta

1 year ago

1.0.12-beta

1 year ago

2.0.0-beta

1 year ago

1.0.17-beta

1 year ago

1.0.14-beta

1 year ago

1.0.11-beta

1 year ago

1.0.18-beta

1 year ago

1.0.15-beta

1 year ago

1.0.13-beta

1 year ago

1.0.6-beta

1 year ago

1.0.7-beta

1 year ago

1.0.8-beta

1 year ago

1.0.5-beta

1 year ago

1.0.10-beta

1 year ago

1.0.9-beta

1 year ago

1.0.4-beta

1 year ago

1.0.1-beta

1 year ago

1.0.2-beta

1 year ago

1.0.0-beta

1 year ago

1.0.3-beta

1 year ago

0.0.37

2 years ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.36

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago