diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xbl-bindings.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xbl-bindings.js index 6cf7a1d7e3ce..d593709b03be 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xbl-bindings.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xbl-bindings.js @@ -261,10 +261,13 @@ module.exports = { } addSyntheticLine(indent(3) + `get ${item.attributes.name}() {`, item.textLine); - // TODO This will probably break some style rules when. We need - // to inject this next to the first non-whitespace character - addSyntheticLine(indent(4) + `return`, item.textLine); - addNodeLines(item, 4); + addSyntheticLine(indent(4) + `return (`, item.textLine); + + // Remove trailing semicolons, as we are adding our own + item.textContent = item.textContent.replace(/;(?=\s*$)/, ""); + addNodeLines(item, 5); + + addSyntheticLine(indent(4) + `);`, item.textLine); addSyntheticLine(indent(3) + `},`, item.textEndLine); break; } diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package.json b/tools/lint/eslint/eslint-plugin-mozilla/package.json index e41916c9b13b..79eb70dc903d 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-mozilla", - "version": "0.2.1", + "version": "0.2.2", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "keywords": [ "eslint",