eslint-plugin-mgw-eslint-rules 2.3.10 → 2.3.11
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 +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44216,15 +44216,15 @@ var rule6 = createRule6({
|
|
|
44216
44216
|
create(context) {
|
|
44217
44217
|
const parserServices = (0, import_utils6.getTemplateParserServices)(context);
|
|
44218
44218
|
return {
|
|
44219
|
-
// Détecte les attributs ngClass dans les templates
|
|
44220
|
-
|
|
44221
|
-
const
|
|
44222
|
-
for (const
|
|
44223
|
-
if (
|
|
44219
|
+
// Détecte les attributs ngClass et ngStyle et inputs [ngClass] et [ngStyle] dans les templates
|
|
44220
|
+
Element(node) {
|
|
44221
|
+
const attributesAndInputs = [...node.attributes, ...node.inputs];
|
|
44222
|
+
for (const attr of attributesAndInputs) {
|
|
44223
|
+
if (attr.name === "ngClass" || attr.name === "ngStyle") {
|
|
44224
44224
|
const loc = parserServices.convertNodeSourceSpanToLoc(node.sourceSpan);
|
|
44225
44225
|
context.report({
|
|
44226
44226
|
loc,
|
|
44227
|
-
messageId:
|
|
44227
|
+
messageId: attr.name === "ngClass" ? "preferClassBinding" : "preferStyleBinding"
|
|
44228
44228
|
});
|
|
44229
44229
|
}
|
|
44230
44230
|
}
|