@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,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
+ }>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-design-system",
3
3
  "description": "The essential plugin for use with the Atlassian Design System.",
4
- "version": "13.5.0",
4
+ "version": "13.7.0",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@atlaskit/eslint-utils": "^2.0.0",
47
47
  "@atlaskit/icon": "^25.6.0",
48
- "@atlaskit/icon-lab": "^4.8.0",
48
+ "@atlaskit/icon-lab": "^4.9.0",
49
49
  "@atlaskit/tokens": "^4.8.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@typescript-eslint/utils": "^7.1.0",
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getStyledComponentCall = void 0;
7
- var _eslintCodemodUtils = require("eslint-codemod-utils");
8
- /**
9
- * Returns a styled component
10
- */
11
-
12
- var getStyledComponentCall = exports.getStyledComponentCall = function getStyledComponentCall(node) {
13
- // halts unless we are dealing with a styled component
14
- if (!isStyledCallExpression(node)) {
15
- return;
16
- }
17
- // halts if the component is being exported directly
18
- if ((0, _eslintCodemodUtils.closestOfType)(node, 'ExportNamedDeclaration')) {
19
- return;
20
- }
21
- var styledComponentVariableRef = node.parent;
22
- // halts if the styled component is not assigned to a variable immediately
23
- if (!(0, _eslintCodemodUtils.isNodeOfType)(styledComponentVariableRef, 'VariableDeclarator')) {
24
- return;
25
- }
26
- return styledComponentVariableRef;
27
- };
28
-
29
- /**
30
- * Some verbose precondition checks but all it does is check
31
- * a call expression is of form `styled.button` or `styled2.button`
32
- */
33
- var isStyledCallExpression = function isStyledCallExpression(call) {
34
- if (!(0, _eslintCodemodUtils.isNodeOfType)(call, 'CallExpression')) {
35
- return false;
36
- }
37
- if (!(0, _eslintCodemodUtils.isNodeOfType)(call.callee, 'MemberExpression')) {
38
- return false;
39
- }
40
- if (!(0, _eslintCodemodUtils.isNodeOfType)(call.callee.object, 'Identifier') || !(0, _eslintCodemodUtils.isNodeOfType)(call.callee.property, 'Identifier')) {
41
- return false;
42
- }
43
- if (/^styled2?$/.test(call.callee.object.name)) {
44
- return true;
45
- }
46
- return false;
47
- };
@@ -1,42 +0,0 @@
1
- import { closestOfType, isNodeOfType } from 'eslint-codemod-utils';
2
-
3
- /**
4
- * Returns a styled component
5
- */
6
-
7
- export const getStyledComponentCall = node => {
8
- // halts unless we are dealing with a styled component
9
- if (!isStyledCallExpression(node)) {
10
- return;
11
- }
12
- // halts if the component is being exported directly
13
- if (closestOfType(node, 'ExportNamedDeclaration')) {
14
- return;
15
- }
16
- const styledComponentVariableRef = node.parent;
17
- // halts if the styled component is not assigned to a variable immediately
18
- if (!isNodeOfType(styledComponentVariableRef, 'VariableDeclarator')) {
19
- return;
20
- }
21
- return styledComponentVariableRef;
22
- };
23
-
24
- /**
25
- * Some verbose precondition checks but all it does is check
26
- * a call expression is of form `styled.button` or `styled2.button`
27
- */
28
- const isStyledCallExpression = call => {
29
- if (!isNodeOfType(call, 'CallExpression')) {
30
- return false;
31
- }
32
- if (!isNodeOfType(call.callee, 'MemberExpression')) {
33
- return false;
34
- }
35
- if (!isNodeOfType(call.callee.object, 'Identifier') || !isNodeOfType(call.callee.property, 'Identifier')) {
36
- return false;
37
- }
38
- if (/^styled2?$/.test(call.callee.object.name)) {
39
- return true;
40
- }
41
- return false;
42
- };
@@ -1,42 +0,0 @@
1
- import { closestOfType, isNodeOfType } from 'eslint-codemod-utils';
2
-
3
- /**
4
- * Returns a styled component
5
- */
6
-
7
- export var getStyledComponentCall = function getStyledComponentCall(node) {
8
- // halts unless we are dealing with a styled component
9
- if (!isStyledCallExpression(node)) {
10
- return;
11
- }
12
- // halts if the component is being exported directly
13
- if (closestOfType(node, 'ExportNamedDeclaration')) {
14
- return;
15
- }
16
- var styledComponentVariableRef = node.parent;
17
- // halts if the styled component is not assigned to a variable immediately
18
- if (!isNodeOfType(styledComponentVariableRef, 'VariableDeclarator')) {
19
- return;
20
- }
21
- return styledComponentVariableRef;
22
- };
23
-
24
- /**
25
- * Some verbose precondition checks but all it does is check
26
- * a call expression is of form `styled.a` or `styled2.a`
27
- */
28
- var isStyledCallExpression = function isStyledCallExpression(call) {
29
- if (!isNodeOfType(call, 'CallExpression')) {
30
- return false;
31
- }
32
- if (!isNodeOfType(call.callee, 'MemberExpression')) {
33
- return false;
34
- }
35
- if (!isNodeOfType(call.callee.object, 'Identifier') || !isNodeOfType(call.callee.property, 'Identifier')) {
36
- return false;
37
- }
38
- if (/^styled2?$/.test(call.callee.object.name)) {
39
- return true;
40
- }
41
- return false;
42
- };
@@ -1,6 +0,0 @@
1
- import type { Rule } from 'eslint';
2
- import { type VariableDeclarator } from 'eslint-codemod-utils';
3
- /**
4
- * Returns a styled component
5
- */
6
- export declare const getStyledComponentCall: (node: Rule.Node) => (VariableDeclarator & Rule.NodeParentExtension) | undefined;
@@ -1,6 +0,0 @@
1
- import type { Rule } from 'eslint';
2
- import { type VariableDeclarator } from 'eslint-codemod-utils';
3
- /**
4
- * Returns a styled component
5
- */
6
- export declare const getStyledComponentCall: (node: Rule.Node) => (VariableDeclarator & Rule.NodeParentExtension) | undefined;