eslint-plugin-mgw-eslint-rules 2.3.4 → 2.3.6

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.
package/dist/index.js CHANGED
@@ -44165,16 +44165,14 @@ var rule5 = createRule5({
44165
44165
  const parserServices = (0, import_utils5.getTemplateParserServices)(context);
44166
44166
  return {
44167
44167
  // Détecte les attributs ngClass dans les templates
44168
- "Element[attributes]"(node) {
44169
- const attributes = node.attributes;
44170
- for (const attr of attributes) {
44171
- if (attr.name === "ngClass" || attr.name === "ngStyle") {
44172
- const loc = parserServices.convertNodeSourceSpanToLoc(node.sourceSpan);
44173
- context.report({
44174
- loc,
44175
- messageId: attr.name === "ngClass" ? "preferClassBinding" : "preferStyleBinding"
44176
- });
44177
- }
44168
+ 'Element[name="div"]'(node) {
44169
+ const hasDataFoo = node.attributes.some((attr) => attr.name === "data-foo" && attr.value === "bar");
44170
+ if (!hasDataFoo) {
44171
+ const loc = parserServices.convertNodeSourceSpanToLoc(node.sourceSpan);
44172
+ context.report({
44173
+ loc,
44174
+ messageId: "preferClassBinding"
44175
+ });
44178
44176
  }
44179
44177
  }
44180
44178
  };