@drivenets/eslint-plugin-design-system 0.0.9 → 0.0.11

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @drivenets/eslint-plugin-design-system
2
2
 
3
+ ## 0.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - f2aea4f: Update dependencies
8
+
9
+ ## 0.0.10
10
+
11
+ ### Patch Changes
12
+
13
+ - b23bed1: Add support for ESLint 10
14
+ - 62d0bb7: Update dependencies
15
+
3
16
  ## 0.0.9
4
17
 
5
18
  ### Patch Changes
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
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
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", {
@@ -136,6 +128,5 @@ const eslintPlugin = createPlugin("@drivenets/design-system", {
136
128
  selector: "ImportDeclaration[source.value=/^@mui\\u002F/]",
137
129
  message: "Using MUI components is not allowed. Use DriveNets Design System components instead."
138
130
  });
139
-
140
131
  //#endregion
141
- module.exports = eslintPlugin;
132
+ module.exports = eslintPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/create-plugin.ts","../src/index.ts"],"mappings":";;;;KAQK,UAAA,GAAa,UAAA,QAAkB,MAAA;AAAA,KAExB,MAAA,0BAAgC,IAAA,CAAK,UAAA;EAChD,KAAA,EAAO,MAAA,CAAO,MAAA,EAAQ,cAAA;AAAA;;;cCRjB,YAAA,EA6HL,MAAA;AAAA"}
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,EA6HL,MAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/create-plugin.ts","../src/index.ts"],"mappings":";;;;KAQK,UAAA,GAAa,UAAA,QAAkB,wBAAA;AAAA,KAExB,MAAA,0BAAgC,IAAA,CAAK,UAAA;EAChD,KAAA,EAAO,MAAA,CAAO,MAAA,EAAQ,cAAA;AAAA;;;cCRjB,YAAA,EA6HL,MAAA"}
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,EA6HL,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", {
@@ -108,7 +105,7 @@ const eslintPlugin = createPlugin("@drivenets/design-system", {
108
105
  selector: "ImportDeclaration[source.value=/^@mui\\u002F/]",
109
106
  message: "Using MUI components is not allowed. Use DriveNets Design System components instead."
110
107
  });
111
-
112
108
  //#endregion
113
109
  export { eslintPlugin as default };
110
+
114
111
  //# 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 RuleConfig<TName extends string> = Omit<create.RuleConfig, 'name'> & {\n\tname: TName;\n};\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<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":";;;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;;;;;;;;;;ACCR,SAAgB,aACf,MACA,GAAG,OACc;AACjB,QAAO,yBAAyB,MAAM,GAAG,MAAM;;;;;ACpBhD,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;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"}
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":";;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;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.9",
3
+ "version": "0.0.11",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.cts",
@@ -31,26 +31,28 @@
31
31
  "directory": "/packages/eslint-plugin"
32
32
  },
33
33
  "dependencies": {
34
- "@eslint/core": "^1.1.0",
35
- "eslint-no-restricted": "^0.0.9"
34
+ "@eslint/core": "^1.1.1",
35
+ "eslint-no-restricted": "^0.1.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@arethetypeswrong/cli": "^0.18.2",
39
- "eslint": "^9.39.2",
40
- "publint": "^0.3.17",
41
- "tsdown": "^0.20.3",
39
+ "@vitest/coverage-v8": "^4.0.18",
40
+ "eslint": "^10.0.1",
41
+ "publint": "^0.3.18",
42
+ "tsdown": "^0.21.0",
42
43
  "typescript": "^5.9.3",
43
44
  "vitest": "^4.0.18"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "@typescript-eslint/parser": "^8.50.0",
47
- "eslint": "^9.0.0",
48
+ "eslint": "^9.0.0 || ^10.0.0",
48
49
  "typescript": "^5.0.0"
49
50
  },
50
51
  "scripts": {
51
52
  "lint": "eslint --max-warnings=0 .",
52
53
  "typecheck": "tsc",
53
54
  "test": "vitest",
55
+ "test:coverage": "pnpm test --coverage",
54
56
  "build": "tsdown",
55
57
  "build:lint": "publint && attw --pack"
56
58
  }
@@ -2,10 +2,6 @@ import type { RuleDefinition } from '@eslint/core';
2
2
  import type create from 'eslint-no-restricted/syntax';
3
3
  import createNoRestrictedSyntax from 'eslint-no-restricted/syntax';
4
4
 
5
- type RuleConfig<TName extends string> = Omit<create.RuleConfig, 'name'> & {
6
- name: TName;
7
- };
8
-
9
5
  type BasePlugin = ReturnType<typeof createNoRestrictedSyntax>;
10
6
 
11
7
  export type Plugin<TRules extends string> = Omit<BasePlugin, 'rules'> & {
@@ -19,7 +15,7 @@ export type Plugin<TRules extends string> = Omit<BasePlugin, 'rules'> & {
19
15
  */
20
16
  export function createPlugin<TRules extends string>(
21
17
  name: string,
22
- ...rules: Array<RuleConfig<TRules>>
18
+ ...rules: Array<create.RuleConfig<TRules>>
23
19
  ): Plugin<TRules> {
24
20
  return createNoRestrictedSyntax(name, ...rules) as Plugin<TRules>;
25
21
  }