Documentation
¶
Overview ¶
Package codemod provides helpers for codemods and project automation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CodemodCmd = &cobra.Command{
Use: "codemod",
Short: "Helpers for codemods and project automation",
Long: `Run codemods or setup helpers for various project types.`,
}
CodemodCmd is the root command for codemod-related helpers and automation.
View Source
var LintSetupCmd = &cobra.Command{ Use: "lint-setup", Short: "Setup linting and formatting for a Node.js project", Long: `Install and configure linting, formatting, and pre-commit hooks for a Node.js project (eslint, prettier, husky, etc).`, Run: func(cmd *cobra.Command, args []string) { if _, err := os.Stat("package.json"); errors.Is(err, os.ErrNotExist) { log.Error("package.json not found in current directory") return } if err := installLintDependencies(); err != nil { log.Error("npm install failed: %v", err) return } if err := writeESLintConfig(); err != nil { log.Error("Failed to write eslint.config.mjs: %v", err) return } if err := updatePackageJSON(); err != nil { log.Error("Failed to update package.json: %v", err) return } if err := setupHusky(); err != nil { log.Error("Failed to set up Husky: %v", err) return } log.Success("Linting, formatting, and pre-commit hooks are set up!") }, }
LintSetupCmd sets up linting, formatting, and pre-commit hooks for a Node.js project.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.