@atlaskit/eslint-plugin-design-system 13.5.0 → 13.7.0

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 (101) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +2 -0
  3. package/dist/cjs/presets/all-flat.codegen.js +3 -1
  4. package/dist/cjs/presets/all.codegen.js +3 -1
  5. package/dist/cjs/presets/recommended-flat.codegen.js +3 -1
  6. package/dist/cjs/presets/recommended.codegen.js +3 -1
  7. package/dist/cjs/rules/index.codegen.js +5 -1
  8. package/dist/cjs/rules/no-html-anchor/node-types/styled-component/index.js +2 -2
  9. package/dist/cjs/rules/no-html-button/node-types/styled-component/index.js +2 -2
  10. package/dist/cjs/rules/no-html-checkbox/index.js +34 -0
  11. package/dist/cjs/rules/no-html-checkbox/node-types/index.js +12 -0
  12. package/dist/cjs/rules/no-html-checkbox/node-types/jsx-element/index.js +27 -0
  13. package/dist/cjs/rules/no-html-checkbox/node-types/supported.js +70 -0
  14. package/dist/cjs/rules/no-html-image/index.js +40 -0
  15. package/dist/cjs/rules/no-html-image/node-types/index.js +19 -0
  16. package/dist/cjs/rules/no-html-image/node-types/jsx-element/index.js +115 -0
  17. package/dist/cjs/rules/no-html-image/node-types/styled-component/index.js +42 -0
  18. package/dist/cjs/rules/no-html-image/node-types/supported.js +72 -0
  19. package/dist/cjs/rules/{no-html-anchor/node-types/styled-component → utils}/get-styled-component-call.js +1 -1
  20. package/dist/es2019/presets/all-flat.codegen.js +3 -1
  21. package/dist/es2019/presets/all.codegen.js +3 -1
  22. package/dist/es2019/presets/recommended-flat.codegen.js +3 -1
  23. package/dist/es2019/presets/recommended.codegen.js +3 -1
  24. package/dist/es2019/rules/index.codegen.js +5 -1
  25. package/dist/es2019/rules/no-html-anchor/node-types/styled-component/index.js +2 -2
  26. package/dist/es2019/rules/no-html-button/node-types/styled-component/index.js +2 -2
  27. package/dist/es2019/rules/no-html-checkbox/index.js +28 -0
  28. package/dist/es2019/rules/no-html-checkbox/node-types/index.js +1 -0
  29. package/dist/es2019/rules/no-html-checkbox/node-types/jsx-element/index.js +19 -0
  30. package/dist/es2019/rules/no-html-checkbox/node-types/supported.js +60 -0
  31. package/dist/es2019/rules/no-html-image/index.js +34 -0
  32. package/dist/es2019/rules/no-html-image/node-types/index.js +2 -0
  33. package/dist/es2019/rules/no-html-image/node-types/jsx-element/index.js +80 -0
  34. package/dist/es2019/rules/no-html-image/node-types/styled-component/index.js +37 -0
  35. package/dist/es2019/rules/no-html-image/node-types/supported.js +62 -0
  36. package/dist/es2019/rules/{no-html-anchor/node-types/styled-component → utils}/get-styled-component-call.js +1 -1
  37. package/dist/esm/presets/all-flat.codegen.js +3 -1
  38. package/dist/esm/presets/all.codegen.js +3 -1
  39. package/dist/esm/presets/recommended-flat.codegen.js +3 -1
  40. package/dist/esm/presets/recommended.codegen.js +3 -1
  41. package/dist/esm/rules/index.codegen.js +5 -1
  42. package/dist/esm/rules/no-html-anchor/node-types/styled-component/index.js +2 -2
  43. package/dist/esm/rules/no-html-button/node-types/styled-component/index.js +2 -2
  44. package/dist/esm/rules/no-html-checkbox/index.js +28 -0
  45. package/dist/esm/rules/no-html-checkbox/node-types/index.js +1 -0
  46. package/dist/esm/rules/no-html-checkbox/node-types/jsx-element/index.js +18 -0
  47. package/dist/esm/rules/no-html-checkbox/node-types/supported.js +61 -0
  48. package/dist/esm/rules/no-html-image/index.js +34 -0
  49. package/dist/esm/rules/no-html-image/node-types/index.js +2 -0
  50. package/dist/esm/rules/no-html-image/node-types/jsx-element/index.js +106 -0
  51. package/dist/esm/rules/no-html-image/node-types/styled-component/index.js +36 -0
  52. package/dist/esm/rules/no-html-image/node-types/supported.js +63 -0
  53. package/dist/esm/rules/{no-html-button/node-types/styled-component → utils}/get-styled-component-call.js +1 -1
  54. package/dist/types/index.codegen.d.ts +18 -0
  55. package/dist/types/presets/all-flat.codegen.d.ts +2 -0
  56. package/dist/types/presets/all.codegen.d.ts +2 -0
  57. package/dist/types/presets/recommended-flat.codegen.d.ts +2 -0
  58. package/dist/types/presets/recommended.codegen.d.ts +2 -0
  59. package/dist/types/rules/index.codegen.d.ts +2 -0
  60. package/dist/types/rules/no-html-checkbox/index.d.ts +3 -0
  61. package/dist/types/rules/no-html-checkbox/node-types/index.d.ts +1 -0
  62. package/dist/types/rules/no-html-checkbox/node-types/jsx-element/index.d.ts +8 -0
  63. package/dist/types/rules/no-html-checkbox/node-types/supported.d.ts +7 -0
  64. package/dist/types/rules/no-html-image/index.d.ts +3 -0
  65. package/dist/types/rules/no-html-image/node-types/index.d.ts +2 -0
  66. package/dist/types/rules/no-html-image/node-types/jsx-element/index.d.ts +8 -0
  67. package/dist/types/rules/no-html-image/node-types/styled-component/index.d.ts +8 -0
  68. package/dist/types/rules/no-html-image/node-types/supported.d.ts +7 -0
  69. package/dist/types-ts4.5/index.codegen.d.ts +18 -0
  70. package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +2 -0
  71. package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -0
  72. package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +2 -0
  73. package/dist/types-ts4.5/presets/recommended.codegen.d.ts +2 -0
  74. package/dist/types-ts4.5/rules/index.codegen.d.ts +2 -0
  75. package/dist/types-ts4.5/rules/no-html-checkbox/index.d.ts +3 -0
  76. package/dist/types-ts4.5/rules/no-html-checkbox/node-types/index.d.ts +1 -0
  77. package/dist/types-ts4.5/rules/no-html-checkbox/node-types/jsx-element/index.d.ts +8 -0
  78. package/dist/types-ts4.5/rules/no-html-checkbox/node-types/supported.d.ts +7 -0
  79. package/dist/types-ts4.5/rules/no-html-image/index.d.ts +3 -0
  80. package/dist/types-ts4.5/rules/no-html-image/node-types/index.d.ts +2 -0
  81. package/dist/types-ts4.5/rules/no-html-image/node-types/jsx-element/index.d.ts +8 -0
  82. package/dist/types-ts4.5/rules/no-html-image/node-types/styled-component/index.d.ts +8 -0
  83. package/dist/types-ts4.5/rules/no-html-image/node-types/supported.d.ts +7 -0
  84. package/package.json +2 -2
  85. package/dist/cjs/rules/no-html-button/node-types/styled-component/get-styled-component-call.js +0 -47
  86. package/dist/es2019/rules/no-html-button/node-types/styled-component/get-styled-component-call.js +0 -42
  87. package/dist/esm/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.js +0 -42
  88. package/dist/types/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.d.ts +0 -6
  89. package/dist/types/rules/no-html-button/node-types/styled-component/get-styled-component-call.d.ts +0 -6
  90. /package/dist/cjs/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.js +0 -0
  91. /package/dist/cjs/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.js +0 -0
  92. /package/dist/es2019/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.js +0 -0
  93. /package/dist/es2019/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.js +0 -0
  94. /package/dist/esm/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.js +0 -0
  95. /package/dist/esm/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.js +0 -0
  96. /package/dist/types/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.d.ts +0 -0
  97. /package/dist/types/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.d.ts +0 -0
  98. /package/dist/{types-ts4.5/rules/no-html-button/node-types/styled-component → types/rules/utils}/get-styled-component-call.d.ts +0 -0
  99. /package/dist/types-ts4.5/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.d.ts +0 -0
  100. /package/dist/types-ts4.5/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.d.ts +0 -0
  101. /package/dist/types-ts4.5/rules/{no-html-anchor/node-types/styled-component → utils}/get-styled-component-call.d.ts +0 -0
@@ -0,0 +1,61 @@
1
+ import { isNodeOfType } from 'eslint-codemod-utils';
2
+ import * as ast from '../../../ast-nodes';
3
+ var supportedElements = [{
4
+ name: 'input',
5
+ attributes: [{
6
+ name: 'type',
7
+ values: ['checkbox']
8
+ }]
9
+ }];
10
+
11
+ /**
12
+ * Determines if the given JSX element is a supported element to lint with this rule.
13
+ */
14
+ export function isSupportedForLint(jsxNode, elementName) {
15
+ if (!isNodeOfType(jsxNode, 'JSXElement')) {
16
+ return false;
17
+ }
18
+
19
+ // Allow passing in the element name because the jsxNode doesn't
20
+ // represent the element name with styled components
21
+ var elName = elementName || ast.JSXElement.getName(jsxNode);
22
+ if (!elName) {
23
+ return false;
24
+ }
25
+
26
+ // Only check native HTML elements, not components
27
+ if (elName[0] !== elName[0].toLowerCase()) {
28
+ return false;
29
+ }
30
+ var supportedElement = supportedElements.find(function (_ref) {
31
+ var name = _ref.name;
32
+ return name === elName;
33
+ });
34
+ if (!supportedElement) {
35
+ supportedElement = supportedElements.find(function (_ref2) {
36
+ var name = _ref2.name;
37
+ return name === '*';
38
+ });
39
+ }
40
+ if (!supportedElement) {
41
+ return false;
42
+ }
43
+
44
+ // Check if the element has any attributes that are not supported
45
+ var attributes = ast.JSXElement.getAttributes(jsxNode);
46
+ if (supportedElement.attributes && !supportedElement.attributes.every(function (_ref3) {
47
+ var name = _ref3.name,
48
+ values = _ref3.values;
49
+ return attributes.some(function (attribute) {
50
+ if (attribute.type === 'JSXSpreadAttribute') {
51
+ return false;
52
+ }
53
+ var isMatchingName = attribute.name.name === name;
54
+ var isMatchingValues = values && attribute.value && attribute.value.type === 'Literal' && typeof attribute.value.value === 'string' && (values === null || values === void 0 ? void 0 : values.includes(attribute.value.value));
55
+ return isMatchingName && isMatchingValues;
56
+ });
57
+ })) {
58
+ return false;
59
+ }
60
+ return true;
61
+ }
@@ -0,0 +1,34 @@
1
+ import { createLintRule } from '../utils/create-rule';
2
+ import { JSXElement as _JSXElement, StyledComponent } from './node-types';
3
+ var rule = createLintRule({
4
+ meta: {
5
+ name: 'no-html-image',
6
+ type: 'suggestion',
7
+ hasSuggestions: true,
8
+ docs: {
9
+ description: 'Discourage direct usage of HTML image elements in favor of the Atlassian Design System image component.',
10
+ recommended: true,
11
+ severity: 'warn'
12
+ },
13
+ messages: {
14
+ noHtmlImage: "This <{{ name }}> should be replaced with the image component from the Atlassian Design System. ADS images ensure accessible implementations, and provide access to ADS styling features like design tokens."
15
+ }
16
+ },
17
+ create: function create(context) {
18
+ return {
19
+ // transforms styled.<anchor>(...) usages
20
+ CallExpression: function CallExpression(node) {
21
+ StyledComponent.lint(node, {
22
+ context: context
23
+ });
24
+ },
25
+ // transforms <anchor css={...}> usages
26
+ JSXElement: function JSXElement(node) {
27
+ _JSXElement.lint(node, {
28
+ context: context
29
+ });
30
+ }
31
+ };
32
+ }
33
+ });
34
+ export default rule;
@@ -0,0 +1,2 @@
1
+ export { StyledComponent } from './styled-component';
2
+ export { JSXElement } from './jsx-element';
@@ -0,0 +1,106 @@
1
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
2
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4
+ import { isNodeOfType } from 'eslint-codemod-utils';
5
+ import { getSourceCode } from '@atlaskit/eslint-utils/context-compat';
6
+ import * as ast from '../../../../ast-nodes';
7
+ import { isSupportedForLint } from '../supported';
8
+ function isImportDeclaration(node) {
9
+ return node.type === 'ImportDeclaration';
10
+ }
11
+ export var JSXElement = {
12
+ lint: function lint(node, _ref) {
13
+ var context = _ref.context;
14
+ if (!isSupportedForLint(node)) {
15
+ return;
16
+ }
17
+ var nodeName = ast.JSXElement.getName(node);
18
+ var sourceCode = getSourceCode(context);
19
+ var importDeclarations = sourceCode.ast.body.filter(isImportDeclaration);
20
+ var existingImageName = null;
21
+ var usedNames = new Set();
22
+
23
+ // Check for existing imports
24
+ var _iterator = _createForOfIteratorHelper(importDeclarations),
25
+ _step;
26
+ try {
27
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
28
+ var declaration = _step.value;
29
+ var _iterator2 = _createForOfIteratorHelper(declaration.specifiers),
30
+ _step2;
31
+ try {
32
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
33
+ var specifier = _step2.value;
34
+ usedNames.add(specifier.local.name);
35
+ }
36
+ } catch (err) {
37
+ _iterator2.e(err);
38
+ } finally {
39
+ _iterator2.f();
40
+ }
41
+ if (declaration.source.value === '@atlaskit/image') {
42
+ var defaultSpecifier = declaration.specifiers.find(function (specifier) {
43
+ return specifier.type === 'ImportDefaultSpecifier';
44
+ });
45
+ if (defaultSpecifier) {
46
+ existingImageName = defaultSpecifier.local.name;
47
+ }
48
+ }
49
+ }
50
+ } catch (err) {
51
+ _iterator.e(err);
52
+ } finally {
53
+ _iterator.f();
54
+ }
55
+ var generateUniqueName = function generateUniqueName(baseName) {
56
+ var index = 1;
57
+ var newName = baseName;
58
+ while (usedNames.has(newName)) {
59
+ newName = "".concat(baseName).concat(index);
60
+ index++;
61
+ }
62
+ return newName;
63
+ };
64
+ var imageName = existingImageName || generateUniqueName('Image');
65
+ context.report({
66
+ node: node.openingElement,
67
+ messageId: 'noHtmlImage',
68
+ data: {
69
+ name: nodeName
70
+ },
71
+ suggest: [{
72
+ desc: 'Replace with Image component from @atlaskit/image',
73
+ fix: function fix(fixer) {
74
+ var _node$closingElement;
75
+ var openingTagRange = node.openingElement.range;
76
+ var closingTagRange = (_node$closingElement = node.closingElement) === null || _node$closingElement === void 0 ? void 0 : _node$closingElement.range;
77
+ var attributesText = node.openingElement.attributes.filter(function (attr) {
78
+ return !isNodeOfType(attr, 'JSXAttribute') || attr.name.name !== 'role';
79
+ }).map(function (attr) {
80
+ return sourceCode.getText(attr);
81
+ }).join(' ');
82
+ var fixers = [];
83
+
84
+ // Replace <img> with <Image> and retain attributes
85
+ if (openingTagRange) {
86
+ if (node.openingElement.selfClosing) {
87
+ fixers.push(fixer.replaceTextRange([openingTagRange[0] + 1, openingTagRange[1] - 1], "".concat(imageName).concat(attributesText ? " ".concat(attributesText) : '', " /")));
88
+ } else {
89
+ fixers.push(fixer.replaceTextRange([openingTagRange[0] + 1, openingTagRange[1] - 1], "".concat(imageName).concat(attributesText ? " ".concat(attributesText) : '')));
90
+ }
91
+ }
92
+ if (closingTagRange && !node.openingElement.selfClosing) {
93
+ fixers.push(fixer.replaceTextRange([closingTagRange[0] + 2, closingTagRange[1] - 1], imageName));
94
+ }
95
+
96
+ // Add import if not present
97
+ if (!existingImageName) {
98
+ var importStatement = "import ".concat(imageName, " from '@atlaskit/image';\n");
99
+ fixers.push(fixer.insertTextBefore(sourceCode.ast, importStatement));
100
+ }
101
+ return fixers;
102
+ }
103
+ }]
104
+ });
105
+ }
106
+ };
@@ -0,0 +1,36 @@
1
+ /* eslint-disable @repo/internal/react/require-jsdoc */
2
+
3
+ import { isNodeOfType } from 'eslint-codemod-utils';
4
+ import { getScope } from '@atlaskit/eslint-utils/context-compat';
5
+ import { getStyledComponentCall } from '../../../utils/get-styled-component-call';
6
+ import { getJsxElementByName } from '../../utils/get-jsx-element-by-name';
7
+ import { isSupportedForLint } from '../supported';
8
+ export var StyledComponent = {
9
+ lint: function lint(node, _ref) {
10
+ var _getJsxElementByName;
11
+ var context = _ref.context;
12
+ if (!isNodeOfType(node, 'CallExpression') || !isNodeOfType(node.callee, 'MemberExpression') || !isNodeOfType(node.callee.object, 'Identifier') || !isNodeOfType(node.callee.property, 'Identifier')) {
13
+ return;
14
+ }
15
+ var styles = getStyledComponentCall(node);
16
+ var elementName = node.callee.property.name;
17
+ if (!styles || !isNodeOfType(styles.id, 'Identifier')) {
18
+ return;
19
+ }
20
+ var jsxElement = (_getJsxElementByName = getJsxElementByName(styles.id.name, getScope(context, node))) === null || _getJsxElementByName === void 0 ? void 0 : _getJsxElementByName.parent;
21
+ if (!jsxElement) {
22
+ // If there's no JSX element, we can't determine if it's being used as an image or not
23
+ return;
24
+ }
25
+ if (jsxElement && !isSupportedForLint(jsxElement, elementName)) {
26
+ return;
27
+ }
28
+ context.report({
29
+ node: styles,
30
+ messageId: 'noHtmlImage',
31
+ data: {
32
+ name: node.callee.property.name
33
+ }
34
+ });
35
+ }
36
+ };
@@ -0,0 +1,63 @@
1
+ import { isNodeOfType } from 'eslint-codemod-utils';
2
+ import * as ast from '../../../ast-nodes';
3
+ var supportedElements = [{
4
+ name: 'img'
5
+ }, {
6
+ name: '*',
7
+ attributes: [{
8
+ name: 'role',
9
+ values: ['img']
10
+ }]
11
+ }];
12
+
13
+ /**
14
+ * Determines if the given JSX element is a supported element to lint with this rule.
15
+ */
16
+ export function isSupportedForLint(jsxNode, elementName) {
17
+ if (!isNodeOfType(jsxNode, 'JSXElement')) {
18
+ return false;
19
+ }
20
+
21
+ // Allow passing in the element name because the jsxNode doesn't
22
+ // represent the element name with styled components
23
+ var elName = elementName || ast.JSXElement.getName(jsxNode);
24
+ if (!elName) {
25
+ return false;
26
+ }
27
+
28
+ // Only check native HTML elements, not components
29
+ if (elName[0] !== elName[0].toLowerCase()) {
30
+ return false;
31
+ }
32
+ var supportedElement = supportedElements.find(function (_ref) {
33
+ var name = _ref.name;
34
+ return name === elName;
35
+ });
36
+ if (!supportedElement) {
37
+ supportedElement = supportedElements.find(function (_ref2) {
38
+ var name = _ref2.name;
39
+ return name === '*';
40
+ });
41
+ }
42
+ if (!supportedElement) {
43
+ return false;
44
+ }
45
+
46
+ // Check if the element has any attributes that are not supported
47
+ var attributes = ast.JSXElement.getAttributes(jsxNode);
48
+ if (supportedElement.attributes && !supportedElement.attributes.every(function (_ref3) {
49
+ var name = _ref3.name,
50
+ values = _ref3.values;
51
+ return attributes.some(function (attribute) {
52
+ if (attribute.type === 'JSXSpreadAttribute') {
53
+ return false;
54
+ }
55
+ var isMatchingName = attribute.name.name === name;
56
+ var isMatchingValues = values && attribute.value && attribute.value.type === 'Literal' && typeof attribute.value.value === 'string' && (values === null || values === void 0 ? void 0 : values.includes(attribute.value.value));
57
+ return isMatchingName && isMatchingValues;
58
+ });
59
+ })) {
60
+ return false;
61
+ }
62
+ return true;
63
+ }
@@ -23,7 +23,7 @@ export var getStyledComponentCall = function getStyledComponentCall(node) {
23
23
 
24
24
  /**
25
25
  * Some verbose precondition checks but all it does is check
26
- * a call expression is of form `styled.button` or `styled2.button`
26
+ * a call expression is of form `styled.<element>` or `styled2.<element>`
27
27
  */
28
28
  var isStyledCallExpression = function isStyledCallExpression(call) {
29
29
  if (!isNodeOfType(call, 'CallExpression')) {
@@ -34,6 +34,8 @@ export declare const plugin: {
34
34
  'no-exported-keyframes': import("eslint").Rule.RuleModule;
35
35
  'no-html-anchor': import("eslint").Rule.RuleModule;
36
36
  'no-html-button': import("eslint").Rule.RuleModule;
37
+ 'no-html-checkbox': import("eslint").Rule.RuleModule;
38
+ 'no-html-image': import("eslint").Rule.RuleModule;
37
39
  'no-invalid-css-map': import("eslint").Rule.RuleModule;
38
40
  'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
39
41
  'no-legacy-icons': import("eslint").Rule.RuleModule;
@@ -87,6 +89,8 @@ export declare const plugin: {
87
89
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
88
90
  '@atlaskit/design-system/no-html-anchor': "warn";
89
91
  '@atlaskit/design-system/no-html-button': "warn";
92
+ '@atlaskit/design-system/no-html-checkbox': "warn";
93
+ '@atlaskit/design-system/no-html-image': "warn";
90
94
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
91
95
  allowedFunctionCalls: string[][];
92
96
  }];
@@ -144,6 +148,8 @@ export declare const plugin: {
144
148
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
145
149
  '@atlaskit/design-system/no-html-anchor': "warn";
146
150
  '@atlaskit/design-system/no-html-button': "warn";
151
+ '@atlaskit/design-system/no-html-checkbox': "warn";
152
+ '@atlaskit/design-system/no-html-image': "warn";
147
153
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
148
154
  allowedFunctionCalls: string[][];
149
155
  }];
@@ -194,6 +200,8 @@ export declare const plugin: {
194
200
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
195
201
  '@atlaskit/design-system/no-html-anchor': "warn";
196
202
  '@atlaskit/design-system/no-html-button': "warn";
203
+ '@atlaskit/design-system/no-html-checkbox': "warn";
204
+ '@atlaskit/design-system/no-html-image': "warn";
197
205
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
198
206
  allowedFunctionCalls: string[][];
199
207
  }];
@@ -235,6 +243,8 @@ export declare const plugin: {
235
243
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
236
244
  '@atlaskit/design-system/no-html-anchor': "warn";
237
245
  '@atlaskit/design-system/no-html-button': "warn";
246
+ '@atlaskit/design-system/no-html-checkbox': "warn";
247
+ '@atlaskit/design-system/no-html-image': "warn";
238
248
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
239
249
  allowedFunctionCalls: string[][];
240
250
  }];
@@ -282,6 +292,8 @@ declare const configs: {
282
292
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
283
293
  '@atlaskit/design-system/no-html-anchor': "warn";
284
294
  '@atlaskit/design-system/no-html-button': "warn";
295
+ '@atlaskit/design-system/no-html-checkbox': "warn";
296
+ '@atlaskit/design-system/no-html-image': "warn";
285
297
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
286
298
  allowedFunctionCalls: string[][];
287
299
  }];
@@ -339,6 +351,8 @@ declare const configs: {
339
351
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
340
352
  '@atlaskit/design-system/no-html-anchor': "warn";
341
353
  '@atlaskit/design-system/no-html-button': "warn";
354
+ '@atlaskit/design-system/no-html-checkbox': "warn";
355
+ '@atlaskit/design-system/no-html-image': "warn";
342
356
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
343
357
  allowedFunctionCalls: string[][];
344
358
  }];
@@ -389,6 +403,8 @@ declare const configs: {
389
403
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
390
404
  '@atlaskit/design-system/no-html-anchor': "warn";
391
405
  '@atlaskit/design-system/no-html-button': "warn";
406
+ '@atlaskit/design-system/no-html-checkbox': "warn";
407
+ '@atlaskit/design-system/no-html-image': "warn";
392
408
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
393
409
  allowedFunctionCalls: string[][];
394
410
  }];
@@ -430,6 +446,8 @@ declare const configs: {
430
446
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
431
447
  '@atlaskit/design-system/no-html-anchor': "warn";
432
448
  '@atlaskit/design-system/no-html-button': "warn";
449
+ '@atlaskit/design-system/no-html-checkbox': "warn";
450
+ '@atlaskit/design-system/no-html-image': "warn";
433
451
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
434
452
  allowedFunctionCalls: string[][];
435
453
  }];
@@ -17,6 +17,8 @@ declare const _default: {
17
17
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
18
18
  '@atlaskit/design-system/no-html-anchor': "warn";
19
19
  '@atlaskit/design-system/no-html-button': "warn";
20
+ '@atlaskit/design-system/no-html-checkbox': "warn";
21
+ '@atlaskit/design-system/no-html-image': "warn";
20
22
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
21
23
  allowedFunctionCalls: string[][];
22
24
  }];
@@ -17,6 +17,8 @@ declare const _default: {
17
17
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
18
18
  '@atlaskit/design-system/no-html-anchor': "warn";
19
19
  '@atlaskit/design-system/no-html-button': "warn";
20
+ '@atlaskit/design-system/no-html-checkbox': "warn";
21
+ '@atlaskit/design-system/no-html-image': "warn";
20
22
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
21
23
  allowedFunctionCalls: string[][];
22
24
  }];
@@ -12,6 +12,8 @@ declare const _default: {
12
12
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
13
13
  '@atlaskit/design-system/no-html-anchor': "warn";
14
14
  '@atlaskit/design-system/no-html-button': "warn";
15
+ '@atlaskit/design-system/no-html-checkbox': "warn";
16
+ '@atlaskit/design-system/no-html-image': "warn";
15
17
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
16
18
  allowedFunctionCalls: string[][];
17
19
  }];
@@ -12,6 +12,8 @@ declare const _default: {
12
12
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
13
13
  '@atlaskit/design-system/no-html-anchor': "warn";
14
14
  '@atlaskit/design-system/no-html-button': "warn";
15
+ '@atlaskit/design-system/no-html-checkbox': "warn";
16
+ '@atlaskit/design-system/no-html-image': "warn";
15
17
  '@atlaskit/design-system/no-invalid-css-map': ["error", {
16
18
  allowedFunctionCalls: string[][];
17
19
  }];
@@ -18,6 +18,8 @@ export declare const rules: {
18
18
  'no-exported-keyframes': import("eslint").Rule.RuleModule;
19
19
  'no-html-anchor': import("eslint").Rule.RuleModule;
20
20
  'no-html-button': import("eslint").Rule.RuleModule;
21
+ 'no-html-checkbox': import("eslint").Rule.RuleModule;
22
+ 'no-html-image': import("eslint").Rule.RuleModule;
21
23
  'no-invalid-css-map': import("eslint").Rule.RuleModule;
22
24
  'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
23
25
  'no-legacy-icons': import("eslint").Rule.RuleModule;
@@ -0,0 +1,3 @@
1
+ import type { Rule } from 'eslint';
2
+ declare const rule: Rule.RuleModule;
3
+ export default rule;
@@ -0,0 +1 @@
1
+ export { JSXElement } from './jsx-element';
@@ -0,0 +1,8 @@
1
+ import type { Rule } from 'eslint';
2
+ interface MetaData {
3
+ context: Rule.RuleContext;
4
+ }
5
+ export declare const JSXElement: {
6
+ lint(node: Rule.Node, { context }: MetaData): void;
7
+ };
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type EslintNode } from 'eslint-codemod-utils';
2
+ /**
3
+ * Determines if the given JSX element is a supported element to lint with this rule.
4
+ */
5
+ export declare function isSupportedForLint(jsxNode: EslintNode, elementName?: string): jsxNode is Extract<EslintNode, {
6
+ type: 'JSXElement';
7
+ }>;
@@ -0,0 +1,3 @@
1
+ import type { Rule } from 'eslint';
2
+ declare const rule: Rule.RuleModule;
3
+ export default rule;
@@ -0,0 +1,2 @@
1
+ export { StyledComponent } from './styled-component';
2
+ export { JSXElement } from './jsx-element';
@@ -0,0 +1,8 @@
1
+ import type { Rule } from 'eslint';
2
+ interface MetaData {
3
+ context: Rule.RuleContext;
4
+ }
5
+ export declare const JSXElement: {
6
+ lint(node: Rule.Node, { context }: MetaData): void;
7
+ };
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { Rule } from 'eslint';
2
+ interface MetaData {
3
+ context: Rule.RuleContext;
4
+ }
5
+ export declare const StyledComponent: {
6
+ lint(node: Rule.Node, { context }: MetaData): void;
7
+ };
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type EslintNode } from 'eslint-codemod-utils';
2
+ /**
3
+ * Determines if the given JSX element is a supported element to lint with this rule.
4
+ */
5
+ export declare function isSupportedForLint(jsxNode: EslintNode, elementName?: string): jsxNode is Extract<EslintNode, {
6
+ type: 'JSXElement';
7
+ }>;
@@ -34,6 +34,8 @@ export declare const plugin: {
34
34
  'no-exported-keyframes': import("eslint").Rule.RuleModule;
35
35
  'no-html-anchor': import("eslint").Rule.RuleModule;
36
36
  'no-html-button': import("eslint").Rule.RuleModule;
37
+ 'no-html-checkbox': import("eslint").Rule.RuleModule;
38
+ 'no-html-image': import("eslint").Rule.RuleModule;
37
39
  'no-invalid-css-map': import("eslint").Rule.RuleModule;
38
40
  'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
39
41
  'no-legacy-icons': import("eslint").Rule.RuleModule;
@@ -87,6 +89,8 @@ export declare const plugin: {
87
89
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
88
90
  '@atlaskit/design-system/no-html-anchor': "warn";
89
91
  '@atlaskit/design-system/no-html-button': "warn";
92
+ '@atlaskit/design-system/no-html-checkbox': "warn";
93
+ '@atlaskit/design-system/no-html-image': "warn";
90
94
  '@atlaskit/design-system/no-invalid-css-map': [
91
95
  "error",
92
96
  {
@@ -147,6 +151,8 @@ export declare const plugin: {
147
151
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
148
152
  '@atlaskit/design-system/no-html-anchor': "warn";
149
153
  '@atlaskit/design-system/no-html-button': "warn";
154
+ '@atlaskit/design-system/no-html-checkbox': "warn";
155
+ '@atlaskit/design-system/no-html-image': "warn";
150
156
  '@atlaskit/design-system/no-invalid-css-map': [
151
157
  "error",
152
158
  {
@@ -200,6 +206,8 @@ export declare const plugin: {
200
206
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
201
207
  '@atlaskit/design-system/no-html-anchor': "warn";
202
208
  '@atlaskit/design-system/no-html-button': "warn";
209
+ '@atlaskit/design-system/no-html-checkbox': "warn";
210
+ '@atlaskit/design-system/no-html-image': "warn";
203
211
  '@atlaskit/design-system/no-invalid-css-map': [
204
212
  "error",
205
213
  {
@@ -244,6 +252,8 @@ export declare const plugin: {
244
252
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
245
253
  '@atlaskit/design-system/no-html-anchor': "warn";
246
254
  '@atlaskit/design-system/no-html-button': "warn";
255
+ '@atlaskit/design-system/no-html-checkbox': "warn";
256
+ '@atlaskit/design-system/no-html-image': "warn";
247
257
  '@atlaskit/design-system/no-invalid-css-map': [
248
258
  "error",
249
259
  {
@@ -294,6 +304,8 @@ declare const configs: {
294
304
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
295
305
  '@atlaskit/design-system/no-html-anchor': "warn";
296
306
  '@atlaskit/design-system/no-html-button': "warn";
307
+ '@atlaskit/design-system/no-html-checkbox': "warn";
308
+ '@atlaskit/design-system/no-html-image': "warn";
297
309
  '@atlaskit/design-system/no-invalid-css-map': [
298
310
  "error",
299
311
  {
@@ -354,6 +366,8 @@ declare const configs: {
354
366
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
355
367
  '@atlaskit/design-system/no-html-anchor': "warn";
356
368
  '@atlaskit/design-system/no-html-button': "warn";
369
+ '@atlaskit/design-system/no-html-checkbox': "warn";
370
+ '@atlaskit/design-system/no-html-image': "warn";
357
371
  '@atlaskit/design-system/no-invalid-css-map': [
358
372
  "error",
359
373
  {
@@ -407,6 +421,8 @@ declare const configs: {
407
421
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
408
422
  '@atlaskit/design-system/no-html-anchor': "warn";
409
423
  '@atlaskit/design-system/no-html-button': "warn";
424
+ '@atlaskit/design-system/no-html-checkbox': "warn";
425
+ '@atlaskit/design-system/no-html-image': "warn";
410
426
  '@atlaskit/design-system/no-invalid-css-map': [
411
427
  "error",
412
428
  {
@@ -451,6 +467,8 @@ declare const configs: {
451
467
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
452
468
  '@atlaskit/design-system/no-html-anchor': "warn";
453
469
  '@atlaskit/design-system/no-html-button': "warn";
470
+ '@atlaskit/design-system/no-html-checkbox': "warn";
471
+ '@atlaskit/design-system/no-html-image': "warn";
454
472
  '@atlaskit/design-system/no-invalid-css-map': [
455
473
  "error",
456
474
  {
@@ -17,6 +17,8 @@ declare const _default: {
17
17
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
18
18
  '@atlaskit/design-system/no-html-anchor': "warn";
19
19
  '@atlaskit/design-system/no-html-button': "warn";
20
+ '@atlaskit/design-system/no-html-checkbox': "warn";
21
+ '@atlaskit/design-system/no-html-image': "warn";
20
22
  '@atlaskit/design-system/no-invalid-css-map': [
21
23
  "error",
22
24
  {
@@ -17,6 +17,8 @@ declare const _default: {
17
17
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
18
18
  '@atlaskit/design-system/no-html-anchor': "warn";
19
19
  '@atlaskit/design-system/no-html-button': "warn";
20
+ '@atlaskit/design-system/no-html-checkbox': "warn";
21
+ '@atlaskit/design-system/no-html-image': "warn";
20
22
  '@atlaskit/design-system/no-invalid-css-map': [
21
23
  "error",
22
24
  {
@@ -12,6 +12,8 @@ declare const _default: {
12
12
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
13
13
  '@atlaskit/design-system/no-html-anchor': "warn";
14
14
  '@atlaskit/design-system/no-html-button': "warn";
15
+ '@atlaskit/design-system/no-html-checkbox': "warn";
16
+ '@atlaskit/design-system/no-html-image': "warn";
15
17
  '@atlaskit/design-system/no-invalid-css-map': [
16
18
  "error",
17
19
  {
@@ -12,6 +12,8 @@ declare const _default: {
12
12
  '@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop': "error";
13
13
  '@atlaskit/design-system/no-html-anchor': "warn";
14
14
  '@atlaskit/design-system/no-html-button': "warn";
15
+ '@atlaskit/design-system/no-html-checkbox': "warn";
16
+ '@atlaskit/design-system/no-html-image': "warn";
15
17
  '@atlaskit/design-system/no-invalid-css-map': [
16
18
  "error",
17
19
  {
@@ -18,6 +18,8 @@ export declare const rules: {
18
18
  'no-exported-keyframes': import("eslint").Rule.RuleModule;
19
19
  'no-html-anchor': import("eslint").Rule.RuleModule;
20
20
  'no-html-button': import("eslint").Rule.RuleModule;
21
+ 'no-html-checkbox': import("eslint").Rule.RuleModule;
22
+ 'no-html-image': import("eslint").Rule.RuleModule;
21
23
  'no-invalid-css-map': import("eslint").Rule.RuleModule;
22
24
  'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
23
25
  'no-legacy-icons': import("eslint").Rule.RuleModule;