@atlaskit/eslint-plugin-design-system 13.6.0 → 13.8.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 +56 -54
- 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-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-range/index.js +34 -0
- package/dist/cjs/rules/no-html-range/node-types/index.js +12 -0
- package/dist/cjs/rules/no-html-range/node-types/jsx-element/index.js +27 -0
- package/dist/cjs/rules/no-html-range/node-types/supported.js +70 -0
- package/dist/cjs/rules/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-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-range/index.js +28 -0
- package/dist/es2019/rules/no-html-range/node-types/index.js +1 -0
- package/dist/es2019/rules/no-html-range/node-types/jsx-element/index.js +19 -0
- package/dist/es2019/rules/no-html-range/node-types/supported.js +60 -0
- package/dist/es2019/rules/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-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-range/index.js +28 -0
- package/dist/esm/rules/no-html-range/node-types/index.js +1 -0
- package/dist/esm/rules/no-html-range/node-types/jsx-element/index.js +18 -0
- package/dist/esm/rules/no-html-range/node-types/supported.js +61 -0
- package/dist/esm/rules/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-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/rules/no-html-range/index.d.ts +3 -0
- package/dist/types/rules/no-html-range/node-types/index.d.ts +1 -0
- package/dist/types/rules/no-html-range/node-types/jsx-element/index.d.ts +8 -0
- package/dist/types/rules/no-html-range/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-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/dist/types-ts4.5/rules/no-html-range/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/no-html-range/node-types/index.d.ts +1 -0
- package/dist/types-ts4.5/rules/no-html-range/node-types/jsx-element/index.d.ts +8 -0
- package/dist/types-ts4.5/rules/no-html-range/node-types/supported.d.ts +7 -0
- package/package.json +1 -1
- package/dist/cjs/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.js +0 -47
- package/dist/cjs/rules/no-html-button/node-types/styled-component/get-styled-component-call.js +0 -47
- package/dist/cjs/rules/no-html-button/utils/get-jsx-element-by-name.js +0 -53
- package/dist/es2019/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.js +0 -42
- package/dist/es2019/rules/no-html-button/node-types/styled-component/get-styled-component-call.js +0 -42
- package/dist/es2019/rules/no-html-button/utils/get-jsx-element-by-name.js +0 -39
- package/dist/esm/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.js +0 -42
- package/dist/esm/rules/no-html-button/node-types/styled-component/get-styled-component-call.js +0 -42
- package/dist/esm/rules/no-html-button/utils/get-jsx-element-by-name.js +0 -47
- 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-anchor/utils/get-jsx-element-by-name.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/types/rules/no-html-button/utils/get-jsx-element-by-name.d.ts +0 -6
- package/dist/types-ts4.5/rules/no-html-anchor/node-types/styled-component/get-styled-component-call.d.ts +0 -6
- package/dist/types-ts4.5/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/es2019/rules/{no-html-anchor → no-html-image}/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/{types-ts4.5/rules/no-html-button → types/rules/no-html-image}/utils/get-jsx-element-by-name.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
|
@@ -35,6 +35,8 @@ export declare const plugin: {
|
|
|
35
35
|
'no-html-anchor': import("eslint").Rule.RuleModule;
|
|
36
36
|
'no-html-button': import("eslint").Rule.RuleModule;
|
|
37
37
|
'no-html-checkbox': import("eslint").Rule.RuleModule;
|
|
38
|
+
'no-html-image': import("eslint").Rule.RuleModule;
|
|
39
|
+
'no-html-range': import("eslint").Rule.RuleModule;
|
|
38
40
|
'no-invalid-css-map': import("eslint").Rule.RuleModule;
|
|
39
41
|
'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
|
|
40
42
|
'no-legacy-icons': import("eslint").Rule.RuleModule;
|
|
@@ -89,6 +91,8 @@ export declare const plugin: {
|
|
|
89
91
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
90
92
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
91
93
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
94
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
95
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
92
96
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
93
97
|
allowedFunctionCalls: string[][];
|
|
94
98
|
}];
|
|
@@ -147,6 +151,8 @@ export declare const plugin: {
|
|
|
147
151
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
148
152
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
149
153
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
154
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
155
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
150
156
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
151
157
|
allowedFunctionCalls: string[][];
|
|
152
158
|
}];
|
|
@@ -198,6 +204,8 @@ export declare const plugin: {
|
|
|
198
204
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
199
205
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
200
206
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
207
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
208
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
201
209
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
202
210
|
allowedFunctionCalls: string[][];
|
|
203
211
|
}];
|
|
@@ -240,6 +248,8 @@ export declare const plugin: {
|
|
|
240
248
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
241
249
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
242
250
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
251
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
252
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
243
253
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
244
254
|
allowedFunctionCalls: string[][];
|
|
245
255
|
}];
|
|
@@ -288,6 +298,8 @@ declare const configs: {
|
|
|
288
298
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
289
299
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
290
300
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
301
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
302
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
291
303
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
292
304
|
allowedFunctionCalls: string[][];
|
|
293
305
|
}];
|
|
@@ -346,6 +358,8 @@ declare const configs: {
|
|
|
346
358
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
347
359
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
348
360
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
361
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
362
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
349
363
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
350
364
|
allowedFunctionCalls: string[][];
|
|
351
365
|
}];
|
|
@@ -397,6 +411,8 @@ declare const configs: {
|
|
|
397
411
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
398
412
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
399
413
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
414
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
415
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
400
416
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
401
417
|
allowedFunctionCalls: string[][];
|
|
402
418
|
}];
|
|
@@ -439,6 +455,8 @@ declare const configs: {
|
|
|
439
455
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
440
456
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
441
457
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
458
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
459
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
442
460
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
443
461
|
allowedFunctionCalls: string[][];
|
|
444
462
|
}];
|
|
@@ -18,6 +18,8 @@ declare const _default: {
|
|
|
18
18
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
19
19
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
20
20
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
21
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
22
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
21
23
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
22
24
|
allowedFunctionCalls: string[][];
|
|
23
25
|
}];
|
|
@@ -18,6 +18,8 @@ declare const _default: {
|
|
|
18
18
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
19
19
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
20
20
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
21
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
22
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
21
23
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
22
24
|
allowedFunctionCalls: string[][];
|
|
23
25
|
}];
|
|
@@ -13,6 +13,8 @@ declare const _default: {
|
|
|
13
13
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
14
14
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
15
15
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
16
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
17
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
16
18
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
17
19
|
allowedFunctionCalls: string[][];
|
|
18
20
|
}];
|
|
@@ -13,6 +13,8 @@ declare const _default: {
|
|
|
13
13
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
14
14
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
15
15
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
16
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
17
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
16
18
|
'@atlaskit/design-system/no-invalid-css-map': ["error", {
|
|
17
19
|
allowedFunctionCalls: string[][];
|
|
18
20
|
}];
|
|
@@ -19,6 +19,8 @@ export declare const rules: {
|
|
|
19
19
|
'no-html-anchor': import("eslint").Rule.RuleModule;
|
|
20
20
|
'no-html-button': import("eslint").Rule.RuleModule;
|
|
21
21
|
'no-html-checkbox': import("eslint").Rule.RuleModule;
|
|
22
|
+
'no-html-image': import("eslint").Rule.RuleModule;
|
|
23
|
+
'no-html-range': import("eslint").Rule.RuleModule;
|
|
22
24
|
'no-invalid-css-map': import("eslint").Rule.RuleModule;
|
|
23
25
|
'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
|
|
24
26
|
'no-legacy-icons': import("eslint").Rule.RuleModule;
|
|
@@ -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 @@
|
|
|
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
|
+
}>;
|
|
@@ -35,6 +35,8 @@ export declare const plugin: {
|
|
|
35
35
|
'no-html-anchor': import("eslint").Rule.RuleModule;
|
|
36
36
|
'no-html-button': import("eslint").Rule.RuleModule;
|
|
37
37
|
'no-html-checkbox': import("eslint").Rule.RuleModule;
|
|
38
|
+
'no-html-image': import("eslint").Rule.RuleModule;
|
|
39
|
+
'no-html-range': import("eslint").Rule.RuleModule;
|
|
38
40
|
'no-invalid-css-map': import("eslint").Rule.RuleModule;
|
|
39
41
|
'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
|
|
40
42
|
'no-legacy-icons': import("eslint").Rule.RuleModule;
|
|
@@ -89,6 +91,8 @@ export declare const plugin: {
|
|
|
89
91
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
90
92
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
91
93
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
94
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
95
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
92
96
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
93
97
|
"error",
|
|
94
98
|
{
|
|
@@ -150,6 +154,8 @@ export declare const plugin: {
|
|
|
150
154
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
151
155
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
152
156
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
157
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
158
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
153
159
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
154
160
|
"error",
|
|
155
161
|
{
|
|
@@ -204,6 +210,8 @@ export declare const plugin: {
|
|
|
204
210
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
205
211
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
206
212
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
213
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
214
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
207
215
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
208
216
|
"error",
|
|
209
217
|
{
|
|
@@ -249,6 +257,8 @@ export declare const plugin: {
|
|
|
249
257
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
250
258
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
251
259
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
260
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
261
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
252
262
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
253
263
|
"error",
|
|
254
264
|
{
|
|
@@ -300,6 +310,8 @@ declare const configs: {
|
|
|
300
310
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
301
311
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
302
312
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
313
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
314
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
303
315
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
304
316
|
"error",
|
|
305
317
|
{
|
|
@@ -361,6 +373,8 @@ declare const configs: {
|
|
|
361
373
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
362
374
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
363
375
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
376
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
377
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
364
378
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
365
379
|
"error",
|
|
366
380
|
{
|
|
@@ -415,6 +429,8 @@ declare const configs: {
|
|
|
415
429
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
416
430
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
417
431
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
432
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
433
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
418
434
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
419
435
|
"error",
|
|
420
436
|
{
|
|
@@ -460,6 +476,8 @@ declare const configs: {
|
|
|
460
476
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
461
477
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
462
478
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
479
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
480
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
463
481
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
464
482
|
"error",
|
|
465
483
|
{
|
|
@@ -18,6 +18,8 @@ declare const _default: {
|
|
|
18
18
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
19
19
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
20
20
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
21
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
22
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
21
23
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
22
24
|
"error",
|
|
23
25
|
{
|
|
@@ -18,6 +18,8 @@ declare const _default: {
|
|
|
18
18
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
19
19
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
20
20
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
21
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
22
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
21
23
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
22
24
|
"error",
|
|
23
25
|
{
|
|
@@ -13,6 +13,8 @@ declare const _default: {
|
|
|
13
13
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
14
14
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
15
15
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
16
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
17
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
16
18
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
17
19
|
"error",
|
|
18
20
|
{
|
|
@@ -13,6 +13,8 @@ declare const _default: {
|
|
|
13
13
|
'@atlaskit/design-system/no-html-anchor': "warn";
|
|
14
14
|
'@atlaskit/design-system/no-html-button': "warn";
|
|
15
15
|
'@atlaskit/design-system/no-html-checkbox': "warn";
|
|
16
|
+
'@atlaskit/design-system/no-html-image': "warn";
|
|
17
|
+
'@atlaskit/design-system/no-html-range': "warn";
|
|
16
18
|
'@atlaskit/design-system/no-invalid-css-map': [
|
|
17
19
|
"error",
|
|
18
20
|
{
|
|
@@ -19,6 +19,8 @@ export declare const rules: {
|
|
|
19
19
|
'no-html-anchor': import("eslint").Rule.RuleModule;
|
|
20
20
|
'no-html-button': import("eslint").Rule.RuleModule;
|
|
21
21
|
'no-html-checkbox': import("eslint").Rule.RuleModule;
|
|
22
|
+
'no-html-image': import("eslint").Rule.RuleModule;
|
|
23
|
+
'no-html-range': import("eslint").Rule.RuleModule;
|
|
22
24
|
'no-invalid-css-map': import("eslint").Rule.RuleModule;
|
|
23
25
|
'no-keyframes-tagged-template-expression': import("eslint").Rule.RuleModule;
|
|
24
26
|
'no-legacy-icons': import("eslint").Rule.RuleModule;
|
|
@@ -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 @@
|
|
|
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
|
+
}>;
|
package/package.json
CHANGED
package/dist/cjs/rules/no-html-anchor/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.a` or `styled2.a`
|
|
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/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
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getJsxElementByName = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
10
|
-
/**
|
|
11
|
-
* Given a component name finds its JSX usage
|
|
12
|
-
*/
|
|
13
|
-
var getJsxElementByName = exports.getJsxElementByName = function getJsxElementByName(componentName, scope) {
|
|
14
|
-
var _variableDeclaration$;
|
|
15
|
-
var variableDeclaration = scope.variables.find(function (v) {
|
|
16
|
-
return v.name === componentName;
|
|
17
|
-
});
|
|
18
|
-
if (!variableDeclaration) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// length here should be exactly 2 to indicate only two references:
|
|
23
|
-
// one being the variable declaration itself
|
|
24
|
-
// second being the JSX call site
|
|
25
|
-
// we might consider handling multiple local JSX call sites in the future
|
|
26
|
-
// but "this is good enough for now"™️
|
|
27
|
-
if (variableDeclaration.references.length !== 2) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
var jsxUsage = (_variableDeclaration$ = variableDeclaration.references[1]) === null || _variableDeclaration$ === void 0 ? void 0 : _variableDeclaration$.identifier;
|
|
31
|
-
var _variableDeclaration$2 = variableDeclaration.references.map(function (ref) {
|
|
32
|
-
return ref === null || ref === void 0 ? void 0 : ref.identifier;
|
|
33
|
-
}),
|
|
34
|
-
_variableDeclaration$3 = (0, _slicedToArray2.default)(_variableDeclaration$2, 2),
|
|
35
|
-
firstIdentifier = _variableDeclaration$3[0],
|
|
36
|
-
secondIdentifier = _variableDeclaration$3[1];
|
|
37
|
-
// Check if the first reference is a JSXOpeningElement and the second is not or vice versa
|
|
38
|
-
if ((0, _eslintCodemodUtils.isNodeOfType)(firstIdentifier, 'JSXIdentifier') && !(0, _eslintCodemodUtils.isNodeOfType)(secondIdentifier, 'JSXIdentifier')) {
|
|
39
|
-
jsxUsage = firstIdentifier;
|
|
40
|
-
} else if ((0, _eslintCodemodUtils.isNodeOfType)(secondIdentifier, 'JSXIdentifier') && !(0, _eslintCodemodUtils.isNodeOfType)(firstIdentifier, 'JSXIdentifier')) {
|
|
41
|
-
jsxUsage = secondIdentifier;
|
|
42
|
-
} else {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (!(0, _eslintCodemodUtils.isNodeOfType)(jsxUsage, 'JSXIdentifier')) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
var jsxOpeningElement = jsxUsage.parent;
|
|
49
|
-
if (!(0, _eslintCodemodUtils.isNodeOfType)(jsxOpeningElement, 'JSXOpeningElement')) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
return jsxOpeningElement;
|
|
53
|
-
};
|
package/dist/es2019/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 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.a` or `styled2.a`
|
|
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/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
|
-
};
|