eslint-plugin-crisp 1.2.6 → 1.2.8

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/index.js CHANGED
@@ -108,8 +108,7 @@ const plugin = {
108
108
  "vue-props-declaration-line-break": ruleVuePropsDeclarationLineBreak,
109
109
  "vue-props-declaration-multiline": ruleVuePropsDeclarationMultiline,
110
110
  "vue-props-declaration-order": ruleVuePropsDeclarationOrder,
111
- "vue-ref-case": ruleVueRefCase,
112
- "vue-form-name-prop": ruleVueFormNameProp
111
+ "vue-ref-case": ruleVueRefCase
113
112
  }
114
113
  };
115
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-crisp",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Custom ESLint Rules for Crisp",
5
5
  "author": "Crisp IM SAS",
6
6
  "main": "index.js",
@@ -15,6 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "doctrine": "3.0.0",
18
+ "lodash-es": "4.17.21",
18
19
  "eslint-plugin-jsdoc": "50.8.0"
19
20
  },
20
21
  "peerDependencies": {
@@ -1,4 +1,5 @@
1
1
  import utils from "eslint-plugin-vue/lib/utils/index.js";
2
+ import { snakeCase } from "lodash-es";
2
3
 
3
4
  export default {
4
5
  meta: {
@@ -43,15 +44,10 @@ export default {
43
44
  },
44
45
 
45
46
  fix(fixer) {
46
- // Convert to snake_case
47
- const fixedName = nameValue
48
- .toLowerCase()
49
- .replace(/[\s-]+/g, "_")
50
- .replace(/[^a-z0-9_]/g, "_")
51
- .replace(/_+/g, "_")
52
- .replace(/^_|_$/g, "");
53
-
54
- return fixer.replaceText(nameAttribute.value, `"${fixedName}"`);
47
+ return fixer.replaceText(
48
+ nameAttribute.value,
49
+ `"${snakeCase(nameValue).toLowerCase()}"`
50
+ );
55
51
  },
56
52
  });
57
53
  }