eslint-plugin-mgw-eslint-rules 2.3.10 → 2.3.12
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 +10 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44144,7 +44144,8 @@ var rule4 = createRule4({
|
|
|
44144
44144
|
// src/rules/prefer-const-enum.ts
|
|
44145
44145
|
var import_utils5 = __toESM(require_dist4());
|
|
44146
44146
|
var RULE_NAME5 = "prefer-const-enum";
|
|
44147
|
-
var
|
|
44147
|
+
var DOCS_RULES = "https://github.com/developpement-megao/mgw-eslint-rules/tree/main/docs/rules";
|
|
44148
|
+
var createRule5 = import_utils5.ESLintUtils.RuleCreator((name) => `${DOCS_RULES}/${name}.md`);
|
|
44148
44149
|
var rule5 = createRule5({
|
|
44149
44150
|
name: RULE_NAME5,
|
|
44150
44151
|
meta: {
|
|
@@ -44207,8 +44208,8 @@ var rule6 = createRule6({
|
|
|
44207
44208
|
recommended: true
|
|
44208
44209
|
},
|
|
44209
44210
|
messages: {
|
|
44210
|
-
preferClassBinding: "Pr\xE9f\xE9rez '[class.<nom>]' ou '[class]' \xE0 '
|
|
44211
|
-
preferStyleBinding: "Pr\xE9f\xE9rez '[style.<prop>]' ou '[style]' \xE0 '
|
|
44211
|
+
preferClassBinding: "Pr\xE9f\xE9rez '[class.<nom>]' ou '[class]' \xE0 'ngClass'.",
|
|
44212
|
+
preferStyleBinding: "Pr\xE9f\xE9rez '[style.<prop>]' ou '[style]' \xE0 'ngStyle'."
|
|
44212
44213
|
},
|
|
44213
44214
|
schema: []
|
|
44214
44215
|
},
|
|
@@ -44216,15 +44217,15 @@ var rule6 = createRule6({
|
|
|
44216
44217
|
create(context) {
|
|
44217
44218
|
const parserServices = (0, import_utils6.getTemplateParserServices)(context);
|
|
44218
44219
|
return {
|
|
44219
|
-
// Détecte les attributs ngClass dans les templates
|
|
44220
|
-
|
|
44221
|
-
const
|
|
44222
|
-
for (const
|
|
44223
|
-
if (
|
|
44220
|
+
// Détecte les attributs ngClass et ngStyle et inputs [ngClass] et [ngStyle] dans les templates
|
|
44221
|
+
Element(node) {
|
|
44222
|
+
const attributesAndInputs = [...node.attributes, ...node.inputs];
|
|
44223
|
+
for (const attr of attributesAndInputs) {
|
|
44224
|
+
if (attr.name === "ngClass" || attr.name === "ngStyle") {
|
|
44224
44225
|
const loc = parserServices.convertNodeSourceSpanToLoc(node.sourceSpan);
|
|
44225
44226
|
context.report({
|
|
44226
44227
|
loc,
|
|
44227
|
-
messageId:
|
|
44228
|
+
messageId: attr.name === "ngClass" ? "preferClassBinding" : "preferStyleBinding"
|
|
44228
44229
|
});
|
|
44229
44230
|
}
|
|
44230
44231
|
}
|