eslint-plugin-mgw-eslint-rules 2.3.34 → 2.3.35
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 +180 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +180 -70
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3200,11 +3200,11 @@ var require_getParserServices = __commonJS({
|
|
|
3200
3200
|
"node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js"(exports2) {
|
|
3201
3201
|
"use strict";
|
|
3202
3202
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3203
|
-
exports2.getParserServices =
|
|
3203
|
+
exports2.getParserServices = getParserServices4;
|
|
3204
3204
|
var parserSeemsToBeTSESLint_1 = require_parserSeemsToBeTSESLint();
|
|
3205
3205
|
var ERROR_MESSAGE_REQUIRES_PARSER_SERVICES = "You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://tseslint.com/typed-linting for enabling linting with type information.";
|
|
3206
3206
|
var ERROR_MESSAGE_UNKNOWN_PARSER = 'Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.';
|
|
3207
|
-
function
|
|
3207
|
+
function getParserServices4(context, allowWithoutFullTypeInformation = false) {
|
|
3208
3208
|
const parser = context.parserPath || context.languageOptions.parser?.meta?.name;
|
|
3209
3209
|
if (context.sourceCode.parserServices?.esTreeNodeToTSNodeMap == null || context.sourceCode.parserServices.tsNodeToESTreeNodeMap == null) {
|
|
3210
3210
|
throwError(parser);
|
|
@@ -3261,8 +3261,8 @@ var require_RuleCreator = __commonJS({
|
|
|
3261
3261
|
exports2.RuleCreator = RuleCreator;
|
|
3262
3262
|
var applyDefault_1 = require_applyDefault();
|
|
3263
3263
|
function RuleCreator(urlCreator) {
|
|
3264
|
-
return function createNamedRule({ meta, name, ...
|
|
3265
|
-
const ruleWithDocs =
|
|
3264
|
+
return function createNamedRule({ meta, name, ...rule12 }) {
|
|
3265
|
+
const ruleWithDocs = createRule12({
|
|
3266
3266
|
meta: {
|
|
3267
3267
|
...meta,
|
|
3268
3268
|
docs: {
|
|
@@ -3271,12 +3271,12 @@ var require_RuleCreator = __commonJS({
|
|
|
3271
3271
|
}
|
|
3272
3272
|
},
|
|
3273
3273
|
name,
|
|
3274
|
-
...
|
|
3274
|
+
...rule12
|
|
3275
3275
|
});
|
|
3276
3276
|
return ruleWithDocs;
|
|
3277
3277
|
};
|
|
3278
3278
|
}
|
|
3279
|
-
function
|
|
3279
|
+
function createRule12({
|
|
3280
3280
|
create,
|
|
3281
3281
|
// Keep accepting deprecated defaultOptions for backward compatibility.
|
|
3282
3282
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -3296,7 +3296,7 @@ var require_RuleCreator = __commonJS({
|
|
|
3296
3296
|
};
|
|
3297
3297
|
}
|
|
3298
3298
|
RuleCreator.withoutDocs = function withoutDocs(args) {
|
|
3299
|
-
return
|
|
3299
|
+
return createRule12(args);
|
|
3300
3300
|
};
|
|
3301
3301
|
}
|
|
3302
3302
|
});
|
|
@@ -20621,13 +20621,13 @@ ${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;
|
|
|
20621
20621
|
}
|
|
20622
20622
|
_scopeKeyframesRelatedCss(cssText, scopeSelector) {
|
|
20623
20623
|
const unscopedKeyframesSet = /* @__PURE__ */ new Set();
|
|
20624
|
-
const scopedKeyframesCssText = processRules(cssText, (
|
|
20625
|
-
return processRules(scopedKeyframesCssText, (
|
|
20624
|
+
const scopedKeyframesCssText = processRules(cssText, (rule12) => this._scopeLocalKeyframeDeclarations(rule12, scopeSelector, unscopedKeyframesSet));
|
|
20625
|
+
return processRules(scopedKeyframesCssText, (rule12) => this._scopeAnimationRule(rule12, scopeSelector, unscopedKeyframesSet));
|
|
20626
20626
|
}
|
|
20627
|
-
_scopeLocalKeyframeDeclarations(
|
|
20627
|
+
_scopeLocalKeyframeDeclarations(rule12, scopeSelector, unscopedKeyframesSet) {
|
|
20628
20628
|
return {
|
|
20629
|
-
...
|
|
20630
|
-
selector:
|
|
20629
|
+
...rule12,
|
|
20630
|
+
selector: rule12.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => {
|
|
20631
20631
|
unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));
|
|
20632
20632
|
return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;
|
|
20633
20633
|
})
|
|
@@ -20640,8 +20640,8 @@ ${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;
|
|
|
20640
20640
|
});
|
|
20641
20641
|
}
|
|
20642
20642
|
_animationDeclarationKeyframesRe = /(^|\s+|,)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
|
|
20643
|
-
_scopeAnimationRule(
|
|
20644
|
-
let content =
|
|
20643
|
+
_scopeAnimationRule(rule12, scopeSelector, unscopedKeyframesSet) {
|
|
20644
|
+
let content = rule12.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation\s*:\s*),*([^;]+)/g, (_, start, animationDeclarations) => start + animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = "", quotedName, nonQuotedName) => {
|
|
20645
20645
|
if (quotedName) {
|
|
20646
20646
|
return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;
|
|
20647
20647
|
} else {
|
|
@@ -20650,7 +20650,7 @@ ${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;
|
|
|
20650
20650
|
}));
|
|
20651
20651
|
content = content.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes.split(",").map((keyframe) => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet)).join(",")}`);
|
|
20652
20652
|
return {
|
|
20653
|
-
...
|
|
20653
|
+
...rule12,
|
|
20654
20654
|
content
|
|
20655
20655
|
};
|
|
20656
20656
|
}
|
|
@@ -20661,8 +20661,8 @@ ${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;
|
|
|
20661
20661
|
}
|
|
20662
20662
|
_insertPolyfillRulesInCssText(cssText) {
|
|
20663
20663
|
return cssText.replace(_cssContentRuleRe, (...m) => {
|
|
20664
|
-
const
|
|
20665
|
-
return m[4] +
|
|
20664
|
+
const rule12 = m[0].replace(m[1], "").replace(m[2], "");
|
|
20665
|
+
return m[4] + rule12;
|
|
20666
20666
|
});
|
|
20667
20667
|
}
|
|
20668
20668
|
_scopeCssText(cssText, scopeSelector, hostSelector) {
|
|
@@ -20683,8 +20683,8 @@ ${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;
|
|
|
20683
20683
|
let m;
|
|
20684
20684
|
_cssContentUnscopedRuleRe.lastIndex = 0;
|
|
20685
20685
|
while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {
|
|
20686
|
-
const
|
|
20687
|
-
r +=
|
|
20686
|
+
const rule12 = m[0].replace(m[2], "").replace(m[1], m[4]);
|
|
20687
|
+
r += rule12 + "\n\n";
|
|
20688
20688
|
}
|
|
20689
20689
|
return r;
|
|
20690
20690
|
}
|
|
@@ -20769,28 +20769,28 @@ ${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;
|
|
|
20769
20769
|
return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, " "), cssText);
|
|
20770
20770
|
}
|
|
20771
20771
|
_scopeSelectors(cssText, scopeSelector, hostSelector) {
|
|
20772
|
-
return processRules(cssText, (
|
|
20773
|
-
let selector =
|
|
20774
|
-
let content =
|
|
20775
|
-
if (
|
|
20772
|
+
return processRules(cssText, (rule12) => {
|
|
20773
|
+
let selector = rule12.selector;
|
|
20774
|
+
let content = rule12.content;
|
|
20775
|
+
if (rule12.selector[0] !== "@") {
|
|
20776
20776
|
selector = this._scopeSelector({
|
|
20777
20777
|
selector,
|
|
20778
20778
|
scopeSelector,
|
|
20779
20779
|
hostSelector,
|
|
20780
20780
|
isParentSelector: true
|
|
20781
20781
|
});
|
|
20782
|
-
} else if (scopedAtRuleIdentifiers.some((atRule) =>
|
|
20783
|
-
content = this._scopeSelectors(
|
|
20784
|
-
} else if (
|
|
20785
|
-
content = this._stripScopingSelectors(
|
|
20782
|
+
} else if (scopedAtRuleIdentifiers.some((atRule) => rule12.selector.startsWith(atRule))) {
|
|
20783
|
+
content = this._scopeSelectors(rule12.content, scopeSelector, hostSelector);
|
|
20784
|
+
} else if (rule12.selector.startsWith("@font-face") || rule12.selector.startsWith("@page")) {
|
|
20785
|
+
content = this._stripScopingSelectors(rule12.content);
|
|
20786
20786
|
}
|
|
20787
20787
|
return new CssRule(selector, content);
|
|
20788
20788
|
});
|
|
20789
20789
|
}
|
|
20790
20790
|
_stripScopingSelectors(cssText) {
|
|
20791
|
-
return processRules(cssText, (
|
|
20792
|
-
const selector =
|
|
20793
|
-
return new CssRule(selector,
|
|
20791
|
+
return processRules(cssText, (rule12) => {
|
|
20792
|
+
const selector = rule12.selector.replace(_shadowDeepSelectors, " ").replace(_polyfillHostNoCombinatorRe, " ");
|
|
20793
|
+
return new CssRule(selector, rule12.content);
|
|
20794
20794
|
});
|
|
20795
20795
|
}
|
|
20796
20796
|
_safeSelector;
|
|
@@ -21051,8 +21051,8 @@ ${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;
|
|
|
21051
21051
|
suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
|
|
21052
21052
|
contentPrefix = "{";
|
|
21053
21053
|
}
|
|
21054
|
-
const
|
|
21055
|
-
return `${m[1]}${
|
|
21054
|
+
const rule12 = ruleCallback(new CssRule(selector, content));
|
|
21055
|
+
return `${m[1]}${rule12.selector}${m[3]}${contentPrefix}${rule12.content}${suffix}`;
|
|
21056
21056
|
});
|
|
21057
21057
|
return unescapeInStrings(escapedResult);
|
|
21058
21058
|
}
|
|
@@ -44034,7 +44034,9 @@ var rule3 = createRule3({
|
|
|
44034
44034
|
meta: {
|
|
44035
44035
|
type: "problem",
|
|
44036
44036
|
docs: {
|
|
44037
|
-
description: "Enforce correct usage of Angular signals"
|
|
44037
|
+
description: "Enforce correct usage of Angular signals",
|
|
44038
|
+
recommended: true,
|
|
44039
|
+
requiresTypeChecking: true
|
|
44038
44040
|
},
|
|
44039
44041
|
messages: {
|
|
44040
44042
|
useGetter: "Use the getter function to access the value of Angular signal"
|
|
@@ -44191,13 +44193,120 @@ var rule5 = createRule5({
|
|
|
44191
44193
|
}
|
|
44192
44194
|
});
|
|
44193
44195
|
|
|
44194
|
-
// src/rules/
|
|
44196
|
+
// src/rules/no-list-suffix.ts
|
|
44195
44197
|
var import_utils6 = __toESM(require_dist4());
|
|
44196
|
-
var
|
|
44197
|
-
var
|
|
44198
|
-
var createRule6 = import_utils6.ESLintUtils.RuleCreator((name) =>
|
|
44198
|
+
var import_eslint_utils2 = __toESM(require_eslint_utils3());
|
|
44199
|
+
var RULE_NAME6 = "no-list-suffix";
|
|
44200
|
+
var createRule6 = import_utils6.ESLintUtils.RuleCreator((name) => `https://github.com/developpement-megao/mgw-eslint-rules/docs/rules/${name}.md`);
|
|
44199
44201
|
var rule6 = createRule6({
|
|
44200
44202
|
name: RULE_NAME6,
|
|
44203
|
+
meta: {
|
|
44204
|
+
type: "suggestion",
|
|
44205
|
+
fixable: "code",
|
|
44206
|
+
docs: {
|
|
44207
|
+
description: "Naming convention for reactive variables and properties (name must end with $ and $$ for WritableSignals and Subjects)",
|
|
44208
|
+
recommended: true,
|
|
44209
|
+
requiresTypeChecking: true
|
|
44210
|
+
},
|
|
44211
|
+
messages: {
|
|
44212
|
+
noListSuffix: "Suffix `list` is not allowed in iterable `{{ name }}`.",
|
|
44213
|
+
mustEndWithS: "Iterable `{{ name }}` must end with an `s`."
|
|
44214
|
+
},
|
|
44215
|
+
schema: []
|
|
44216
|
+
// No options
|
|
44217
|
+
},
|
|
44218
|
+
defaultOptions: [],
|
|
44219
|
+
create(context) {
|
|
44220
|
+
const services = (0, import_eslint_utils2.getParserServices)(context);
|
|
44221
|
+
const checker = services.program.getTypeChecker();
|
|
44222
|
+
const listeArraysTypes = ["Array", "ReadonlyArray", "ArrayLike", "Set", "ReadonlySet", "Map", "ReadonlyMap"];
|
|
44223
|
+
function getTypeWithoutGeneric(type) {
|
|
44224
|
+
return type.split("<")[0];
|
|
44225
|
+
}
|
|
44226
|
+
function fixNodeName(node, name) {
|
|
44227
|
+
const sourceCode = context.sourceCode;
|
|
44228
|
+
const scope = sourceCode.getScope(node);
|
|
44229
|
+
const fixes = [];
|
|
44230
|
+
fixes.push(node);
|
|
44231
|
+
let variable;
|
|
44232
|
+
let current = scope;
|
|
44233
|
+
while (current) {
|
|
44234
|
+
variable = current.variables.find((v) => v.name === name);
|
|
44235
|
+
if (variable) {
|
|
44236
|
+
for (const ref of variable.references) {
|
|
44237
|
+
const refNode = ref.identifier;
|
|
44238
|
+
if (refNode !== node) {
|
|
44239
|
+
fixes.push(refNode);
|
|
44240
|
+
}
|
|
44241
|
+
}
|
|
44242
|
+
break;
|
|
44243
|
+
}
|
|
44244
|
+
if (!current.upper) {
|
|
44245
|
+
break;
|
|
44246
|
+
}
|
|
44247
|
+
current = current.upper;
|
|
44248
|
+
}
|
|
44249
|
+
return fixes;
|
|
44250
|
+
}
|
|
44251
|
+
function checkNode(node) {
|
|
44252
|
+
const name = node.name;
|
|
44253
|
+
if (!name || name === "_") {
|
|
44254
|
+
return;
|
|
44255
|
+
}
|
|
44256
|
+
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
|
|
44257
|
+
const type = checker.getTypeAtLocation(tsNode);
|
|
44258
|
+
const typeName = checker.typeToString(type);
|
|
44259
|
+
const typeNameWithoutGeneric = getTypeWithoutGeneric(typeName);
|
|
44260
|
+
if (!typeNameWithoutGeneric || !listeArraysTypes.includes(typeNameWithoutGeneric)) {
|
|
44261
|
+
return;
|
|
44262
|
+
}
|
|
44263
|
+
const listSuffixRegexp = /liste?$/i;
|
|
44264
|
+
if (listSuffixRegexp.test(name)) {
|
|
44265
|
+
context.report({
|
|
44266
|
+
node,
|
|
44267
|
+
messageId: "noListSuffix",
|
|
44268
|
+
data: { name },
|
|
44269
|
+
fix(fixer) {
|
|
44270
|
+
const newName = name.replace(listSuffixRegexp, "");
|
|
44271
|
+
return fixNodeName(node, name).map((nt) => fixer.replaceText(nt, newName));
|
|
44272
|
+
}
|
|
44273
|
+
});
|
|
44274
|
+
}
|
|
44275
|
+
if (!/s$/.test(name)) {
|
|
44276
|
+
context.report({
|
|
44277
|
+
node,
|
|
44278
|
+
messageId: "mustEndWithS",
|
|
44279
|
+
data: { name },
|
|
44280
|
+
fix(fixer) {
|
|
44281
|
+
return fixNodeName(node, name).map((nt) => fixer.replaceText(nt, `${name}s`));
|
|
44282
|
+
}
|
|
44283
|
+
});
|
|
44284
|
+
}
|
|
44285
|
+
}
|
|
44286
|
+
return {
|
|
44287
|
+
// Déclarations de variables : const x = signal(0)
|
|
44288
|
+
VariableDeclarator(node) {
|
|
44289
|
+
if (node.id.type === "Identifier") {
|
|
44290
|
+
checkNode(node.id);
|
|
44291
|
+
}
|
|
44292
|
+
},
|
|
44293
|
+
// Propriétés de classe : count = signal(0)
|
|
44294
|
+
PropertyDefinition(node) {
|
|
44295
|
+
if (node.key.type === "Identifier") {
|
|
44296
|
+
checkNode(node.key);
|
|
44297
|
+
}
|
|
44298
|
+
}
|
|
44299
|
+
};
|
|
44300
|
+
}
|
|
44301
|
+
});
|
|
44302
|
+
|
|
44303
|
+
// src/rules/prefer-const-enum.ts
|
|
44304
|
+
var import_utils7 = __toESM(require_dist4());
|
|
44305
|
+
var RULE_NAME7 = "prefer-const-enum";
|
|
44306
|
+
var DOCS_RULES2 = "https://github.com/developpement-megao/mgw-eslint-rules/tree/main/docs/rules";
|
|
44307
|
+
var createRule7 = import_utils7.ESLintUtils.RuleCreator((name) => `${DOCS_RULES2}/${name}.md`);
|
|
44308
|
+
var rule7 = createRule7({
|
|
44309
|
+
name: RULE_NAME7,
|
|
44201
44310
|
meta: {
|
|
44202
44311
|
type: "problem",
|
|
44203
44312
|
docs: {
|
|
@@ -44245,12 +44354,12 @@ var rule6 = createRule6({
|
|
|
44245
44354
|
});
|
|
44246
44355
|
|
|
44247
44356
|
// src/rules/reactive-naming-convention.ts
|
|
44248
|
-
var
|
|
44249
|
-
var
|
|
44250
|
-
var
|
|
44251
|
-
var
|
|
44252
|
-
var
|
|
44253
|
-
name:
|
|
44357
|
+
var import_utils8 = __toESM(require_dist4());
|
|
44358
|
+
var import_eslint_utils3 = __toESM(require_eslint_utils3());
|
|
44359
|
+
var RULE_NAME8 = "reactive-naming-convention";
|
|
44360
|
+
var createRule8 = import_utils8.ESLintUtils.RuleCreator((name) => `https://github.com/developpement-megao/mgw-eslint-rules/docs/rules/${name}.md`);
|
|
44361
|
+
var rule8 = createRule8({
|
|
44362
|
+
name: RULE_NAME8,
|
|
44254
44363
|
meta: {
|
|
44255
44364
|
type: "suggestion",
|
|
44256
44365
|
fixable: "code",
|
|
@@ -44268,9 +44377,9 @@ var rule7 = createRule7({
|
|
|
44268
44377
|
},
|
|
44269
44378
|
defaultOptions: [],
|
|
44270
44379
|
create(context) {
|
|
44271
|
-
const services = (0,
|
|
44380
|
+
const services = (0, import_eslint_utils3.getParserServices)(context);
|
|
44272
44381
|
const checker = services.program.getTypeChecker();
|
|
44273
|
-
const listeReactiveWritableTypes = ["Subject", "WritableSignal", "InputSignal"];
|
|
44382
|
+
const listeReactiveWritableTypes = ["Subject", "BehaviorSubject", "ReplaySubject", "AsyncSubject", "WritableSignal", "InputSignal"];
|
|
44274
44383
|
const listeReactiveReadonlyTypes = ["Signal", "Observable", "Promise"];
|
|
44275
44384
|
function getTypeWithoutGeneric(type) {
|
|
44276
44385
|
return type.split("<")[0];
|
|
@@ -44342,14 +44451,14 @@ var rule7 = createRule7({
|
|
|
44342
44451
|
});
|
|
44343
44452
|
|
|
44344
44453
|
// src/rules/service-class-suffix.ts
|
|
44345
|
-
var
|
|
44346
|
-
var
|
|
44347
|
-
var
|
|
44454
|
+
var import_utils9 = __toESM(require_dist6());
|
|
44455
|
+
var import_utils10 = __toESM(require_dist4());
|
|
44456
|
+
var RULE_NAME9 = "service-class-suffix";
|
|
44348
44457
|
var SUFFIXES_DEFAULT = ["Service"];
|
|
44349
44458
|
var DOCS_RULES3 = "https://github.com/developpement-megao/mgw-eslint-rules/blob/main/docs/rules";
|
|
44350
|
-
var
|
|
44351
|
-
var
|
|
44352
|
-
name:
|
|
44459
|
+
var createRule9 = import_utils10.ESLintUtils.RuleCreator((name) => `${DOCS_RULES3}/${name}.md`);
|
|
44460
|
+
var rule9 = createRule9({
|
|
44461
|
+
name: RULE_NAME9,
|
|
44353
44462
|
meta: {
|
|
44354
44463
|
type: "suggestion",
|
|
44355
44464
|
docs: {
|
|
@@ -44381,7 +44490,7 @@ var rule8 = createRule8({
|
|
|
44381
44490
|
],
|
|
44382
44491
|
create(context, [{ suffixes }]) {
|
|
44383
44492
|
return {
|
|
44384
|
-
[
|
|
44493
|
+
[import_utils9.Selectors.INJECTABLE_CLASS_DECORATOR](node) {
|
|
44385
44494
|
const classDeclaration = node.parent;
|
|
44386
44495
|
if (!classDeclaration.id) {
|
|
44387
44496
|
return;
|
|
@@ -44404,11 +44513,11 @@ var rule8 = createRule8({
|
|
|
44404
44513
|
});
|
|
44405
44514
|
|
|
44406
44515
|
// src/rules/template/attributes-naming-convention.ts
|
|
44407
|
-
var
|
|
44408
|
-
var
|
|
44516
|
+
var import_utils11 = __toESM(require_dist6());
|
|
44517
|
+
var import_utils12 = __toESM(require_dist4());
|
|
44409
44518
|
var NAMING_CONVENTIONS = ["camelCase", "strictCamelCase", "PascalCase", "StrictPascalCase", "snake_case", "UPPER_CASE", "kebab-case"];
|
|
44410
44519
|
var ATTRIBUTE_CONVENTION_POSSIBLE_VALUES = [...NAMING_CONVENTIONS];
|
|
44411
|
-
var
|
|
44520
|
+
var RULE_NAME10 = "template/attributes-naming-convention";
|
|
44412
44521
|
var conventionPatterns = {
|
|
44413
44522
|
camelCase: /^[a-z][a-zA-Z0-9]*$/,
|
|
44414
44523
|
strictCamelCase: /^(?!.*[A-Z]{2})[a-z][a-zA-Z0-9]*$/,
|
|
@@ -44419,9 +44528,9 @@ var conventionPatterns = {
|
|
|
44419
44528
|
"kebab-case": /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/
|
|
44420
44529
|
};
|
|
44421
44530
|
var DOCS_RULES4 = "https://github.com/developpement-megao/mgw-eslint-rules/tree/main/docs/rules";
|
|
44422
|
-
var
|
|
44423
|
-
var
|
|
44424
|
-
name:
|
|
44531
|
+
var createRule10 = import_utils12.ESLintUtils.RuleCreator((name) => `${DOCS_RULES4}/${name}.md`);
|
|
44532
|
+
var rule10 = createRule10({
|
|
44533
|
+
name: RULE_NAME10,
|
|
44425
44534
|
meta: {
|
|
44426
44535
|
type: "suggestion",
|
|
44427
44536
|
docs: {
|
|
@@ -44480,7 +44589,7 @@ var rule9 = createRule9({
|
|
|
44480
44589
|
}
|
|
44481
44590
|
],
|
|
44482
44591
|
create(context, [options]) {
|
|
44483
|
-
const parserServices = (0,
|
|
44592
|
+
const parserServices = (0, import_utils11.getTemplateParserServices)(context);
|
|
44484
44593
|
const listeAttributes = new Map(
|
|
44485
44594
|
Object.entries(options).map(([a, n]) => {
|
|
44486
44595
|
const listeNommage = typeof n === "string" ? [n] : n;
|
|
@@ -44529,13 +44638,13 @@ var rule9 = createRule9({
|
|
|
44529
44638
|
});
|
|
44530
44639
|
|
|
44531
44640
|
// src/rules/template/prefer-class-style-binding.ts
|
|
44532
|
-
var
|
|
44533
|
-
var
|
|
44534
|
-
var
|
|
44641
|
+
var import_utils13 = __toESM(require_dist6());
|
|
44642
|
+
var import_utils14 = __toESM(require_dist4());
|
|
44643
|
+
var RULE_NAME11 = "template/prefer-class-style-binding";
|
|
44535
44644
|
var DOCS_RULES5 = "https://github.com/developpement-megao/mgw-eslint-rules/tree/main/docs/rules";
|
|
44536
|
-
var
|
|
44537
|
-
var
|
|
44538
|
-
name:
|
|
44645
|
+
var createRule11 = import_utils14.ESLintUtils.RuleCreator((name) => `${DOCS_RULES5}/${name}.md`);
|
|
44646
|
+
var rule11 = createRule11({
|
|
44647
|
+
name: RULE_NAME11,
|
|
44539
44648
|
meta: {
|
|
44540
44649
|
type: "suggestion",
|
|
44541
44650
|
docs: {
|
|
@@ -44550,7 +44659,7 @@ var rule10 = createRule10({
|
|
|
44550
44659
|
},
|
|
44551
44660
|
defaultOptions: [],
|
|
44552
44661
|
create(context) {
|
|
44553
|
-
const parserServices = (0,
|
|
44662
|
+
const parserServices = (0, import_utils13.getTemplateParserServices)(context);
|
|
44554
44663
|
return {
|
|
44555
44664
|
// Détecte les attributs ngClass et ngStyle et inputs [ngClass] et [ngStyle] dans les templates
|
|
44556
44665
|
Element(node) {
|
|
@@ -44571,16 +44680,17 @@ var rule10 = createRule10({
|
|
|
44571
44680
|
|
|
44572
44681
|
// src/index.ts
|
|
44573
44682
|
var rules = {
|
|
44574
|
-
[
|
|
44683
|
+
[RULE_NAME7]: rule7,
|
|
44575
44684
|
[RULE_NAME5]: rule5,
|
|
44576
44685
|
[RULE_NAME3]: rule3,
|
|
44577
44686
|
[RULE_NAME4]: rule4,
|
|
44578
44687
|
[RULE_NAME]: rule,
|
|
44688
|
+
[RULE_NAME11]: rule11,
|
|
44689
|
+
[RULE_NAME9]: rule9,
|
|
44690
|
+
[RULE_NAME2]: rule2,
|
|
44579
44691
|
[RULE_NAME10]: rule10,
|
|
44580
44692
|
[RULE_NAME8]: rule8,
|
|
44581
|
-
[
|
|
44582
|
-
[RULE_NAME9]: rule9,
|
|
44583
|
-
[RULE_NAME7]: rule7
|
|
44693
|
+
[RULE_NAME6]: rule6
|
|
44584
44694
|
};
|
|
44585
44695
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44586
44696
|
0 && (module.exports = {
|