@dnncommunity/dnn-elements 0.24.4-beta.13 → 0.24.4-beta.14
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/eslint-plugin/dist/configs/recommended.js +5 -8
- package/eslint-plugin/dist/configs/recommended.js.map +1 -1
- package/eslint-plugin/dist/index.d.ts +1 -1
- package/eslint-plugin/dist/index.js +6 -8
- package/eslint-plugin/dist/index.js.map +1 -1
- package/eslint-plugin/dist/rules/index.d.ts +1 -1
- package/eslint-plugin/dist/rules/index.js +3 -6
- package/eslint-plugin/dist/rules/index.js.map +1 -1
- package/eslint-plugin/dist/rules/no-label-slot-in-checkbox.d.ts +1 -1
- package/eslint-plugin/dist/rules/no-label-slot-in-checkbox.js +2 -5
- package/eslint-plugin/dist/rules/no-label-slot-in-checkbox.js.map +1 -1
- package/eslint-plugin/dist/rules/no-label-slot-in-checkbox.tests.js +4 -6
- package/eslint-plugin/dist/rules/no-label-slot-in-checkbox.tests.js.map +1 -1
- package/eslint-plugin/dist/types/plugin.js +1 -2
- package/eslint-plugin/dist/utils.js +2 -5
- package/eslint-plugin/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.flatRecommended = exports.recommended = void 0;
|
|
4
|
-
const rules_1 = require("../rules");
|
|
1
|
+
import { rules } from "../rules/index.js";
|
|
5
2
|
// 🔁 Dynamically generate rule names with prefix
|
|
6
3
|
const pluginName = "dnn-elements";
|
|
7
|
-
const prefixedRules = Object.fromEntries(Object.keys(
|
|
4
|
+
const prefixedRules = Object.fromEntries(Object.keys(rules).map(ruleName => [
|
|
8
5
|
`${pluginName}/${ruleName}`,
|
|
9
6
|
"error",
|
|
10
7
|
]));
|
|
11
8
|
// ✅ Classic config (extends-based)
|
|
12
|
-
|
|
9
|
+
export const recommended = {
|
|
13
10
|
plugins: [pluginName],
|
|
14
11
|
rules: prefixedRules,
|
|
15
12
|
};
|
|
16
13
|
// ✅ Flat config (for modern eslint.config.js)
|
|
17
|
-
|
|
14
|
+
export const flatRecommended = [
|
|
18
15
|
{
|
|
19
16
|
plugins: {
|
|
20
17
|
[pluginName]: {
|
|
21
|
-
rules
|
|
18
|
+
rules,
|
|
22
19
|
},
|
|
23
20
|
},
|
|
24
21
|
rules: prefixedRules,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,iDAAiD;AACjD,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC,MAAM,aAAa,GAAuB,MAAM,CAAC,WAAW,CAC1D,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjC,GAAG,UAAU,IAAI,QAAQ,EAAE;IAC3B,OAAgB;CACjB,CAAC,CACH,CAAC;AAEF,mCAAmC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAkB;IACxC,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,KAAK,EAAE,aAAa;CACrB,CAAC;AAEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAwB;IAClD;QACE,OAAO,EAAE;YACP,CAAC,UAAU,CAAC,EAAE;gBACZ,KAAK;aACN;SACF;QACD,KAAK,EAAE,aAAa;KACrB;CACF,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\r\nimport type { FlatConfig } from \"@typescript-eslint/utils/ts-eslint\";\r\nimport { rules } from \"../rules/index.js\";\r\n\r\n// 🔁 Dynamically generate rule names with prefix\r\nconst pluginName = \"dnn-elements\";\r\n\r\nconst prefixedRules: Linter.RulesRecord = Object.fromEntries(\r\n Object.keys(rules).map(ruleName => [\r\n `${pluginName}/${ruleName}`,\r\n \"error\" as const,\r\n ])\r\n);\r\n\r\n// ✅ Classic config (extends-based)\r\nexport const recommended: Linter.Config = {\r\n plugins: [pluginName],\r\n rules: prefixedRules,\r\n};\r\n\r\n// ✅ Flat config (for modern eslint.config.js)\r\nexport const flatRecommended: FlatConfig.Config[] = [\r\n {\r\n plugins: {\r\n [pluginName]: {\r\n rules,\r\n },\r\n },\r\n rules: prefixedRules,\r\n },\r\n];\r\n"]}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const rules_1 = require("./rules");
|
|
4
|
-
const recommended_1 = require("./configs/recommended");
|
|
1
|
+
import { rules } from "./rules/index.js";
|
|
2
|
+
import { recommended, flatRecommended } from "./configs/recommended.js";
|
|
5
3
|
const { name, version } = require("../../package.json");
|
|
6
4
|
const plugin = {
|
|
7
5
|
meta: { name, version },
|
|
8
|
-
rules
|
|
6
|
+
rules,
|
|
9
7
|
configs: {
|
|
10
|
-
recommended
|
|
8
|
+
recommended,
|
|
11
9
|
flat: {
|
|
12
|
-
recommended:
|
|
10
|
+
recommended: flatRecommended,
|
|
13
11
|
},
|
|
14
12
|
},
|
|
15
13
|
};
|
|
16
|
-
|
|
14
|
+
export default plugin;
|
|
17
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAExE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAGnD,CAAC;AAEJ,MAAM,MAAM,GAAW;IACrB,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;IACvB,KAAK;IACL,OAAO,EAAE;QACP,WAAW;QACX,IAAI,EAAE;YACJ,WAAW,EAAE,eAAe;SAC7B;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { rules } from \"./rules/index.js\";\r\nimport { recommended, flatRecommended } from \"./configs/recommended.js\";\r\nimport type { Plugin } from \"./types/plugin.js\";\r\nconst { name, version } = require(\"../../package.json\") as {\r\n name: string;\r\n version: string;\r\n };\r\n\r\nconst plugin: Plugin = {\r\n meta: { name, version },\r\n rules,\r\n configs: {\r\n recommended,\r\n flat: {\r\n recommended: flatRecommended,\r\n },\r\n },\r\n};\r\n\r\nexport default plugin;\r\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const rules: {
|
|
2
|
-
"no-label-slot-in-checkbox": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLabelSlotInCheckbox", [], import("../utils").TypedLintingRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
|
+
"no-label-slot-in-checkbox": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLabelSlotInCheckbox", [], import("../utils.js").TypedLintingRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
3
3
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const no_label_slot_in_checkbox_1 = require("./no-label-slot-in-checkbox");
|
|
5
|
-
exports.rules = {
|
|
6
|
-
"no-label-slot-in-checkbox": no_label_slot_in_checkbox_1.rule,
|
|
1
|
+
import { rule as noLabelSlotInCheckbox } from "./no-label-slot-in-checkbox.js";
|
|
2
|
+
export const rules = {
|
|
3
|
+
"no-label-slot-in-checkbox": noLabelSlotInCheckbox,
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE/E,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,2BAA2B,EAAE,qBAAqB;CACrD,CAAA","sourcesContent":["import { rule as noLabelSlotInCheckbox } from \"./no-label-slot-in-checkbox.js\";\r\n\r\nexport const rules = {\r\n \"no-label-slot-in-checkbox\": noLabelSlotInCheckbox,\r\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLabelSlotInCheckbox", [], import("../utils").TypedLintingRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
1
|
+
export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLabelSlotInCheckbox", [], import("../utils.js").TypedLintingRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.rule = void 0;
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
exports.rule = (0, utils_1.createRule)({
|
|
1
|
+
import { createRule } from "../utils.js";
|
|
2
|
+
export const rule = createRule({
|
|
6
3
|
name: "no-label-slot-in-checkbox",
|
|
7
4
|
defaultOptions: [],
|
|
8
5
|
meta: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-label-slot-in-checkbox.js","sourceRoot":"","sources":["../../src/rules/no-label-slot-in-checkbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-label-slot-in-checkbox.js","sourceRoot":"","sources":["../../src/rules/no-label-slot-in-checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA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AAC;gBACL,CAAC;YACL,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import { createRule } from \"../utils.js\";\r\n\r\nexport const rule = createRule({\r\n name: \"no-label-slot-in-checkbox\",\r\n defaultOptions: [],\r\n meta: {\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 type: \"problem\",\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 schema: [], // Ensure schema is defined as an empty array or with the appropriate schema definition\r\n },\r\n create(context) {\r\n return {\r\n JSXElement(node) {\r\n if (\r\n node.openingElement.name.type === \"JSXIdentifier\" &&\r\n node.openingElement.name.name === \"dnn-checkbox\"\r\n ) {\r\n const innerContent = node.children\r\n .map(child => context.sourceCode.getText(child))\r\n .join(\"\")\r\n .trim();\r\n \r\n if (innerContent) {\r\n context.report({\r\n node,\r\n messageId: \"noLabelSlotInCheckbox\",\r\n fix: fixer => {\r\n const checkboxText = context.sourceCode.getText(node.openingElement);\r\n const selfClosing = checkboxText.replace(/>$/, \" />\");\r\n \r\n const replacement = `<label>\\n${selfClosing}\\n${innerContent}\\n</label>`;\r\n return fixer.replaceText(node, replacement);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n };\r\n },\r\n});\r\n"]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const no_label_slot_in_checkbox_1 = require("./no-label-slot-in-checkbox");
|
|
5
|
-
const ruleTester = new rule_tester_1.RuleTester();
|
|
1
|
+
import { RuleTester } from "@typescript-eslint/rule-tester";
|
|
2
|
+
import { rule } from "./no-label-slot-in-checkbox.js";
|
|
3
|
+
const ruleTester = new RuleTester();
|
|
6
4
|
// Define a reusable configuration for JSX parser options
|
|
7
5
|
const jsxParserOptions = {
|
|
8
6
|
parserOptions: {
|
|
@@ -11,7 +9,7 @@ const jsxParserOptions = {
|
|
|
11
9
|
},
|
|
12
10
|
},
|
|
13
11
|
};
|
|
14
|
-
ruleTester.run("no-label-slot-in-checkbox",
|
|
12
|
+
ruleTester.run("no-label-slot-in-checkbox", rule, {
|
|
15
13
|
valid: [
|
|
16
14
|
{
|
|
17
15
|
code: "<dnn-checkbox></dnn-checkbox>",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-label-slot-in-checkbox.tests.js","sourceRoot":"","sources":["../../src/rules/no-label-slot-in-checkbox.tests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-label-slot-in-checkbox.tests.js","sourceRoot":"","sources":["../../src/rules/no-label-slot-in-checkbox.tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAEtD,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;AAEpC,yDAAyD;AACzD,MAAM,gBAAgB,GAAG;IACrB,aAAa,EAAE;QACX,YAAY,EAAE;YACV,GAAG,EAAE,IAAI;SACZ;KACJ;CACJ,CAAC;AAEF,UAAU,CAAC,GAAG,CAAC,2BAA2B,EAAE,IAAI,EAAE;IAC9C,KAAK,EAAE;QACH;YACI,IAAI,EAAE,+BAA+B;YACrC,eAAe,EAAE,gBAAgB;SACpC;KACJ;IACD,OAAO,EAAE;QACL;YACI,IAAI,EAAE,sEAAsE;YAC5E,eAAe,EAAE,gBAAgB;YACjC,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;YAChD,MAAM,EAAE,8EAA8E;SACzF;KACJ;CACJ,CAAC,CAAC","sourcesContent":["import { RuleTester } from \"@typescript-eslint/rule-tester\";\r\nimport { rule } from \"./no-label-slot-in-checkbox.js\";\r\n\r\nconst ruleTester = new RuleTester();\r\n\r\n// Define a reusable configuration for JSX parser options\r\nconst jsxParserOptions = {\r\n parserOptions: {\r\n ecmaFeatures: {\r\n jsx: true,\r\n },\r\n },\r\n};\r\n\r\nruleTester.run(\"no-label-slot-in-checkbox\", rule, {\r\n valid: [\r\n {\r\n code: \"<dnn-checkbox></dnn-checkbox>\",\r\n languageOptions: jsxParserOptions,\r\n },\r\n ],\r\n invalid: [\r\n {\r\n code: \"<dnn-checkbox onClick={e => console.log(e)}>Something</dnn-checkbox>\",\r\n languageOptions: jsxParserOptions,\r\n errors: [{ messageId: \"noLabelSlotInCheckbox\" }],\r\n output: \"<label>\\n<dnn-checkbox onClick={e => console.log(e)} />\\nSomething\\n</label>\",\r\n },\r\n ],\r\n});"]}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createRule = void 0;
|
|
4
|
-
const utils_1 = require("@typescript-eslint/utils");
|
|
1
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
5
2
|
;
|
|
6
|
-
|
|
3
|
+
export const createRule = ESLintUtils.RuleCreator(name => `https://github.com/DNNCommunity/dnn-elements/tree/main/packages/stencil-library/eslint-plugin/docs/${name}.md`);
|
|
7
4
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMtD,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,CAC7C,IAAI,CAAC,EAAE,CAAC,sGAAsG,IAAI,KAAK,CAC1H,CAAC","sourcesContent":["import { ESLintUtils } from \"@typescript-eslint/utils\";\r\n\r\nexport interface TypedLintingRuleDocs {\r\n description: string;\r\n recommended?: boolean;\r\n requiresTyepeChecking?: boolean;\r\n};\r\n\r\nexport const createRule = ESLintUtils.RuleCreator<TypedLintingRuleDocs>(\r\n name => `https://github.com/DNNCommunity/dnn-elements/tree/main/packages/stencil-library/eslint-plugin/docs/${name}.md`\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.14",
|
|
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",
|