3.4.1 • Published 9 months 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
9 months ago
3.4.0
9 months ago
3.3.0
9 months ago
3.2.1
9 months ago
3.2.0
9 months ago
2.5.0
10 months ago
2.4.0
10 months ago
2.3.4
10 months ago
2.3.5
10 months ago
3.1.1
10 months ago
3.1.0
10 months ago
3.0.1
10 months ago
3.0.0
10 months ago
2.3.2
10 months ago
2.3.3
10 months ago
2.2.2
10 months ago
2.1.0
10 months ago
2.0.0
10 months ago
1.1.11
10 months ago
1.1.10
10 months ago
1.1.9
10 months ago
1.1.8
10 months ago
1.1.7
10 months ago
1.1.6
10 months ago
1.1.5
10 months ago
1.1.4
10 months ago
1.1.3
10 months ago
1.1.2
10 months ago
1.1.1
10 months ago
1.1.0
10 months ago
1.0.1
10 months ago
1.0.0
10 months ago
0.0.1
10 months ago
0.0.0
10 months ago