@dnncommunity/dnn-elements 0.24.4-beta.6 → 0.24.4-beta.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.
Files changed (31) hide show
  1. package/dist/collection/eslint-plugin/src/configs/index.js +7 -0
  2. package/dist/collection/eslint-plugin/src/configs/index.js.map +1 -0
  3. package/dist/collection/eslint-plugin/src/configs/recommended.js +6 -0
  4. package/dist/collection/eslint-plugin/src/configs/recommended.js.map +1 -0
  5. package/dist/collection/eslint-plugin/src/index.js +12 -12
  6. package/dist/collection/eslint-plugin/src/index.js.map +1 -1
  7. package/dist/collection/eslint-plugin/src/rules/index.js +5 -0
  8. package/dist/collection/eslint-plugin/src/rules/index.js.map +1 -0
  9. package/dist/types/eslint-plugin/src/configs/index.d.ts +11 -0
  10. package/dist/types/eslint-plugin/src/configs/recommended.d.ts +6 -0
  11. package/dist/types/eslint-plugin/src/index.d.ts +3 -5
  12. package/dist/types/eslint-plugin/src/rules/index.d.ts +4 -0
  13. package/eslint-plugin/configs/index.d.ts +11 -0
  14. package/eslint-plugin/configs/index.js +12 -0
  15. package/eslint-plugin/configs/index.js.map +1 -0
  16. package/eslint-plugin/configs/recommended.d.ts +6 -0
  17. package/eslint-plugin/configs/recommended.js +8 -0
  18. package/eslint-plugin/configs/recommended.js.map +1 -0
  19. package/eslint-plugin/index.d.ts +15 -0
  20. package/eslint-plugin/index.js +22 -0
  21. package/eslint-plugin/index.js.map +1 -0
  22. package/eslint-plugin/rules/index.d.ts +4 -0
  23. package/eslint-plugin/rules/index.js +7 -0
  24. package/eslint-plugin/rules/index.js.map +1 -0
  25. package/eslint-plugin/rules/no-label-slot-in-checkbox.d.ts +2 -0
  26. package/{src/eslint-plugin/src/rules/no-label-slot-in-checkbox.ts → eslint-plugin/rules/no-label-slot-in-checkbox.js} +48 -48
  27. package/eslint-plugin/rules/no-label-slot-in-checkbox.js.map +1 -0
  28. package/package.json +2 -2
  29. package/src/eslint-plugin/__tests__/no-label-slot-in-checkbox.tests.ts +0 -27
  30. package/src/eslint-plugin/src/index.ts +0 -19
  31. package/src/eslint-plugin/tsconfig.json +0 -16
@@ -0,0 +1,7 @@
1
+ import recommended from "./recommended";
2
+ export default {
3
+ recommended,
4
+ /** Will be populated from main entry file to keep backward compatible. */
5
+ flat: {},
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/eslint-plugin/src/configs/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,eAAe;IACX,WAAW;IACX,0EAA0E;IAC1E,IAAI,EAAE,EAAuC;CAChD,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\r\nimport recommended from \"./recommended\";\r\n\r\nexport default {\r\n recommended,\r\n /** Will be populated from main entry file to keep backward compatible. */\r\n flat: {} as Record<string, Linter.FlatConfig>,\r\n};"]}
@@ -0,0 +1,6 @@
1
+ export default {
2
+ rules: {
3
+ '@dnn-elements/no-label-slot-in-checkbox': "error",
4
+ }
5
+ };
6
+ //# sourceMappingURL=recommended.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../../../src/eslint-plugin/src/configs/recommended.ts"],"names":[],"mappings":"AAEA,eAAe;IACX,KAAK,EAAE;QACH,yCAAyC,EAAE,OAAO;KACrD;CACwB,CAAC","sourcesContent":["import { Linter } from 'eslint';\r\n\r\nexport default {\r\n rules: {\r\n '@dnn-elements/no-label-slot-in-checkbox': \"error\",\r\n }\r\n} satisfies Linter.BaseConfig;"]}
@@ -1,17 +1,17 @@
1
- import { noLabelSlotInCheckbox } from "./rules/no-label-slot-in-checkbox";
2
- export const rules = {
3
- "no-label-slot-in-checkbox": noLabelSlotInCheckbox
4
- };
1
+ import rules from "./rules";
2
+ import configs from "./configs";
5
3
  const plugin = {
6
4
  rules,
7
- configs: {
8
- recommended: {
9
- plugins: ["@dnn-community/eslint-plugin"],
10
- rules: {
11
- "@dnn-community/no-label-slot-in-checkbox": "error"
12
- }
13
- }
14
- }
5
+ configs,
6
+ };
7
+ const flatRecommended = {
8
+ plugins: {
9
+ "@dnn-elements": plugin,
10
+ },
11
+ rules: configs.recommended.rules,
12
+ };
13
+ configs.flat = {
14
+ recommended: flatRecommended,
15
15
  };
16
16
  export default plugin;
17
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eslint-plugin/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,2BAA2B,EAAE,qBAAqB;CACrD,CAAC;AAEF,MAAM,MAAM,GAAG;IACX,KAAK;IACL,OAAO,EAAE;QACL,WAAW,EAAE;YACT,OAAO,EAAE,CAAC,8BAA8B,CAAC;YACzC,KAAK,EAAE;gBACH,0CAA0C,EAAE,OAAO;aACtD;SACJ;KACJ;CACJ,CAAA;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { noLabelSlotInCheckbox } from \"./rules/no-label-slot-in-checkbox\";\r\n\r\nexport const rules = {\r\n \"no-label-slot-in-checkbox\": noLabelSlotInCheckbox\r\n};\r\n\r\nconst plugin = {\r\n rules,\r\n configs: {\r\n recommended: {\r\n plugins: [\"@dnn-community/eslint-plugin\"],\r\n rules: {\r\n \"@dnn-community/no-label-slot-in-checkbox\": \"error\"\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default plugin;"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eslint-plugin/src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,MAAM,MAAM,GAAG;IACX,KAAK;IACL,OAAO;CACV,CAAC;AAEF,MAAM,eAAe,GAAsB;IACvC,OAAO,EAAE;QACL,eAAe,EAAE,MAAM;KAC1B;IACD,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK;CACnC,CAAC;AAEF,OAAO,CAAC,IAAI,GAAG;IACX,WAAW,EAAE,eAAe;CAC/B,CAAA;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { Linter } from \"eslint\";\r\nimport rules from \"./rules\";\r\nimport configs from \"./configs\"\r\n\r\nconst plugin = {\r\n rules,\r\n configs,\r\n};\r\n\r\nconst flatRecommended: Linter.FlatConfig = {\r\n plugins: {\r\n \"@dnn-elements\": plugin,\r\n },\r\n rules: configs.recommended.rules,\r\n};\r\n\r\nconfigs.flat = {\r\n recommended: flatRecommended,\r\n}\r\n\r\nexport default plugin;"]}
@@ -0,0 +1,5 @@
1
+ import { noLabelSlotInCheckbox } from "./no-label-slot-in-checkbox";
2
+ export default {
3
+ "no-label-slot-in-checkbox": noLabelSlotInCheckbox,
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/eslint-plugin/src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,eAAe;IACX,2BAA2B,EAAE,qBAAqB;CACrD,CAAA","sourcesContent":["import { noLabelSlotInCheckbox } from \"./no-label-slot-in-checkbox\";\r\n\r\nexport default {\r\n \"no-label-slot-in-checkbox\": noLabelSlotInCheckbox,\r\n}"]}
@@ -0,0 +1,11 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: {
3
+ recommended: {
4
+ rules: {
5
+ '@dnn-elements/no-label-slot-in-checkbox': "error";
6
+ };
7
+ };
8
+ /** Will be populated from main entry file to keep backward compatible. */
9
+ flat: Record<string, Linter.FlatConfig>;
10
+ };
11
+ export default _default;
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ rules: {
3
+ '@dnn-elements/no-label-slot-in-checkbox': "error";
4
+ };
5
+ };
6
+ export default _default;
@@ -1,17 +1,15 @@
1
- export declare const rules: {
2
- "no-label-slot-in-checkbox": import("eslint").Rule.RuleModule;
3
- };
1
+ import { Linter } from "eslint";
4
2
  declare const plugin: {
5
3
  rules: {
6
4
  "no-label-slot-in-checkbox": import("eslint").Rule.RuleModule;
7
5
  };
8
6
  configs: {
9
7
  recommended: {
10
- plugins: string[];
11
8
  rules: {
12
- "@dnn-community/no-label-slot-in-checkbox": string;
9
+ '@dnn-elements/no-label-slot-in-checkbox': "error";
13
10
  };
14
11
  };
12
+ flat: Record<string, Linter.FlatConfig>;
15
13
  };
16
14
  };
17
15
  export default plugin;
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ "no-label-slot-in-checkbox": import("eslint").Rule.RuleModule;
3
+ };
4
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: {
3
+ recommended: {
4
+ rules: {
5
+ '@dnn-elements/no-label-slot-in-checkbox': "error";
6
+ };
7
+ };
8
+ /** Will be populated from main entry file to keep backward compatible. */
9
+ flat: Record<string, Linter.FlatConfig>;
10
+ };
11
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const recommended_1 = __importDefault(require("./recommended"));
7
+ exports.default = {
8
+ recommended: recommended_1.default,
9
+ /** Will be populated from main entry file to keep backward compatible. */
10
+ flat: {},
11
+ };
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eslint-plugin/src/configs/index.ts"],"names":[],"mappings":";;;;;AACA,gEAAwC;AAExC,kBAAe;IACX,WAAW,EAAX,qBAAW;IACX,0EAA0E;IAC1E,IAAI,EAAE,EAAuC;CAChD,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ rules: {
3
+ '@dnn-elements/no-label-slot-in-checkbox': "error";
4
+ };
5
+ };
6
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ rules: {
5
+ '@dnn-elements/no-label-slot-in-checkbox': "error",
6
+ }
7
+ };
8
+ //# sourceMappingURL=recommended.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../src/eslint-plugin/src/configs/recommended.ts"],"names":[],"mappings":";;AAEA,kBAAe;IACX,KAAK,EAAE;QACH,yCAAyC,EAAE,OAAO;KACrD;CACwB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Linter } from "eslint";
2
+ declare const plugin: {
3
+ rules: {
4
+ "no-label-slot-in-checkbox": import("eslint").Rule.RuleModule;
5
+ };
6
+ configs: {
7
+ recommended: {
8
+ rules: {
9
+ '@dnn-elements/no-label-slot-in-checkbox': "error";
10
+ };
11
+ };
12
+ flat: Record<string, Linter.FlatConfig>;
13
+ };
14
+ };
15
+ export default plugin;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const rules_1 = __importDefault(require("./rules"));
7
+ const configs_1 = __importDefault(require("./configs"));
8
+ const plugin = {
9
+ rules: rules_1.default,
10
+ configs: configs_1.default,
11
+ };
12
+ const flatRecommended = {
13
+ plugins: {
14
+ "@dnn-elements": plugin,
15
+ },
16
+ rules: configs_1.default.recommended.rules,
17
+ };
18
+ configs_1.default.flat = {
19
+ recommended: flatRecommended,
20
+ };
21
+ exports.default = plugin;
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/eslint-plugin/src/index.ts"],"names":[],"mappings":";;;;;AACA,oDAA4B;AAC5B,wDAA+B;AAE/B,MAAM,MAAM,GAAG;IACX,KAAK,EAAL,eAAK;IACL,OAAO,EAAP,iBAAO;CACV,CAAC;AAEF,MAAM,eAAe,GAAsB;IACvC,OAAO,EAAE;QACL,eAAe,EAAE,MAAM;KAC1B;IACD,KAAK,EAAE,iBAAO,CAAC,WAAW,CAAC,KAAK;CACnC,CAAC;AAEF,iBAAO,CAAC,IAAI,GAAG;IACX,WAAW,EAAE,eAAe;CAC/B,CAAA;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ "no-label-slot-in-checkbox": import("eslint").Rule.RuleModule;
3
+ };
4
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const no_label_slot_in_checkbox_1 = require("./no-label-slot-in-checkbox");
4
+ exports.default = {
5
+ "no-label-slot-in-checkbox": no_label_slot_in_checkbox_1.noLabelSlotInCheckbox,
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eslint-plugin/src/rules/index.ts"],"names":[],"mappings":";;AAAA,2EAAoE;AAEpE,kBAAe;IACX,2BAA2B,EAAE,iDAAqB;CACrD,CAAA"}
@@ -0,0 +1,2 @@
1
+ import type { Rule } from 'eslint';
2
+ export declare const noLabelSlotInCheckbox: Rule.RuleModule;
@@ -1,48 +1,48 @@
1
- import type { Rule } from 'eslint';
2
- import type { JSXOpeningElement } from "estree-jsx";
3
-
4
- export const noLabelSlotInCheckbox: Rule.RuleModule = {
5
- meta: {
6
- type: "problem",
7
- docs: {
8
- description: "Disallow label slot in checkbox",
9
- recommended: true,
10
- url: "https://github.com/DNNCommunity/dnn-elements/releases/tag/v0.24.0",
11
- },
12
- messages: {
13
- noLabelSlotInCheckbox: "Label slot is not allowed in dnn-checkbox, wrap dnn-checkbox with a label instead."
14
- },
15
- fixable: "code",
16
- },
17
- create(context: Rule.RuleContext): Rule.RuleListener {
18
- return {
19
- JSXOpeningElement(node: Rule.Node) {
20
- if (node.type === "JSXOpeningElement") {
21
- const jsxNode = node as JSXOpeningElement;
22
- if (jsxNode.name.type === "JSXIdentifier" && jsxNode.name.name === "dnn-checkbox") {
23
- const parent = context.getAncestors().find(ancestor => ancestor.type === "JSXElement");
24
- if (parent && parent.type === "JSXElement") {
25
- const parentElement = parent as any; // Cast to access children
26
- const innerContent = parentElement.children
27
- .map((child: any) => context.sourceCode.getText(child))
28
- .join("")
29
- .trim();
30
-
31
- if (innerContent) {
32
- context.report({
33
- node: node,
34
- messageId: "noLabelSlotInCheckbox",
35
- fix: (fixer) => {
36
- const checkboxText = context.sourceCode.getText(node);
37
- const fixedText = `<label>\n${checkboxText.replace(innerContent, "").trim()}</dnn-checkbox>\n${innerContent}\n</label>`;
38
- return fixer.replaceText(parent, fixedText);
39
- }
40
- });
41
- }
42
- }
43
- }
44
- }
45
- }
46
- };
47
- }
48
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.noLabelSlotInCheckbox = void 0;
4
+ exports.noLabelSlotInCheckbox = {
5
+ meta: {
6
+ type: "problem",
7
+ docs: {
8
+ description: "Disallow label slot in checkbox",
9
+ recommended: true,
10
+ url: "https://github.com/DNNCommunity/dnn-elements/releases/tag/v0.24.0",
11
+ },
12
+ messages: {
13
+ noLabelSlotInCheckbox: "Label slot is not allowed in dnn-checkbox, wrap dnn-checkbox with a label instead."
14
+ },
15
+ fixable: "code",
16
+ },
17
+ create(context) {
18
+ return {
19
+ JSXOpeningElement(node) {
20
+ if (node.type === "JSXOpeningElement") {
21
+ const jsxNode = node;
22
+ if (jsxNode.name.type === "JSXIdentifier" && jsxNode.name.name === "dnn-checkbox") {
23
+ const parent = context.getAncestors().find(ancestor => ancestor.type === "JSXElement");
24
+ if (parent && parent.type === "JSXElement") {
25
+ const parentElement = parent; // Cast to access children
26
+ const innerContent = parentElement.children
27
+ .map((child) => context.sourceCode.getText(child))
28
+ .join("")
29
+ .trim();
30
+ if (innerContent) {
31
+ context.report({
32
+ node: node,
33
+ messageId: "noLabelSlotInCheckbox",
34
+ fix: (fixer) => {
35
+ const checkboxText = context.sourceCode.getText(node);
36
+ const fixedText = `<label>\n${checkboxText.replace(innerContent, "").trim()}</dnn-checkbox>\n${innerContent}\n</label>`;
37
+ return fixer.replaceText(parent, fixedText);
38
+ }
39
+ });
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ };
46
+ }
47
+ };
48
+ //# sourceMappingURL=no-label-slot-in-checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-label-slot-in-checkbox.js","sourceRoot":"","sources":["../../src/eslint-plugin/src/rules/no-label-slot-in-checkbox.ts"],"names":[],"mappings":";;;AAGa,QAAA,qBAAqB,GAAoB;IAClD,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACF,WAAW,EAAE,iCAAiC;YAC9C,WAAW,EAAE,IAAI;YACjB,GAAG,EAAE,mEAAmE;SAC3E;QACD,QAAQ,EAAE;YACN,qBAAqB,EAAE,oFAAoF;SAC9G;QACD,OAAO,EAAE,MAAM;KAClB;IACD,MAAM,CAAC,OAAyB;QAC5B,OAAO;YACH,iBAAiB,CAAC,IAAe;gBAC7B,IAAI,IAAI,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;oBACpC,MAAM,OAAO,GAAG,IAAyB,CAAC;oBAC1C,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;wBAChF,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;wBACvF,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;4BACzC,MAAM,aAAa,GAAG,MAAa,CAAC,CAAC,0BAA0B;4BAC/D,MAAM,YAAY,GAAG,aAAa,CAAC,QAAQ;iCACtC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;iCACtD,IAAI,CAAC,EAAE,CAAC;iCACR,IAAI,EAAE,CAAC;4BAEZ,IAAI,YAAY,EAAE,CAAC;gCACf,OAAO,CAAC,MAAM,CAAC;oCACX,IAAI,EAAE,IAAI;oCACV,SAAS,EAAE,uBAAuB;oCAClC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE;wCACX,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;wCACtD,MAAM,SAAS,GAAG,YAAY,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,oBAAoB,YAAY,YAAY,CAAC;wCACxH,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;oCAChD,CAAC;iCACJ,CAAC,CAAC;4BACP,CAAC;wBACL,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnncommunity/dnn-elements",
3
- "version": "0.24.4-beta.6",
3
+ "version": "0.24.4-beta.8",
4
4
  "description": "Dnn themed custom elements.",
5
5
  "repository": "https://github.com/dnncommunity/dnn-elements",
6
6
  "homepage": "https://dnncommunity.github.io/dnn-elements",
@@ -16,7 +16,7 @@
16
16
  "files": [
17
17
  "dist/",
18
18
  "loader/",
19
- "src/eslint-plugin/"
19
+ "eslint-plugin/"
20
20
  ],
21
21
  "scripts": {
22
22
  "build": "npm run build:eslint-plugin && npm run eslint && stencil build --docs",
@@ -1,27 +0,0 @@
1
- import { RuleTester } from "eslint";
2
- import { noLabelSlotInCheckbox } from "../src/rules/no-label-slot-in-checkbox";
3
- const tsParser = require.resolve("@typescript-eslint/parser");
4
-
5
- const ruleTester = new RuleTester({
6
- parser: tsParser,
7
- parserOptions: {
8
- ecmaVersion: 2022,
9
- ecmaFeatures: {
10
- jsx: true,
11
- },
12
- sourceType: "module",
13
- },
14
- });
15
-
16
- ruleTester.run("no-label-slot-in-checkbox", noLabelSlotInCheckbox, {
17
- valid: [
18
- { code: "<dnn-checkbox></dnn-checkbox>" },
19
- ],
20
- invalid: [
21
- {
22
- code: "<dnn-checkbox onClick={e => console.log(e)}>Something</dnn-checkbox>",
23
- errors: [{ messageId: "noLabelSlotInCheckbox" }],
24
- output: "<label>\n<dnn-checkbox onClick={e => console.log(e)}></dnn-checkbox>\nSomething\n</label>",
25
- }
26
- ],
27
- });
@@ -1,19 +0,0 @@
1
- import { noLabelSlotInCheckbox } from "./rules/no-label-slot-in-checkbox";
2
-
3
- export const rules = {
4
- "no-label-slot-in-checkbox": noLabelSlotInCheckbox
5
- };
6
-
7
- const plugin = {
8
- rules,
9
- configs: {
10
- recommended: {
11
- plugins: ["@dnn-community/eslint-plugin"],
12
- rules: {
13
- "@dnn-community/no-label-slot-in-checkbox": "error"
14
- }
15
- }
16
- }
17
- }
18
-
19
- export default plugin;
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2019",
4
- "module": "commonjs",
5
- "moduleResolution": "Node",
6
- "outDir": "../../dist/eslint-plugin",
7
- "strict": true,
8
- "esModuleInterop": true,
9
- "declaration": true,
10
- "skipLibCheck": true,
11
- "types": ["jest", "node", "estree-jsx"],
12
- "forceConsistentCasingInFileNames": true,
13
- "sourceMap": true
14
- },
15
- "include": ["src/index.ts"]
16
- }