@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.
- package/CHANGELOG.md +22 -0
- package/README.md +2 -0
- package/dist/cjs/presets/all-flat.codegen.js +3 -1
- package/dist/cjs/presets/all.codegen.js +3 -1
- package/dist/cjs/presets/recommended-flat.codegen.js +3 -1
- package/dist/cjs/presets/recommended.codegen.js +3 -1
- package/dist/cjs/rules/index.codegen.js +5 -1
- package/dist/cjs/rules/no-html-anchor/node-types/styled-component/index.js +2 -2
- package/dist/cjs/rules/no-html-button/node-types/styled-component/index.js +2 -2
- package/dist/cjs/rules/no-html-checkbox/index.js +34 -0
- package/dist/cjs/rules/no-html-checkbox/node-types/index.js +12 -0
- package/dist/cjs/rules/no-html-checkbox/node-types/jsx-element/index.js +27 -0
- package/dist/cjs/rules/no-html-checkbox/node-types/supported.js +70 -0
- package/dist/cjs/rules/no-html-image/index.js +40 -0
- package/dist/cjs/rules/no-html-image/node-types/index.js +19 -0
- package/dist/cjs/rules/no-html-image/node-types/jsx-element/index.js +115 -0
- package/dist/cjs/rules/no-html-image/node-types/styled-component/index.js +42 -0
- package/dist/cjs/rules/no-html-image/node-types/supported.js +72 -0
- package/dist/cjs/rules/{no-html-anchor/node-types/styled-component → utils}/get-styled-component-call.js +1 -1
- package/dist/es2019/presets/all-flat.codegen.js +3 -1
- package/dist/es2019/presets/all.codegen.js +3 -1
- package/dist/es2019/presets/recommended-flat.codegen.js +3 -1
- package/dist/es2019/presets/recommended.codegen.js +3 -1
- package/dist/es2019/rules/index.codegen.js +5 -1
- package/dist/es2019/rules/no-html-anchor/node-types/styled-component/index.js +2 -2
- package/dist/es2019/rules/no-html-button/node-types/styled-component/index.js +2 -2
- package/dist/es2019/rules/no-html-checkbox/index.js +28 -0
- package/dist/es2019/rules/no-html-checkbox/node-types/index.js +1 -0
- package/dist/es2019/rules/no-html-checkbox/node-types/jsx-element/index.js +19 -0
- package/dist/es2019/rules/no-html-checkbox/node-types/supported.js +60 -0
- package/dist/es2019/rules/no-html-image/index.js +34 -0
- package/dist/es2019/rules/no-html-image/node-types/index.js +2 -0
- package/dist/es2019/rules/no-html-image/node-types/jsx-element/index.js +80 -0
- package/dist/es2019/rules/no-html-image/node-types/styled-component/index.js +37 -0
- package/dist/es2019/rules/no-html-image/node-types/supported.js +62 -0
- package/dist/es2019/rules/{no-html-anchor/node-types/styled-component → utils}/get-styled-component-call.js +1 -1
- package/dist/esm/presets/all-flat.codegen.js +3 -1
- package/dist/esm/presets/all.codegen.js +3 -1
- package/dist/esm/presets/recommended-flat.codegen.js +3 -1
- package/dist/esm/presets/recommended.codegen.js +3 -1
- package/dist/esm/rules/index.codegen.js +5 -1
- package/dist/esm/rules/no-html-anchor/node-types/styled-component/index.js +2 -2
- package/dist/esm/rules/no-html-button/node-types/styled-component/index.js +2 -2
- package/dist/esm/rules/no-html-checkbox/index.js +28 -0
- package/dist/esm/rules/no-html-checkbox/node-types/index.js +1 -0
- package/dist/esm/rules/no-html-checkbox/node-types/jsx-element/index.js +18 -0
- package/dist/esm/rules/no-html-checkbox/node-types/supported.js +61 -0
- package/dist/esm/rules/no-html-image/index.js +34 -0
- package/dist/esm/rules/no-html-image/node-types/index.js +2 -0
- package/dist/esm/rules/no-html-image/node-types/jsx-element/index.js +106 -0
- package/dist/esm/rules/no-html-image/node-types/styled-component/index.js +36 -0
- package/dist/esm/rules/no-html-image/node-types/supported.js +63 -0
- package/dist/esm/rules/{no-html-button/node-types/styled-component → utils}/get-styled-component-call.js +1 -1
- package/dist/types/index.codegen.d.ts +18 -0
- package/dist/types/presets/all-flat.codegen.d.ts +2 -0
- package/dist/types/presets/all.codegen.d.ts +2 -0
- package/dist/types/presets/recommended-flat.codegen.d.ts +2 -0
- package/dist/types/presets/recommended.codegen.d.ts +2 -0
- package/dist/types/rules/index.codegen.d.ts +2 -0
- package/dist/types/rules/no-html-checkbox/index.d.ts +3 -0
- package/dist/types/rules/no-html-checkbox/node-types/index.d.ts +1 -0
- package/dist/types/rules/no-html-checkbox/node-types/jsx-element/index.d.ts +8 -0
- package/dist/types/rules/no-html-checkbox/node-types/supported.d.ts +7 -0
- package/dist/types/rules/no-html-image/index.d.ts +3 -0
- package/dist/types/rules/no-html-image/node-types/index.d.ts +2 -0
- package/dist/types/rules/no-html-image/node-types/jsx-element/index.d.ts +8 -0
- package/dist/types/rules/no-html-image/node-types/styled-component/index.d.ts +8 -0
- package/dist/types/rules/no-html-image/node-types/supported.d.ts +7 -0
- package/dist/types-ts4.5/index.codegen.d.ts +18 -0
- package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +2 -0
- package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -0
- package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +2 -0
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +2 -0
- package/dist/types-ts4.5/rules/index.codegen.d.ts +2 -0
- package/dist/types-ts4.5/rules/no-html-checkbox/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/no-html-checkbox/node-types/index.d.ts +1 -0
- package/dist/types-ts4.5/rules/no-html-checkbox/node-types/jsx-element/index.d.ts +8 -0
- package/dist/types-ts4.5/rules/no-html-checkbox/node-types/supported.d.ts +7 -0
- package/dist/types-ts4.5/rules/no-html-image/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/no-html-image/node-types/index.d.ts +2 -0
- package/dist/types-ts4.5/rules/no-html-image/node-types/jsx-element/index.d.ts +8 -0
- package/dist/types-ts4.5/rules/no-html-image/node-types/styled-component/index.d.ts +8 -0
- package/dist/types-ts4.5/rules/no-html-image/node-types/supported.d.ts +7 -0
- package/package.json +2 -2
- package/dist/cjs/rules/no-html-button/node-types/styled-component/get-styled-component-call.js +0 -47
- package/dist/es2019/rules/no-html-button/node-types/styled-component/get-styled-component-call.js +0 -42
- package/dist/esm/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.js +0 -42
- package/dist/types/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.d.ts +0 -6
- package/dist/types/rules/no-html-button/node-types/styled-component/get-styled-component-call.d.ts +0 -6
- /package/dist/cjs/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.js +0 -0
- /package/dist/cjs/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.js +0 -0
- /package/dist/es2019/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.js +0 -0
- /package/dist/es2019/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.js +0 -0
- /package/dist/esm/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.js +0 -0
- /package/dist/esm/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.js +0 -0
- /package/dist/types/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.d.ts +0 -0
- /package/dist/types/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.d.ts +0 -0
- /package/dist/{types-ts4.5/rules/no-html-button/node-types/styled-component → types/rules/utils}/get-styled-component-call.d.ts +0 -0
- /package/dist/types-ts4.5/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.d.ts +0 -0
- /package/dist/types-ts4.5/rules/{no-html-button/utils → utils}/get-jsx-element-by-name.d.ts +0 -0
- /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 @@
|
|
|
1
|
+
export { JSXElement } from './jsx-element';
|
|
@@ -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,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.
|
|
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.
|
|
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",
|
package/dist/cjs/rules/no-html-button/node-types/styled-component/get-styled-component-call.js
DELETED
|
@@ -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
|
-
};
|
package/dist/es2019/rules/no-html-button/node-types/styled-component/get-styled-component-call.js
DELETED
|
@@ -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
|
-
};
|
package/dist/esm/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.js
DELETED
|
@@ -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
|
-
};
|
package/dist/types/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.d.ts
DELETED
|
@@ -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;
|
package/dist/types/rules/no-html-button/node-types/styled-component/get-styled-component-call.d.ts
DELETED
|
@@ -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;
|
|
File without changes
|
|
File without changes
|
/package/dist/es2019/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types-ts4.5/rules/{no-html-anchor → no-html-image}/utils/get-jsx-element-by-name.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|