npm-groovy-lint
Version:
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files
31 lines (27 loc) • 539 B
JavaScript
// Unnecessary dot class
import { getStringRange } from "../utils.js";
const rule = {
range: {
type: "function",
func: (errLine, errItem) => {
return getStringRange(errLine, ".class", errItem);
},
},
fix: {
label: "Remove .class",
type: "replaceString",
before: ".class",
after: "",
},
tests: [
{
sourceBefore: `
def x = String.class
`,
sourceAfter: `
def x = String
`,
},
],
};
export { rule };