@drivenets/eslint-plugin-design-system 0.0.10 → 0.0.12
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/CHANGELOG.md +12 -0
- package/dist/index.cjs +11 -16
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/index.ts +6 -0
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -6,16 +6,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
19
15
|
}
|
|
20
16
|
return to;
|
|
21
17
|
};
|
|
@@ -23,11 +19,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
19
|
value: mod,
|
|
24
20
|
enumerable: true
|
|
25
21
|
}) : target, mod));
|
|
26
|
-
|
|
27
22
|
//#endregion
|
|
28
23
|
let eslint_no_restricted_syntax = require("eslint-no-restricted/syntax");
|
|
29
24
|
eslint_no_restricted_syntax = __toESM(eslint_no_restricted_syntax);
|
|
30
|
-
|
|
31
25
|
//#region src/selectors.ts
|
|
32
26
|
function JSXElement(name, attributes = {}) {
|
|
33
27
|
let selector = `JSXOpeningElement[name.name='${name}']`;
|
|
@@ -41,7 +35,6 @@ function JSXAttribute(name, value) {
|
|
|
41
35
|
if (typeof value !== "undefined") selector += `:matches([value.expression.value='${value}'], [value.value='${value}'])`;
|
|
42
36
|
return selector;
|
|
43
37
|
}
|
|
44
|
-
|
|
45
38
|
//#endregion
|
|
46
39
|
//#region src/create-plugin.ts
|
|
47
40
|
/**
|
|
@@ -52,7 +45,6 @@ function JSXAttribute(name, value) {
|
|
|
52
45
|
function createPlugin(name, ...rules) {
|
|
53
46
|
return (0, eslint_no_restricted_syntax.default)(name, ...rules);
|
|
54
47
|
}
|
|
55
|
-
|
|
56
48
|
//#endregion
|
|
57
49
|
//#region src/index.ts
|
|
58
50
|
const eslintPlugin = createPlugin("@drivenets/design-system", {
|
|
@@ -87,6 +79,10 @@ const eslintPlugin = createPlugin("@drivenets/design-system", {
|
|
|
87
79
|
name: "no-deprecated-ds-chip-group",
|
|
88
80
|
selector: JSXElement("DsChipGroup"),
|
|
89
81
|
message: `DsChipGroup is deprecated. Use DsTagFilter instead.`
|
|
82
|
+
}, {
|
|
83
|
+
name: "no-deprecated-ds-date-input",
|
|
84
|
+
selector: JSXElement("DsDateInput"),
|
|
85
|
+
message: `DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead.`
|
|
90
86
|
}, {
|
|
91
87
|
name: "no-native-button",
|
|
92
88
|
selector: [
|
|
@@ -136,6 +132,5 @@ const eslintPlugin = createPlugin("@drivenets/design-system", {
|
|
|
136
132
|
selector: "ImportDeclaration[source.value=/^@mui\\u002F/]",
|
|
137
133
|
message: "Using MUI components is not allowed. Use DriveNets Design System components instead."
|
|
138
134
|
});
|
|
139
|
-
|
|
140
135
|
//#endregion
|
|
141
|
-
module.exports = eslintPlugin;
|
|
136
|
+
module.exports = eslintPlugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -8,6 +8,6 @@ type Plugin<TRules extends string> = Omit<BasePlugin, 'rules'> & {
|
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/index.d.ts
|
|
11
|
-
declare const eslintPlugin: Plugin<"no-deprecated-ds-button-legacy-design" | "no-deprecated-ds-dialog" | "no-deprecated-ds-confirmation" | "no-deprecated-ds-system-status" | "no-deprecated-ds-dropdown-menu-legacy" | "no-deprecated-ds-radio-group-legacy" | "no-deprecated-ds-chip" | "no-deprecated-ds-chip-group" | "no-native-button" | "no-native-select" | "no-native-checkbox" | "no-native-radio" | "no-native-number-input" | "no-native-text-input" | "no-native-password-input" | "no-native-file-input" | "no-native-textarea" | "no-native-table" | "no-mui">;
|
|
11
|
+
declare const eslintPlugin: Plugin<"no-deprecated-ds-button-legacy-design" | "no-deprecated-ds-dialog" | "no-deprecated-ds-confirmation" | "no-deprecated-ds-system-status" | "no-deprecated-ds-dropdown-menu-legacy" | "no-deprecated-ds-radio-group-legacy" | "no-deprecated-ds-chip" | "no-deprecated-ds-chip-group" | "no-deprecated-ds-date-input" | "no-native-button" | "no-native-select" | "no-native-checkbox" | "no-native-radio" | "no-native-number-input" | "no-native-text-input" | "no-native-password-input" | "no-native-file-input" | "no-native-textarea" | "no-native-table" | "no-mui">;
|
|
12
12
|
export = eslintPlugin;
|
|
13
13
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/create-plugin.ts","../src/index.ts"],"mappings":";;;;KAIK,UAAA,GAAa,UAAA,QAAkB,MAAA;AAAA,KAExB,MAAA,0BAAgC,IAAA,CAAK,UAAA;EAChD,KAAA,EAAO,MAAA,CAAO,MAAA,EAAQ,cAAA;AAAA;;;cCJjB,YAAA,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/create-plugin.ts","../src/index.ts"],"mappings":";;;;KAIK,UAAA,GAAa,UAAA,QAAkB,MAAA;AAAA,KAExB,MAAA,0BAAgC,IAAA,CAAK,UAAA;EAChD,KAAA,EAAO,MAAA,CAAO,MAAA,EAAQ,cAAA;AAAA;;;cCJjB,YAAA,EAmIL,MAAA;AAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ type Plugin<TRules extends string> = Omit<BasePlugin, 'rules'> & {
|
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/index.d.ts
|
|
11
|
-
declare const eslintPlugin: Plugin<"no-deprecated-ds-button-legacy-design" | "no-deprecated-ds-dialog" | "no-deprecated-ds-confirmation" | "no-deprecated-ds-system-status" | "no-deprecated-ds-dropdown-menu-legacy" | "no-deprecated-ds-radio-group-legacy" | "no-deprecated-ds-chip" | "no-deprecated-ds-chip-group" | "no-native-button" | "no-native-select" | "no-native-checkbox" | "no-native-radio" | "no-native-number-input" | "no-native-text-input" | "no-native-password-input" | "no-native-file-input" | "no-native-textarea" | "no-native-table" | "no-mui">;
|
|
11
|
+
declare const eslintPlugin: Plugin<"no-deprecated-ds-button-legacy-design" | "no-deprecated-ds-dialog" | "no-deprecated-ds-confirmation" | "no-deprecated-ds-system-status" | "no-deprecated-ds-dropdown-menu-legacy" | "no-deprecated-ds-radio-group-legacy" | "no-deprecated-ds-chip" | "no-deprecated-ds-chip-group" | "no-deprecated-ds-date-input" | "no-native-button" | "no-native-select" | "no-native-checkbox" | "no-native-radio" | "no-native-number-input" | "no-native-text-input" | "no-native-password-input" | "no-native-file-input" | "no-native-textarea" | "no-native-table" | "no-mui">;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { eslintPlugin as default };
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/create-plugin.ts","../src/index.ts"],"mappings":";;;;KAIK,UAAA,GAAa,UAAA,QAAkB,wBAAA;AAAA,KAExB,MAAA,0BAAgC,IAAA,CAAK,UAAA;EAChD,KAAA,EAAO,MAAA,CAAO,MAAA,EAAQ,cAAA;AAAA;;;cCJjB,YAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/create-plugin.ts","../src/index.ts"],"mappings":";;;;KAIK,UAAA,GAAa,UAAA,QAAkB,wBAAA;AAAA,KAExB,MAAA,0BAAgC,IAAA,CAAK,UAAA;EAChD,KAAA,EAAO,MAAA,CAAO,MAAA,EAAQ,cAAA;AAAA;;;cCJjB,YAAA,EAmIL,MAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import createNoRestrictedSyntax from "eslint-no-restricted/syntax";
|
|
2
|
-
|
|
3
2
|
//#region src/selectors.ts
|
|
4
3
|
function JSXElement(name, attributes = {}) {
|
|
5
4
|
let selector = `JSXOpeningElement[name.name='${name}']`;
|
|
@@ -13,7 +12,6 @@ function JSXAttribute(name, value) {
|
|
|
13
12
|
if (typeof value !== "undefined") selector += `:matches([value.expression.value='${value}'], [value.value='${value}'])`;
|
|
14
13
|
return selector;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
//#endregion
|
|
18
16
|
//#region src/create-plugin.ts
|
|
19
17
|
/**
|
|
@@ -24,7 +22,6 @@ function JSXAttribute(name, value) {
|
|
|
24
22
|
function createPlugin(name, ...rules) {
|
|
25
23
|
return createNoRestrictedSyntax(name, ...rules);
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
//#endregion
|
|
29
26
|
//#region src/index.ts
|
|
30
27
|
const eslintPlugin = createPlugin("@drivenets/design-system", {
|
|
@@ -59,6 +56,10 @@ const eslintPlugin = createPlugin("@drivenets/design-system", {
|
|
|
59
56
|
name: "no-deprecated-ds-chip-group",
|
|
60
57
|
selector: JSXElement("DsChipGroup"),
|
|
61
58
|
message: `DsChipGroup is deprecated. Use DsTagFilter instead.`
|
|
59
|
+
}, {
|
|
60
|
+
name: "no-deprecated-ds-date-input",
|
|
61
|
+
selector: JSXElement("DsDateInput"),
|
|
62
|
+
message: `DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead.`
|
|
62
63
|
}, {
|
|
63
64
|
name: "no-native-button",
|
|
64
65
|
selector: [
|
|
@@ -108,7 +109,7 @@ const eslintPlugin = createPlugin("@drivenets/design-system", {
|
|
|
108
109
|
selector: "ImportDeclaration[source.value=/^@mui\\u002F/]",
|
|
109
110
|
message: "Using MUI components is not allowed. Use DriveNets Design System components instead."
|
|
110
111
|
});
|
|
111
|
-
|
|
112
112
|
//#endregion
|
|
113
113
|
export { eslintPlugin as default };
|
|
114
|
+
|
|
114
115
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/selectors.ts","../src/create-plugin.ts","../src/index.ts"],"sourcesContent":["export function JSXElement(name: string, attributes: Record<string, string> = {}) {\n\tlet selector = `JSXOpeningElement[name.name='${name}']`;\n\n\tObject.entries(attributes).forEach(([attrName, attrValue]) => {\n\t\tselector += `:has( > ${JSXAttribute(attrName, attrValue)} )`;\n\t});\n\n\treturn selector;\n}\n\nexport function JSXAttribute(name: string, value?: string) {\n\tlet selector = `JSXAttribute[name.name='${name}']`;\n\n\tif (typeof value !== 'undefined') {\n\t\t// Match both expressions (prop={'value'}) and literal values (prop=\"value\").\n\t\tselector += `:matches([value.expression.value='${value}'], [value.value='${value}'])`;\n\t}\n\n\treturn selector;\n}\n","import type { RuleDefinition } from '@eslint/core';\nimport type create from 'eslint-no-restricted/syntax';\nimport createNoRestrictedSyntax from 'eslint-no-restricted/syntax';\n\ntype BasePlugin = ReturnType<typeof createNoRestrictedSyntax>;\n\nexport type Plugin<TRules extends string> = Omit<BasePlugin, 'rules'> & {\n\trules: Record<TRules, RuleDefinition>;\n};\n\n/**\n * Typed wrapper around `createNoRestrictedSyntax`.\n *\n * See: https://github.com/bradzacher/eslint-no-restricted/issues/13\n */\nexport function createPlugin<TRules extends string>(\n\tname: string,\n\t...rules: Array<create.RuleConfig<TRules>>\n): Plugin<TRules> {\n\treturn createNoRestrictedSyntax(name, ...rules) as Plugin<TRules>;\n}\n","import { JSXAttribute, JSXElement } from './selectors';\nimport { createPlugin } from './create-plugin';\n\nconst eslintPlugin = createPlugin(\n\t'@drivenets/design-system',\n\t{\n\t\tname: 'no-deprecated-ds-button-legacy-design',\n\t\tselector: [\n\t\t\tJSXElement('DsButton', { design: 'legacy' }),\n\t\t\t`${JSXElement('DsButton')}:not(:has( > ${JSXAttribute('design')} ))`,\n\t\t],\n\t\tmessage: `Using the 'legacy' design for DsButton is deprecated. Use 'v1.2' instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-dialog',\n\t\tselector: JSXElement('DsDialog'),\n\t\tmessage: `DsDialog is deprecated. Use DsModal or DsConfirmation instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-confirmation',\n\t\tselector: JSXElement('DsConfirmation'),\n\t\tmessage: `DsConfirmation is deprecated. Use DsModal instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-system-status',\n\t\tselector: JSXElement('DsSystemStatus'),\n\t\tmessage: `DsSystemStatus is deprecated. Use DsStatusBadge instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-dropdown-menu-legacy',\n\t\tselector: JSXElement('DsDropdownMenuLegacy'),\n\t\tmessage: `DsDropdownMenuLegacy is deprecated. Use DsDropdownMenu instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-radio-group-legacy',\n\t\tselector: JSXElement('DsRadioGroupLegacy'),\n\t\tmessage: `DsRadioGroupLegacy is deprecated. Use DsRadioGroup instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-chip',\n\t\tselector: JSXElement('DsChip'),\n\t\tmessage: `DsChip is deprecated. Use DsTag instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-chip-group',\n\t\tselector: JSXElement('DsChipGroup'),\n\t\tmessage: `DsChipGroup is deprecated. Use DsTagFilter instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-button',\n\t\tselector: [\n\t\t\tJSXElement('button'),\n\t\t\tJSXElement('input', { type: 'button' }),\n\t\t\tJSXElement('input', { type: 'submit' }),\n\t\t],\n\t\tmessage: `Using a native button is not allowed. Use DsButton instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-select',\n\t\tselector: JSXElement('select'),\n\t\tmessage: `Using a native select is not allowed. Use DsSelect or DsFormControl.Select instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-checkbox',\n\t\tselector: JSXElement('input', { type: 'checkbox' }),\n\t\tmessage: `Using a native checkbox is not allowed. Use DsCheckbox instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-radio',\n\t\tselector: JSXElement('input', { type: 'radio' }),\n\t\tmessage: `Using a native radio input is not allowed. Use DsRadioGroup instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-number-input',\n\t\tselector: JSXElement('input', { type: 'number' }),\n\t\tmessage: `Using a native number input is not allowed. Use DsNumberInput or DsFormControl.NumberInput instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-text-input',\n\t\tselector: [\n\t\t\tJSXElement('input', { type: 'text' }),\n\t\t\t`${JSXElement('input')}:not(:has( > ${JSXAttribute('type')} ))`,\n\t\t],\n\t\tmessage: `Using a native text input is not allowed. Use DsTextInput or DsFormControl.TextInput instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-password-input',\n\t\tselector: JSXElement('input', { type: 'password' }),\n\t\tmessage: `Using a native password input is not allowed. Use DsPasswordInput or DsFormControl.PasswordInput instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-file-input',\n\t\tselector: JSXElement('input', { type: 'file' }),\n\t\tmessage: `Using a native file input is not allowed. Use DsFileUpload instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-textarea',\n\t\tselector: JSXElement('textarea'),\n\t\tmessage: `Using a native textarea is not allowed. Use DsTextarea or DsFormControl.Textarea instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-table',\n\t\tselector: JSXElement('table'),\n\t\tmessage: `Using a native table is not allowed. Use DsTable instead.`,\n\t},\n\n\t{\n\t\tname: 'no-mui',\n\t\tselector: 'ImportDeclaration[source.value=/^@mui\\\\u002F/]',\n\t\tmessage: 'Using MUI components is not allowed. Use DriveNets Design System components instead.',\n\t},\n);\n\nexport default eslintPlugin;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/selectors.ts","../src/create-plugin.ts","../src/index.ts"],"sourcesContent":["export function JSXElement(name: string, attributes: Record<string, string> = {}) {\n\tlet selector = `JSXOpeningElement[name.name='${name}']`;\n\n\tObject.entries(attributes).forEach(([attrName, attrValue]) => {\n\t\tselector += `:has( > ${JSXAttribute(attrName, attrValue)} )`;\n\t});\n\n\treturn selector;\n}\n\nexport function JSXAttribute(name: string, value?: string) {\n\tlet selector = `JSXAttribute[name.name='${name}']`;\n\n\tif (typeof value !== 'undefined') {\n\t\t// Match both expressions (prop={'value'}) and literal values (prop=\"value\").\n\t\tselector += `:matches([value.expression.value='${value}'], [value.value='${value}'])`;\n\t}\n\n\treturn selector;\n}\n","import type { RuleDefinition } from '@eslint/core';\nimport type create from 'eslint-no-restricted/syntax';\nimport createNoRestrictedSyntax from 'eslint-no-restricted/syntax';\n\ntype BasePlugin = ReturnType<typeof createNoRestrictedSyntax>;\n\nexport type Plugin<TRules extends string> = Omit<BasePlugin, 'rules'> & {\n\trules: Record<TRules, RuleDefinition>;\n};\n\n/**\n * Typed wrapper around `createNoRestrictedSyntax`.\n *\n * See: https://github.com/bradzacher/eslint-no-restricted/issues/13\n */\nexport function createPlugin<TRules extends string>(\n\tname: string,\n\t...rules: Array<create.RuleConfig<TRules>>\n): Plugin<TRules> {\n\treturn createNoRestrictedSyntax(name, ...rules) as Plugin<TRules>;\n}\n","import { JSXAttribute, JSXElement } from './selectors';\nimport { createPlugin } from './create-plugin';\n\nconst eslintPlugin = createPlugin(\n\t'@drivenets/design-system',\n\t{\n\t\tname: 'no-deprecated-ds-button-legacy-design',\n\t\tselector: [\n\t\t\tJSXElement('DsButton', { design: 'legacy' }),\n\t\t\t`${JSXElement('DsButton')}:not(:has( > ${JSXAttribute('design')} ))`,\n\t\t],\n\t\tmessage: `Using the 'legacy' design for DsButton is deprecated. Use 'v1.2' instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-dialog',\n\t\tselector: JSXElement('DsDialog'),\n\t\tmessage: `DsDialog is deprecated. Use DsModal or DsConfirmation instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-confirmation',\n\t\tselector: JSXElement('DsConfirmation'),\n\t\tmessage: `DsConfirmation is deprecated. Use DsModal instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-system-status',\n\t\tselector: JSXElement('DsSystemStatus'),\n\t\tmessage: `DsSystemStatus is deprecated. Use DsStatusBadge instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-dropdown-menu-legacy',\n\t\tselector: JSXElement('DsDropdownMenuLegacy'),\n\t\tmessage: `DsDropdownMenuLegacy is deprecated. Use DsDropdownMenu instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-radio-group-legacy',\n\t\tselector: JSXElement('DsRadioGroupLegacy'),\n\t\tmessage: `DsRadioGroupLegacy is deprecated. Use DsRadioGroup instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-chip',\n\t\tselector: JSXElement('DsChip'),\n\t\tmessage: `DsChip is deprecated. Use DsTag instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-chip-group',\n\t\tselector: JSXElement('DsChipGroup'),\n\t\tmessage: `DsChipGroup is deprecated. Use DsTagFilter instead.`,\n\t},\n\n\t{\n\t\tname: 'no-deprecated-ds-date-input',\n\t\tselector: JSXElement('DsDateInput'),\n\t\tmessage: `DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-button',\n\t\tselector: [\n\t\t\tJSXElement('button'),\n\t\t\tJSXElement('input', { type: 'button' }),\n\t\t\tJSXElement('input', { type: 'submit' }),\n\t\t],\n\t\tmessage: `Using a native button is not allowed. Use DsButton instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-select',\n\t\tselector: JSXElement('select'),\n\t\tmessage: `Using a native select is not allowed. Use DsSelect or DsFormControl.Select instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-checkbox',\n\t\tselector: JSXElement('input', { type: 'checkbox' }),\n\t\tmessage: `Using a native checkbox is not allowed. Use DsCheckbox instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-radio',\n\t\tselector: JSXElement('input', { type: 'radio' }),\n\t\tmessage: `Using a native radio input is not allowed. Use DsRadioGroup instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-number-input',\n\t\tselector: JSXElement('input', { type: 'number' }),\n\t\tmessage: `Using a native number input is not allowed. Use DsNumberInput or DsFormControl.NumberInput instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-text-input',\n\t\tselector: [\n\t\t\tJSXElement('input', { type: 'text' }),\n\t\t\t`${JSXElement('input')}:not(:has( > ${JSXAttribute('type')} ))`,\n\t\t],\n\t\tmessage: `Using a native text input is not allowed. Use DsTextInput or DsFormControl.TextInput instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-password-input',\n\t\tselector: JSXElement('input', { type: 'password' }),\n\t\tmessage: `Using a native password input is not allowed. Use DsPasswordInput or DsFormControl.PasswordInput instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-file-input',\n\t\tselector: JSXElement('input', { type: 'file' }),\n\t\tmessage: `Using a native file input is not allowed. Use DsFileUpload instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-textarea',\n\t\tselector: JSXElement('textarea'),\n\t\tmessage: `Using a native textarea is not allowed. Use DsTextarea or DsFormControl.Textarea instead.`,\n\t},\n\n\t{\n\t\tname: 'no-native-table',\n\t\tselector: JSXElement('table'),\n\t\tmessage: `Using a native table is not allowed. Use DsTable instead.`,\n\t},\n\n\t{\n\t\tname: 'no-mui',\n\t\tselector: 'ImportDeclaration[source.value=/^@mui\\\\u002F/]',\n\t\tmessage: 'Using MUI components is not allowed. Use DriveNets Design System components instead.',\n\t},\n);\n\nexport default eslintPlugin;\n"],"mappings":";;AAAA,SAAgB,WAAW,MAAc,aAAqC,EAAE,EAAE;CACjF,IAAI,WAAW,gCAAgC,KAAK;AAEpD,QAAO,QAAQ,WAAW,CAAC,SAAS,CAAC,UAAU,eAAe;AAC7D,cAAY,WAAW,aAAa,UAAU,UAAU,CAAC;GACxD;AAEF,QAAO;;AAGR,SAAgB,aAAa,MAAc,OAAgB;CAC1D,IAAI,WAAW,2BAA2B,KAAK;AAE/C,KAAI,OAAO,UAAU,YAEpB,aAAY,qCAAqC,MAAM,oBAAoB,MAAM;AAGlF,QAAO;;;;;;;;;ACHR,SAAgB,aACf,MACA,GAAG,OACc;AACjB,QAAO,yBAAyB,MAAM,GAAG,MAAM;;;;AChBhD,MAAM,eAAe,aACpB,4BACA;CACC,MAAM;CACN,UAAU,CACT,WAAW,YAAY,EAAE,QAAQ,UAAU,CAAC,EAC5C,GAAG,WAAW,WAAW,CAAC,eAAe,aAAa,SAAS,CAAC,KAChE;CACD,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,WAAW;CAChC,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,iBAAiB;CACtC,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,iBAAiB;CACtC,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,uBAAuB;CAC5C,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,qBAAqB;CAC1C,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,SAAS;CAC9B,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,cAAc;CACnC,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,cAAc;CACnC,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU;EACT,WAAW,SAAS;EACpB,WAAW,SAAS,EAAE,MAAM,UAAU,CAAC;EACvC,WAAW,SAAS,EAAE,MAAM,UAAU,CAAC;EACvC;CACD,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,SAAS;CAC9B,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,SAAS,EAAE,MAAM,YAAY,CAAC;CACnD,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,SAAS,EAAE,MAAM,SAAS,CAAC;CAChD,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,SAAS,EAAE,MAAM,UAAU,CAAC;CACjD,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,CACT,WAAW,SAAS,EAAE,MAAM,QAAQ,CAAC,EACrC,GAAG,WAAW,QAAQ,CAAC,eAAe,aAAa,OAAO,CAAC,KAC3D;CACD,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,SAAS,EAAE,MAAM,YAAY,CAAC;CACnD,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,SAAS,EAAE,MAAM,QAAQ,CAAC;CAC/C,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,WAAW;CAChC,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU,WAAW,QAAQ;CAC7B,SAAS;CACT,EAED;CACC,MAAM;CACN,UAAU;CACV,SAAS;CACT,CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drivenets/eslint-plugin-design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
"directory": "/packages/eslint-plugin"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@eslint/core": "^1.1.
|
|
34
|
+
"@eslint/core": "^1.1.1",
|
|
35
35
|
"eslint-no-restricted": "^0.1.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
39
|
-
"@vitest/coverage-v8": "^4.0
|
|
39
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
40
40
|
"eslint": "^10.0.1",
|
|
41
|
-
"publint": "^0.3.
|
|
42
|
-
"tsdown": "^0.
|
|
41
|
+
"publint": "^0.3.18",
|
|
42
|
+
"tsdown": "^0.21.0",
|
|
43
43
|
"typescript": "^5.9.3",
|
|
44
|
-
"vitest": "^4.0
|
|
44
|
+
"vitest": "^4.1.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@typescript-eslint/parser": "^8.50.0",
|
package/src/index.ts
CHANGED
|
@@ -54,6 +54,12 @@ const eslintPlugin = createPlugin(
|
|
|
54
54
|
message: `DsChipGroup is deprecated. Use DsTagFilter instead.`,
|
|
55
55
|
},
|
|
56
56
|
|
|
57
|
+
{
|
|
58
|
+
name: 'no-deprecated-ds-date-input',
|
|
59
|
+
selector: JSXElement('DsDateInput'),
|
|
60
|
+
message: `DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead.`,
|
|
61
|
+
},
|
|
62
|
+
|
|
57
63
|
{
|
|
58
64
|
name: 'no-native-button',
|
|
59
65
|
selector: [
|