eslint-plugin-mgw-eslint-rules 2.3.30 → 2.3.32
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 +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44257,10 +44257,12 @@ var rule7 = createRule7({
|
|
|
44257
44257
|
fixable: "code",
|
|
44258
44258
|
docs: {
|
|
44259
44259
|
description: "Naming convention for reactive variables and properties (name must end with $ and $$ for WritableSignals and Subjects)",
|
|
44260
|
-
recommended: true
|
|
44260
|
+
recommended: true,
|
|
44261
|
+
requiresTypeChecking: true
|
|
44261
44262
|
},
|
|
44262
44263
|
messages: {
|
|
44263
|
-
|
|
44264
|
+
reactiveVariableNamingConvention: "Variable `{{ name }}` must end with `{{ suffix }}`.",
|
|
44265
|
+
reactivePropertyNamingConvention: "Property `{{ name }}` must end with `{{ suffix }}`."
|
|
44264
44266
|
},
|
|
44265
44267
|
schema: []
|
|
44266
44268
|
// No options
|
|
@@ -44274,7 +44276,7 @@ var rule7 = createRule7({
|
|
|
44274
44276
|
const listeReactiveWritableTypes = ["Subject", "WritableSignal", "InputSignal"];
|
|
44275
44277
|
const listeReactiveReadonlyTypes = ["Signal", "Observable", "Promise"];
|
|
44276
44278
|
const checker = parserServices.program.getTypeChecker();
|
|
44277
|
-
function checkNode(node) {
|
|
44279
|
+
function checkNode(node, messageId) {
|
|
44278
44280
|
const name = node.name;
|
|
44279
44281
|
if (!name || name === "_" || !parserServices?.esTreeNodeToTSNodeMap) {
|
|
44280
44282
|
return;
|
|
@@ -44287,7 +44289,7 @@ var rule7 = createRule7({
|
|
|
44287
44289
|
if ((isReactiveWritableTypes || listeReactiveReadonlyTypes.some((t) => new RegExp(`${t}<.+>`).test(typeName))) && (!name.endsWith(suffix) || suffix === "$" && name.endsWith("$$"))) {
|
|
44288
44290
|
context.report({
|
|
44289
44291
|
node,
|
|
44290
|
-
messageId
|
|
44292
|
+
messageId,
|
|
44291
44293
|
data: {
|
|
44292
44294
|
typeName,
|
|
44293
44295
|
name,
|
|
@@ -44327,13 +44329,13 @@ var rule7 = createRule7({
|
|
|
44327
44329
|
// Déclarations de variables : const x = signal(0)
|
|
44328
44330
|
VariableDeclarator(node) {
|
|
44329
44331
|
if (node.id?.type === "Identifier") {
|
|
44330
|
-
checkNode(node.id);
|
|
44332
|
+
checkNode(node.id, "reactiveVariableNamingConvention");
|
|
44331
44333
|
}
|
|
44332
44334
|
},
|
|
44333
44335
|
// Propriétés de classe : count = signal(0)
|
|
44334
44336
|
PropertyDefinition(node) {
|
|
44335
44337
|
if (node.key?.type === "Identifier") {
|
|
44336
|
-
checkNode(node.key);
|
|
44338
|
+
checkNode(node.key, "reactivePropertyNamingConvention");
|
|
44337
44339
|
}
|
|
44338
44340
|
}
|
|
44339
44341
|
};
|