Lint, format, and auto-fix Groovy, Jenkinsfile, and Gradle files. Current stable version 17.0.4 (released Dec 2024). Based on CodeNarc, it provides out-of-the-box linting with over 300 rules, formatting (--format), and auto-fixing (--fix). Unlike the Groovy compiler or code-narc CLI, it integrates directly into Node.js workflows, CI/CD pipelines, and editor extensions (VS Code). Ships TypeScript types. Release cadence is irregular with multiple patches per year. Requires Node >= 22.0.0 and Java (17-24) for CodeNarc.
npm install npm-groovy-lintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates linting a Groovy source string with auto-fix and formatting enabled.
Upgrade Node.js to version 22 or later.
Use import statements; ensure package.json has "type": "module".
Install Java runtime and set JAVA_HOME if not already set.
Review rule configurations; run with --verbose to see rule changes.
Review fixed output manually; upgrade to v15.2.2+ for partial fixes.
Pull from ghcr.io/nvuillam/npm-groovy-lint instead of Docker Hub.
Run `npm install npm-groovy-lint` and ensure using ESM import (e.g., `import { NpmGroovyLint } from 'npm-groovy-lint'`).Change to `import { NpmGroovyLint } from 'npm-groovy-lint'` (ESM) or `const { NpmGroovyLint } = await import('npm-groovy-lint')`.Install Java 17-24 and set JAVA_HOME. Verify with `java -version`.