Documentation
¶
Overview ¶
Package nodecheck provides code quality checks for Node.js projects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuditResult ¶
type AuditResult struct {
Metadata struct {
Vulnerabilities struct {
Total int `json:"total"`
Low int `json:"low"`
Moderate int `json:"moderate"`
High int `json:"high"`
Critical int `json:"critical"`
} `json:"vulnerabilities"`
} `json:"metadata"`
// npm 7+ format
Vulnerabilities map[string]interface{} `json:"vulnerabilities"`
}
AuditResult represents the npm audit JSON output.
type BuildCheck ¶
type BuildCheck struct {
Config *config.NodeLanguageConfig
}
BuildCheck verifies that Node.js dependencies can be installed.
func (*BuildCheck) ID ¶
func (c *BuildCheck) ID() string
ID returns the unique identifier for this check.
func (*BuildCheck) Name ¶
func (c *BuildCheck) Name() string
Name returns the human-readable name for this check.
type CoverageCheck ¶
type CoverageCheck struct {
Config *config.NodeLanguageConfig
Threshold float64
}
CoverageCheck measures test coverage for Node.js projects.
func (*CoverageCheck) ID ¶
func (c *CoverageCheck) ID() string
ID returns the unique identifier for this check.
func (*CoverageCheck) Name ¶
func (c *CoverageCheck) Name() string
Name returns the human-readable name for this check.
type DepsCheck ¶
type DepsCheck struct {
Config *config.NodeLanguageConfig
}
DepsCheck scans for security vulnerabilities in Node.js dependencies.
type FormatCheck ¶
type FormatCheck struct {
Config *config.NodeLanguageConfig
}
FormatCheck verifies code formatting with prettier or biome.
func (*FormatCheck) ID ¶
func (c *FormatCheck) ID() string
ID returns the unique identifier for this check.
func (*FormatCheck) Name ¶
func (c *FormatCheck) Name() string
Name returns the human-readable name for this check.
type LintCheck ¶
type LintCheck struct {
Config *config.NodeLanguageConfig
}
LintCheck runs linting on Node.js code.
type LoggingCheck ¶ added in v0.1.2
type LoggingCheck struct{}
LoggingCheck verifies proper logging practices in Node.js code.
func (*LoggingCheck) ID ¶ added in v0.1.2
func (c *LoggingCheck) ID() string
func (*LoggingCheck) Name ¶ added in v0.1.2
func (c *LoggingCheck) Name() string
type PackageJSON ¶
type PackageJSON struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Main string `json:"main"`
Scripts map[string]string `json:"scripts"`
Dependencies map[string]string `json:"dependencies"`
DevDependencies map[string]string `json:"devDependencies"`
}
PackageJSON represents the structure of a package.json file.
func ParsePackageJSON ¶
func ParsePackageJSON(path string) (*PackageJSON, error)
ParsePackageJSON reads and parses package.json from the given path.
type ProjectCheck ¶
type ProjectCheck struct{}
ProjectCheck verifies that package.json exists and is valid.
func (*ProjectCheck) ID ¶
func (c *ProjectCheck) ID() string
ID returns the unique identifier for this check.
func (*ProjectCheck) Name ¶
func (c *ProjectCheck) Name() string
Name returns the human-readable name for this check.
type TestsCheck ¶
type TestsCheck struct {
Config *config.NodeLanguageConfig
}
TestsCheck runs the project's test suite.
func (*TestsCheck) ID ¶
func (c *TestsCheck) ID() string
ID returns the unique identifier for this check.
func (*TestsCheck) Name ¶
func (c *TestsCheck) Name() string
Name returns the human-readable name for this check.
type TypeCheck ¶
type TypeCheck struct {
Config *config.NodeLanguageConfig
}
TypeCheck runs TypeScript compiler for type checking.
type YarnAuditLine ¶
type YarnAuditLine struct {
Type string `json:"type"`
Data struct {
Advisory struct {
ID int `json:"id"`
} `json:"advisory"`
Resolution struct {
ID int `json:"id"`
} `json:"resolution"`
} `json:"data"`
}
YarnAuditLine represents a line in yarn audit NDJSON output.