@yoo-digital/eslint-plugin-angular 3.0.3 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,13 +65,17 @@ exports.requireBooleanAttributeTransformRule = {
65
65
  messageId: 'requireTransformDecorator',
66
66
  data: { name: propertyName },
67
67
  fix(fixer) {
68
- const decoratorNode = inputDecorator?.expression;
69
- if (!decoratorNode || decoratorNode.type !== 'CallExpression') {
68
+ if (!inputDecorator) {
70
69
  return null;
71
70
  }
72
- const decoratorStart = decoratorNode.range[0];
73
- const decoratorEnd = decoratorNode.range[1];
74
- // Generate the fixed decorator
71
+ const decoratorNode = inputDecorator.expression;
72
+ if (decoratorNode.type !== 'CallExpression') {
73
+ return null;
74
+ }
75
+ // Use the decorator's range (includes @) not just the expression
76
+ const decoratorStart = inputDecorator.range[0];
77
+ const decoratorEnd = inputDecorator.range[1];
78
+ // Generate the fixed decorator (without @ since we're replacing the full decorator)
75
79
  let newDecorator;
76
80
  if (decoratorNode.arguments.length === 0) {
77
81
  // @Input() → @Input({ transform: booleanAttribute })
@@ -146,7 +150,7 @@ exports.requireBooleanAttributeTransformRule = {
146
150
  // Get the default value argument
147
151
  const defaultValue = callExpr.arguments[0] ? sourceCode.getText(callExpr.arguments[0]) : 'false';
148
152
  // Build the new call expression
149
- const newCall = `input<boolean, BooleanInput>(${defaultValue}, {\\n transform: booleanAttribute,\\n })`;
153
+ const newCall = `input<boolean, BooleanInput>(${defaultValue}, { transform: booleanAttribute })`;
150
154
  return fixer.replaceTextRange([callStart, callEnd], newCall);
151
155
  },
152
156
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoo-digital/eslint-plugin-angular",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "Yoo Digital custom Angular ESLint plugin for enforcing boolean attribute best practices.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",