3.4.1 • Published 1 year ago
add-function-return-types v3.4.1
add-function-return-types
A CLI tool to add explicit return types to TypeScript functions.
Usage
Install the tool globally using npm:
npm install -g add-function-return-types
add-function-return-types [options]Or use it directly with npx:
npx add-function-return-types [options]By default, the tool:
- Uses the current working directory as the root path.
- Processes all .ts and .tsx files in the current directory recursively.
- Ignores node_modules and .d.ts files.
- Saves the files with updated return types.
Options
Base options
--shallow: Only process current directory.--overwrite: Overwrite functions with existing return types.
Ignore
--ignore-files <patterns>: Comma-separated list of file glob patterns to ignore.--ignore-functions <names>: Comma-separated list of function or method names to ignore during processing.--ignore-any: Ignore functions that return the any type.--ignore-unknown: Ignore functions that return the unknown type.--ignore-anonymous-objects: Ignore functions that return anonymous object types.--ignore-anonymous-functions: Ignore anonymous functions (functions without names).--ignore-expressions: Ignore function expressions (functions that are not part of a declaration).--ignore-functions-without-type-parameters: Ignore functions that don't have generic type parameters.--ignore-higher-order-functions: Ignore functions that immediately return another function expression.--ignore-typed-function-expressions: Ignore function expressions that already have type annotations on the variable.--ignore-iifes: Ignore immediately-invoked function expressions.--ignore-concise-arrow-function-expressions-starting-with-void: Ignore arrow functions that start with the void keyword.
Example
add-function-return-types --ignore-files "src/generated/**,tests/**" --ignore-functions "map,filter"Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License.
3.4.1
1 year ago
3.4.0
1 year ago
3.3.0
1 year ago
3.2.1
1 year ago
3.2.0
1 year ago
2.5.0
2 years ago
2.4.0
2 years ago
2.3.4
2 years ago
2.3.5
2 years ago
3.1.1
2 years ago
3.1.0
2 years ago
3.0.1
2 years ago
3.0.0
2 years ago
2.3.2
2 years ago
2.3.3
2 years ago
2.2.2
2 years ago
2.1.0
2 years ago
2.0.0
2 years ago
1.1.11
2 years ago
1.1.10
2 years ago
1.1.9
2 years ago
1.1.8
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.0.1
2 years ago
0.0.0
2 years ago