eslint-plugin-mgw-eslint-rules 2.3.34 → 2.3.36
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 +188 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +188 -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,128 @@ 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 array like variables and properties (name must end with `s` and suffix `List` is not allowed)",
|
|
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
|
+
if (name === "testAntoine") {
|
|
44264
|
+
context.report({
|
|
44265
|
+
node,
|
|
44266
|
+
messageId: "noListSuffix",
|
|
44267
|
+
data: { name: typeNameWithoutGeneric }
|
|
44268
|
+
});
|
|
44269
|
+
return;
|
|
44270
|
+
}
|
|
44271
|
+
const listSuffixRegexp = /liste?$/i;
|
|
44272
|
+
if (listSuffixRegexp.test(name)) {
|
|
44273
|
+
context.report({
|
|
44274
|
+
node,
|
|
44275
|
+
messageId: "noListSuffix",
|
|
44276
|
+
data: { name },
|
|
44277
|
+
fix(fixer) {
|
|
44278
|
+
const newName = name.replace(listSuffixRegexp, "");
|
|
44279
|
+
return fixNodeName(node, name).map((nt) => fixer.replaceText(nt, newName));
|
|
44280
|
+
}
|
|
44281
|
+
});
|
|
44282
|
+
}
|
|
44283
|
+
if (!/s$/.test(name)) {
|
|
44284
|
+
context.report({
|
|
44285
|
+
node,
|
|
44286
|
+
messageId: "mustEndWithS",
|
|
44287
|
+
data: { name },
|
|
44288
|
+
fix(fixer) {
|
|
44289
|
+
return fixNodeName(node, name).map((nt) => fixer.replaceText(nt, `${name}s`));
|
|
44290
|
+
}
|
|
44291
|
+
});
|
|
44292
|
+
}
|
|
44293
|
+
}
|
|
44294
|
+
return {
|
|
44295
|
+
// Déclarations de variables : const x = signal(0)
|
|
44296
|
+
VariableDeclarator(node) {
|
|
44297
|
+
if (node.id.type === "Identifier") {
|
|
44298
|
+
checkNode(node.id);
|
|
44299
|
+
}
|
|
44300
|
+
},
|
|
44301
|
+
// Propriétés de classe : count = signal(0)
|
|
44302
|
+
PropertyDefinition(node) {
|
|
44303
|
+
if (node.key.type === "Identifier") {
|
|
44304
|
+
checkNode(node.key);
|
|
44305
|
+
}
|
|
44306
|
+
}
|
|
44307
|
+
};
|
|
44308
|
+
}
|
|
44309
|
+
});
|
|
44310
|
+
|
|
44311
|
+
// src/rules/prefer-const-enum.ts
|
|
44312
|
+
var import_utils7 = __toESM(require_dist4());
|
|
44313
|
+
var RULE_NAME7 = "prefer-const-enum";
|
|
44314
|
+
var DOCS_RULES2 = "https://github.com/developpement-megao/mgw-eslint-rules/tree/main/docs/rules";
|
|
44315
|
+
var createRule7 = import_utils7.ESLintUtils.RuleCreator((name) => `${DOCS_RULES2}/${name}.md`);
|
|
44316
|
+
var rule7 = createRule7({
|
|
44317
|
+
name: RULE_NAME7,
|
|
44201
44318
|
meta: {
|
|
44202
44319
|
type: "problem",
|
|
44203
44320
|
docs: {
|
|
@@ -44245,12 +44362,12 @@ var rule6 = createRule6({
|
|
|
44245
44362
|
});
|
|
44246
44363
|
|
|
44247
44364
|
// src/rules/reactive-naming-convention.ts
|
|
44248
|
-
var
|
|
44249
|
-
var
|
|
44250
|
-
var
|
|
44251
|
-
var
|
|
44252
|
-
var
|
|
44253
|
-
name:
|
|
44365
|
+
var import_utils8 = __toESM(require_dist4());
|
|
44366
|
+
var import_eslint_utils3 = __toESM(require_eslint_utils3());
|
|
44367
|
+
var RULE_NAME8 = "reactive-naming-convention";
|
|
44368
|
+
var createRule8 = import_utils8.ESLintUtils.RuleCreator((name) => `https://github.com/developpement-megao/mgw-eslint-rules/docs/rules/${name}.md`);
|
|
44369
|
+
var rule8 = createRule8({
|
|
44370
|
+
name: RULE_NAME8,
|
|
44254
44371
|
meta: {
|
|
44255
44372
|
type: "suggestion",
|
|
44256
44373
|
fixable: "code",
|
|
@@ -44268,9 +44385,9 @@ var rule7 = createRule7({
|
|
|
44268
44385
|
},
|
|
44269
44386
|
defaultOptions: [],
|
|
44270
44387
|
create(context) {
|
|
44271
|
-
const services = (0,
|
|
44388
|
+
const services = (0, import_eslint_utils3.getParserServices)(context);
|
|
44272
44389
|
const checker = services.program.getTypeChecker();
|
|
44273
|
-
const listeReactiveWritableTypes = ["Subject", "WritableSignal", "InputSignal"];
|
|
44390
|
+
const listeReactiveWritableTypes = ["Subject", "BehaviorSubject", "ReplaySubject", "AsyncSubject", "WritableSignal", "InputSignal"];
|
|
44274
44391
|
const listeReactiveReadonlyTypes = ["Signal", "Observable", "Promise"];
|
|
44275
44392
|
function getTypeWithoutGeneric(type) {
|
|
44276
44393
|
return type.split("<")[0];
|
|
@@ -44342,14 +44459,14 @@ var rule7 = createRule7({
|
|
|
44342
44459
|
});
|
|
44343
44460
|
|
|
44344
44461
|
// src/rules/service-class-suffix.ts
|
|
44345
|
-
var
|
|
44346
|
-
var
|
|
44347
|
-
var
|
|
44462
|
+
var import_utils9 = __toESM(require_dist6());
|
|
44463
|
+
var import_utils10 = __toESM(require_dist4());
|
|
44464
|
+
var RULE_NAME9 = "service-class-suffix";
|
|
44348
44465
|
var SUFFIXES_DEFAULT = ["Service"];
|
|
44349
44466
|
var DOCS_RULES3 = "https://github.com/developpement-megao/mgw-eslint-rules/blob/main/docs/rules";
|
|
44350
|
-
var
|
|
44351
|
-
var
|
|
44352
|
-
name:
|
|
44467
|
+
var createRule9 = import_utils10.ESLintUtils.RuleCreator((name) => `${DOCS_RULES3}/${name}.md`);
|
|
44468
|
+
var rule9 = createRule9({
|
|
44469
|
+
name: RULE_NAME9,
|
|
44353
44470
|
meta: {
|
|
44354
44471
|
type: "suggestion",
|
|
44355
44472
|
docs: {
|
|
@@ -44381,7 +44498,7 @@ var rule8 = createRule8({
|
|
|
44381
44498
|
],
|
|
44382
44499
|
create(context, [{ suffixes }]) {
|
|
44383
44500
|
return {
|
|
44384
|
-
[
|
|
44501
|
+
[import_utils9.Selectors.INJECTABLE_CLASS_DECORATOR](node) {
|
|
44385
44502
|
const classDeclaration = node.parent;
|
|
44386
44503
|
if (!classDeclaration.id) {
|
|
44387
44504
|
return;
|
|
@@ -44404,11 +44521,11 @@ var rule8 = createRule8({
|
|
|
44404
44521
|
});
|
|
44405
44522
|
|
|
44406
44523
|
// src/rules/template/attributes-naming-convention.ts
|
|
44407
|
-
var
|
|
44408
|
-
var
|
|
44524
|
+
var import_utils11 = __toESM(require_dist6());
|
|
44525
|
+
var import_utils12 = __toESM(require_dist4());
|
|
44409
44526
|
var NAMING_CONVENTIONS = ["camelCase", "strictCamelCase", "PascalCase", "StrictPascalCase", "snake_case", "UPPER_CASE", "kebab-case"];
|
|
44410
44527
|
var ATTRIBUTE_CONVENTION_POSSIBLE_VALUES = [...NAMING_CONVENTIONS];
|
|
44411
|
-
var
|
|
44528
|
+
var RULE_NAME10 = "template/attributes-naming-convention";
|
|
44412
44529
|
var conventionPatterns = {
|
|
44413
44530
|
camelCase: /^[a-z][a-zA-Z0-9]*$/,
|
|
44414
44531
|
strictCamelCase: /^(?!.*[A-Z]{2})[a-z][a-zA-Z0-9]*$/,
|
|
@@ -44419,9 +44536,9 @@ var conventionPatterns = {
|
|
|
44419
44536
|
"kebab-case": /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/
|
|
44420
44537
|
};
|
|
44421
44538
|
var DOCS_RULES4 = "https://github.com/developpement-megao/mgw-eslint-rules/tree/main/docs/rules";
|
|
44422
|
-
var
|
|
44423
|
-
var
|
|
44424
|
-
name:
|
|
44539
|
+
var createRule10 = import_utils12.ESLintUtils.RuleCreator((name) => `${DOCS_RULES4}/${name}.md`);
|
|
44540
|
+
var rule10 = createRule10({
|
|
44541
|
+
name: RULE_NAME10,
|
|
44425
44542
|
meta: {
|
|
44426
44543
|
type: "suggestion",
|
|
44427
44544
|
docs: {
|
|
@@ -44480,7 +44597,7 @@ var rule9 = createRule9({
|
|
|
44480
44597
|
}
|
|
44481
44598
|
],
|
|
44482
44599
|
create(context, [options]) {
|
|
44483
|
-
const parserServices = (0,
|
|
44600
|
+
const parserServices = (0, import_utils11.getTemplateParserServices)(context);
|
|
44484
44601
|
const listeAttributes = new Map(
|
|
44485
44602
|
Object.entries(options).map(([a, n]) => {
|
|
44486
44603
|
const listeNommage = typeof n === "string" ? [n] : n;
|
|
@@ -44529,13 +44646,13 @@ var rule9 = createRule9({
|
|
|
44529
44646
|
});
|
|
44530
44647
|
|
|
44531
44648
|
// src/rules/template/prefer-class-style-binding.ts
|
|
44532
|
-
var
|
|
44533
|
-
var
|
|
44534
|
-
var
|
|
44649
|
+
var import_utils13 = __toESM(require_dist6());
|
|
44650
|
+
var import_utils14 = __toESM(require_dist4());
|
|
44651
|
+
var RULE_NAME11 = "template/prefer-class-style-binding";
|
|
44535
44652
|
var DOCS_RULES5 = "https://github.com/developpement-megao/mgw-eslint-rules/tree/main/docs/rules";
|
|
44536
|
-
var
|
|
44537
|
-
var
|
|
44538
|
-
name:
|
|
44653
|
+
var createRule11 = import_utils14.ESLintUtils.RuleCreator((name) => `${DOCS_RULES5}/${name}.md`);
|
|
44654
|
+
var rule11 = createRule11({
|
|
44655
|
+
name: RULE_NAME11,
|
|
44539
44656
|
meta: {
|
|
44540
44657
|
type: "suggestion",
|
|
44541
44658
|
docs: {
|
|
@@ -44550,7 +44667,7 @@ var rule10 = createRule10({
|
|
|
44550
44667
|
},
|
|
44551
44668
|
defaultOptions: [],
|
|
44552
44669
|
create(context) {
|
|
44553
|
-
const parserServices = (0,
|
|
44670
|
+
const parserServices = (0, import_utils13.getTemplateParserServices)(context);
|
|
44554
44671
|
return {
|
|
44555
44672
|
// Détecte les attributs ngClass et ngStyle et inputs [ngClass] et [ngStyle] dans les templates
|
|
44556
44673
|
Element(node) {
|
|
@@ -44571,16 +44688,17 @@ var rule10 = createRule10({
|
|
|
44571
44688
|
|
|
44572
44689
|
// src/index.ts
|
|
44573
44690
|
var rules = {
|
|
44574
|
-
[
|
|
44691
|
+
[RULE_NAME7]: rule7,
|
|
44575
44692
|
[RULE_NAME5]: rule5,
|
|
44576
44693
|
[RULE_NAME3]: rule3,
|
|
44577
44694
|
[RULE_NAME4]: rule4,
|
|
44578
44695
|
[RULE_NAME]: rule,
|
|
44696
|
+
[RULE_NAME11]: rule11,
|
|
44697
|
+
[RULE_NAME9]: rule9,
|
|
44698
|
+
[RULE_NAME2]: rule2,
|
|
44579
44699
|
[RULE_NAME10]: rule10,
|
|
44580
44700
|
[RULE_NAME8]: rule8,
|
|
44581
|
-
[
|
|
44582
|
-
[RULE_NAME9]: rule9,
|
|
44583
|
-
[RULE_NAME7]: rule7
|
|
44701
|
+
[RULE_NAME6]: rule6
|
|
44584
44702
|
};
|
|
44585
44703
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44586
44704
|
0 && (module.exports = {
|