@dnncommunity/dnn-elements 0.24.4-beta.3 → 0.24.4-beta.4
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/collection/eslint-plugin/__tests__/no-label-slot-in-checkbox.tests.js +1 -1
- package/dist/collection/eslint-plugin/__tests__/no-label-slot-in-checkbox.tests.js.map +1 -1
- package/dist/collection/eslint-plugin/src/rules/no-label-slot-in-checkbox.js +1 -1
- package/dist/collection/eslint-plugin/src/rules/no-label-slot-in-checkbox.js.map +1 -1
- package/package.json +1 -1
- package/src/eslint-plugin/__tests__/no-label-slot-in-checkbox.tests.ts +1 -1
- package/src/eslint-plugin/dist/no-label-slot-in-checkbox.js +1 -1
- package/src/eslint-plugin/dist/no-label-slot-in-checkbox.js.map +1 -1
- package/src/eslint-plugin/src/rules/no-label-slot-in-checkbox.ts +1 -1
|
@@ -19,7 +19,7 @@ ruleTester.run("no-label-slot-in-checkbox", noLabelSlotInCheckbox, {
|
|
|
19
19
|
{
|
|
20
20
|
code: "<dnn-checkbox onClick={e => console.log(e)}><label>Label Text</label></dnn-checkbox>",
|
|
21
21
|
errors: [{ messageId: "noLabelSlotInCheckbox" }],
|
|
22
|
-
output: "<label>\
|
|
22
|
+
output: "<label>\n<dnn-checkbox onClick={e => console.log(e)}></dnn-checkbox>\nLabel Text\n</label>",
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-label-slot-in-checkbox.tests.js","sourceRoot":"","sources":["../../../src/eslint-plugin/__tests__/no-label-slot-in-checkbox.tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE9D,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;IAC9B,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE;QACX,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE;YACV,GAAG,EAAE,IAAI;SACZ;QACD,UAAU,EAAE,QAAQ;KACvB;CACJ,CAAC,CAAC;AAEH,UAAU,CAAC,GAAG,CAAC,2BAA2B,EAAE,qBAAqB,EAAE;IAC/D,KAAK,EAAE;QACH,EAAE,IAAI,EAAE,+BAA+B,EAAE;KAC5C;IACD,OAAO,EAAE;QACL;YACI,IAAI,EAAE,sFAAsF;YAC5F,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;YAChD,MAAM,EAAE,4FAA4F;SACvG;KACJ;CACJ,CAAC,CAAC","sourcesContent":["import { RuleTester } from \"eslint\";\r\nimport { noLabelSlotInCheckbox } from \"../src/rules/no-label-slot-in-checkbox\";\r\nconst tsParser = require.resolve(\"@typescript-eslint/parser\");\r\n\r\nconst ruleTester = new RuleTester({\r\n parser: tsParser,\r\n parserOptions: {\r\n ecmaVersion: 2022,\r\n ecmaFeatures: {\r\n jsx: true,\r\n },\r\n sourceType: \"module\",\r\n },\r\n});\r\n\r\nruleTester.run(\"no-label-slot-in-checkbox\", noLabelSlotInCheckbox, {\r\n valid: [\r\n { code: \"<dnn-checkbox></dnn-checkbox>\" },\r\n ],\r\n invalid: [\r\n {\r\n code: \"<dnn-checkbox onClick={e => console.log(e)}><label>Label Text</label></dnn-checkbox>\",\r\n errors: [{ messageId: \"noLabelSlotInCheckbox\" }],\r\n output: \"<label>\\
|
|
1
|
+
{"version":3,"file":"no-label-slot-in-checkbox.tests.js","sourceRoot":"","sources":["../../../src/eslint-plugin/__tests__/no-label-slot-in-checkbox.tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE9D,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;IAC9B,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE;QACX,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE;YACV,GAAG,EAAE,IAAI;SACZ;QACD,UAAU,EAAE,QAAQ;KACvB;CACJ,CAAC,CAAC;AAEH,UAAU,CAAC,GAAG,CAAC,2BAA2B,EAAE,qBAAqB,EAAE;IAC/D,KAAK,EAAE;QACH,EAAE,IAAI,EAAE,+BAA+B,EAAE;KAC5C;IACD,OAAO,EAAE;QACL;YACI,IAAI,EAAE,sFAAsF;YAC5F,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;YAChD,MAAM,EAAE,4FAA4F;SACvG;KACJ;CACJ,CAAC,CAAC","sourcesContent":["import { RuleTester } from \"eslint\";\r\nimport { noLabelSlotInCheckbox } from \"../src/rules/no-label-slot-in-checkbox\";\r\nconst tsParser = require.resolve(\"@typescript-eslint/parser\");\r\n\r\nconst ruleTester = new RuleTester({\r\n parser: tsParser,\r\n parserOptions: {\r\n ecmaVersion: 2022,\r\n ecmaFeatures: {\r\n jsx: true,\r\n },\r\n sourceType: \"module\",\r\n },\r\n});\r\n\r\nruleTester.run(\"no-label-slot-in-checkbox\", noLabelSlotInCheckbox, {\r\n valid: [\r\n { code: \"<dnn-checkbox></dnn-checkbox>\" },\r\n ],\r\n invalid: [\r\n {\r\n code: \"<dnn-checkbox onClick={e => console.log(e)}><label>Label Text</label></dnn-checkbox>\",\r\n errors: [{ messageId: \"noLabelSlotInCheckbox\" }],\r\n output: \"<label>\\n<dnn-checkbox onClick={e => console.log(e)}></dnn-checkbox>\\nLabel Text\\n</label>\",\r\n },\r\n ],\r\n});"]}
|
|
@@ -40,7 +40,7 @@ export const noLabelSlotInCheckbox = {
|
|
|
40
40
|
const labelText = context.sourceCode.getText(label).replace(/<label>|<\/label>/g, '').trim();
|
|
41
41
|
const checkboxText = context.sourceCode.getText(node);
|
|
42
42
|
// Combine the label text and checkbox into a label wrapper with multiline formatting
|
|
43
|
-
const fixedText = `<label>\n${
|
|
43
|
+
const fixedText = `<label>\n${checkboxText}</dnn-checkbox>\n${labelText}\n</label>`;
|
|
44
44
|
return fixer.replaceText(parent, fixedText);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1 +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,MAAM,CAAC,MAAM,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,EAAE,CAAC;4BACT,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gCAC1C,OAAO,KAAK,CAAC,IAAI,KAAK,YAAY;oCAC9B,KAAK,CAA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CAAC;4CAC3E,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CACvC,KAAK;gDACL,KAAK,CAAC,IAAI,KAAK,YAAY;gDAC3B,KAAK,CAAC,cAAc;gDACpB,KAAK,CAAC,cAAc,CAAC,IAAI;gDACzB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;gDAClD,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;4CAEhD,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gDACvC,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gDAC7F,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gDAEtD,qFAAqF;gDACrF,MAAM,SAAS,GAAG,YAAY,YAAY,oBAAoB,SAAS,YAAY,CAAC;gDAEpF,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;4CAChD,CAAC;wCACL,CAAC;wCAED,OAAO,IAAI,CAAC;oCAChB,CAAC;iCACJ,CAAC,CAAC;4BACP,CAAC;wBACL,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import type { Rule } from 'eslint';\r\nimport type { JSXOpeningElement } from \"estree-jsx\";\r\n\r\nexport const noLabelSlotInCheckbox: Rule.RuleModule = {\r\n meta: {\r\n type: \"problem\",\r\n docs: {\r\n description: \"Disallow label slot in checkbox\",\r\n recommended: true,\r\n url: \"https://github.com/DNNCommunity/dnn-elements/releases/tag/v0.24.0\",\r\n },\r\n messages: {\r\n noLabelSlotInCheckbox: \"Label slot is not allowed in dnn-checkbox, wrap dnn-checkbox with a label instead.\"\r\n },\r\n fixable: \"code\",\r\n },\r\n create(context: Rule.RuleContext): Rule.RuleListener {\r\n return {\r\n JSXOpeningElement(node: Rule.Node) {\r\n if (node.type === \"JSXOpeningElement\") {\r\n const jsxNode = node as JSXOpeningElement;\r\n if (jsxNode.name.type === \"JSXIdentifier\" && jsxNode.name.name === \"dnn-checkbox\") {\r\n const parent = context.getAncestors().find(ancestor => ancestor.type === \"JSXElement\");\r\n if (parent) {\r\n const hasLabel = parent.children.some(child => {\r\n return child.type === \"JSXElement\" &&\r\n child.openingElement.name.type === \"JSXIdentifier\" &&\r\n child.openingElement.name.name === \"label\";\r\n });\r\n if (hasLabel) {\r\n context.report({\r\n node: node,\r\n messageId: \"noLabelSlotInCheckbox\",\r\n fix: (fixer) => {\r\n if (parent && parent.type === \"JSXElement\" && Array.isArray(parent.children)) {\r\n const label = parent.children.find(child => \r\n child &&\r\n child.type === \"JSXElement\" &&\r\n child.openingElement &&\r\n child.openingElement.name &&\r\n child.openingElement.name.type === \"JSXIdentifier\" &&\r\n child.openingElement.name.name === \"label\");\r\n\r\n if (label && label.type === \"JSXElement\") {\r\n const labelText = context.sourceCode.getText(label).replace(/<label>|<\\/label>/g, '').trim();\r\n const checkboxText = context.sourceCode.getText(node);\r\n\r\n // Combine the label text and checkbox into a label wrapper with multiline formatting\r\n const fixedText = `<label>\\n${checkboxText}</dnn-checkbox>\\n${labelText}\\n</label>`;\r\n\r\n return fixer.replaceText(parent, fixedText);\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }\r\n};\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnncommunity/dnn-elements",
|
|
3
|
-
"version": "0.24.4-beta.
|
|
3
|
+
"version": "0.24.4-beta.4",
|
|
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",
|
|
@@ -21,7 +21,7 @@ ruleTester.run("no-label-slot-in-checkbox", noLabelSlotInCheckbox, {
|
|
|
21
21
|
{
|
|
22
22
|
code: "<dnn-checkbox onClick={e => console.log(e)}><label>Label Text</label></dnn-checkbox>",
|
|
23
23
|
errors: [{ messageId: "noLabelSlotInCheckbox" }],
|
|
24
|
-
output: "<label>\
|
|
24
|
+
output: "<label>\n<dnn-checkbox onClick={e => console.log(e)}></dnn-checkbox>\nLabel Text\n</label>",
|
|
25
25
|
},
|
|
26
26
|
],
|
|
27
27
|
});
|
|
@@ -43,7 +43,7 @@ exports.noLabelSlotInCheckbox = {
|
|
|
43
43
|
const labelText = context.sourceCode.getText(label).replace(/<label>|<\/label>/g, '').trim();
|
|
44
44
|
const checkboxText = context.sourceCode.getText(node);
|
|
45
45
|
// Combine the label text and checkbox into a label wrapper with multiline formatting
|
|
46
|
-
const fixedText = `<label>\n${
|
|
46
|
+
const fixedText = `<label>\n${checkboxText}</dnn-checkbox>\n${labelText}\n</label>`;
|
|
47
47
|
return fixer.replaceText(parent, fixedText);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-label-slot-in-checkbox.js","sourceRoot":"","sources":["../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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AAC,CAAC;4CAChD,CAAC;wCACL,CAAC;wCAED,OAAO,IAAI,CAAC;oCAChB,CAAC;iCACJ,CAAC,CAAC;4BACP,CAAC;wBACL,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
|
|
@@ -46,7 +46,7 @@ export const noLabelSlotInCheckbox: Rule.RuleModule = {
|
|
|
46
46
|
const checkboxText = context.sourceCode.getText(node);
|
|
47
47
|
|
|
48
48
|
// Combine the label text and checkbox into a label wrapper with multiline formatting
|
|
49
|
-
const fixedText = `<label>\n${
|
|
49
|
+
const fixedText = `<label>\n${checkboxText}</dnn-checkbox>\n${labelText}\n</label>`;
|
|
50
50
|
|
|
51
51
|
return fixer.replaceText(parent, fixedText);
|
|
52
52
|
}
|