eslint-plugin-crisp 1.0.89 → 1.0.90

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-crisp",
3
- "version": "1.0.89",
3
+ "version": "1.0.90",
4
4
  "description": "Custom ESLint Rules for Crisp",
5
5
  "author": "Crisp IM SAS",
6
6
  "main": "index.js",
@@ -12,18 +12,21 @@ module.exports = {
12
12
  create(context) {
13
13
  return context.parserServices.defineTemplateBodyVisitor({
14
14
  "VAttribute[directive=false][key.name='ref']"(node) {
15
- const refValue = node.value && node.value.value;
15
+ // Check if the ref attribute is not bound to an expression
16
+ if (node.value && node.value.type === 'VLiteral') {
17
+ const refValue = node.value.value;
16
18
 
17
- if (refValue && !/^[a-z]+(_[a-z]+)*$/.test(refValue)) {
18
- context.report({
19
- node,
20
- message: "Ref attribute \"{{refValue}}\" should be snake-cased.",
21
- data: {
22
- refValue,
23
- },
24
- });
19
+ if (refValue && !/^[a-z]+(_[a-z]+)*$/.test(refValue)) {
20
+ context.report({
21
+ node,
22
+ message: "Ref attribute \"{{refValue}}\" should be snake-cased.",
23
+ data: {
24
+ refValue,
25
+ },
26
+ });
27
+ }
25
28
  }
26
29
  }
27
- })
30
+ });
28
31
  }
29
- };
32
+ };