@html-eslint/eslint-plugin 0.21.0 → 0.22.0

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.
@@ -16,6 +16,7 @@ const CONVENTIONS = {
16
16
  SNAKE_CASE: "snake_case",
17
17
  PASCAL_CASE: "PascalCase",
18
18
  KEBAB_CASE: "kebab-case",
19
+ REGEX: "regex",
19
20
  };
20
21
 
21
22
  const CONVENTION_CHECKERS = {
@@ -43,6 +44,13 @@ module.exports = {
43
44
  {
44
45
  enum: Object.values(CONVENTIONS),
45
46
  },
47
+ {
48
+ type: "object",
49
+ properties: {
50
+ pattern: { type: "string" },
51
+ },
52
+ additionalProperties: false,
53
+ },
46
54
  ],
47
55
  messages: {
48
56
  [MESSAGE_IDS.WRONG]:
@@ -56,7 +64,11 @@ module.exports = {
56
64
  ? context.options[0]
57
65
  : CONVENTIONS.SNAKE_CASE;
58
66
 
59
- const checkNaming = CONVENTION_CHECKERS[convention];
67
+ const checkNaming =
68
+ convention === CONVENTIONS.REGEX
69
+ ? (/** @type string */ name) =>
70
+ new RegExp(context.options[1].pattern).test(name)
71
+ : CONVENTION_CHECKERS[convention];
60
72
 
61
73
  return {
62
74
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-eslint/eslint-plugin",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "ESLint plugin for html",
5
5
  "author": "yeonjuan",
6
6
  "homepage": "https://github.com/yeonjuan/html-eslint#readme",
@@ -41,11 +41,11 @@
41
41
  "accessibility"
42
42
  ],
43
43
  "devDependencies": {
44
- "@html-eslint/parser": "^0.21.0",
44
+ "@html-eslint/parser": "^0.22.0",
45
45
  "@types/eslint": "^7.2.10",
46
46
  "@types/estree": "^0.0.47",
47
47
  "es-html-parser": "^0.0.8",
48
48
  "typescript": "^4.4.4"
49
49
  },
50
- "gitHead": "494441cc7bef7b56ece42b07406c0b2f0ee01d59"
50
+ "gitHead": "56a3c7726aa4d89f81035a3e3ea37bdd02be94ac"
51
51
  }