TypeScriptFormatter class
Formats a TypeScript project — but only when the project opts in.
When the project's package.json declares the matching script, that
script is run (<pm> run format locally, <pm> run format:check on
GitHub runners) so each repo controls its own formatting. When no such
script exists, formatting is skipped — gg never invokes eslint (or any
other tool) directly. TypeScript linting is driven by the project's
lint script in the analyze step instead.
Constructors
- TypeScriptFormatter({GgProcessWrapper processWrapper = const GgProcessWrapper(), bool isGitHub()?, TypeScriptPackageManager packageManager(Directory)?})
-
Constructor.
const
- TypeScriptFormatter.example()
-
Example instance for tests — uses the real default process wrapper and
package-manager detection.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- processWrapper → GgProcessWrapper
-
The process wrapper used to execute shell processes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
{required Directory directory, required GgLog ggLog}) → Future< void> -
Runs the formatter against
directory. Throws on failure.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited