@atlaskit/eslint-plugin-design-system 10.10.2 → 10.11.1
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 +18 -0
- package/dist/cjs/rules/no-legacy-icons/checks.js +2 -23
- package/dist/cjs/rules/no-legacy-icons/helpers.js +1 -31
- package/dist/cjs/rules/use-heading/config/index.js +2 -4
- package/dist/cjs/rules/use-heading/transformers/native-elements.js +15 -10
- package/dist/cjs/rules/use-primitives/config/index.js +0 -3
- package/dist/cjs/rules/use-primitives-text/config/index.js +2 -4
- package/dist/cjs/rules/use-primitives-text/transformers/emphasis-elements.js +14 -9
- package/dist/cjs/rules/use-primitives-text/transformers/paragraph-elements.js +28 -19
- package/dist/cjs/rules/use-primitives-text/transformers/span-elements.js +14 -9
- package/dist/cjs/rules/use-primitives-text/transformers/strong-elements.js +14 -9
- package/dist/cjs/rules/use-tokens-typography/config/index.js +2 -4
- package/dist/cjs/rules/use-tokens-typography/transformers/style-object.js +12 -6
- package/dist/es2019/rules/no-legacy-icons/checks.js +3 -24
- package/dist/es2019/rules/no-legacy-icons/helpers.js +0 -28
- package/dist/es2019/rules/use-heading/config/index.js +2 -4
- package/dist/es2019/rules/use-heading/transformers/native-elements.js +12 -7
- package/dist/es2019/rules/use-primitives/config/index.js +0 -3
- package/dist/es2019/rules/use-primitives-text/config/index.js +2 -4
- package/dist/es2019/rules/use-primitives-text/transformers/emphasis-elements.js +12 -7
- package/dist/es2019/rules/use-primitives-text/transformers/paragraph-elements.js +25 -15
- package/dist/es2019/rules/use-primitives-text/transformers/span-elements.js +12 -7
- package/dist/es2019/rules/use-primitives-text/transformers/strong-elements.js +12 -7
- package/dist/es2019/rules/use-tokens-typography/config/index.js +2 -4
- package/dist/es2019/rules/use-tokens-typography/transformers/style-object.js +9 -4
- package/dist/esm/rules/no-legacy-icons/checks.js +3 -24
- package/dist/esm/rules/no-legacy-icons/helpers.js +0 -30
- package/dist/esm/rules/use-heading/config/index.js +2 -4
- package/dist/esm/rules/use-heading/transformers/native-elements.js +15 -8
- package/dist/esm/rules/use-primitives/config/index.js +0 -3
- package/dist/esm/rules/use-primitives-text/config/index.js +2 -4
- package/dist/esm/rules/use-primitives-text/transformers/emphasis-elements.js +14 -7
- package/dist/esm/rules/use-primitives-text/transformers/paragraph-elements.js +28 -17
- package/dist/esm/rules/use-primitives-text/transformers/span-elements.js +14 -7
- package/dist/esm/rules/use-primitives-text/transformers/strong-elements.js +14 -7
- package/dist/esm/rules/use-tokens-typography/config/index.js +2 -4
- package/dist/esm/rules/use-tokens-typography/transformers/style-object.js +11 -4
- package/dist/types/rules/no-legacy-icons/helpers.d.ts +1 -6
- package/dist/types/rules/use-heading/config/index.d.ts +2 -1
- package/dist/types/rules/use-primitives/config/index.d.ts +1 -1
- package/dist/types/rules/use-primitives-text/config/index.d.ts +2 -1
- package/dist/types/rules/use-tokens-typography/config/index.d.ts +4 -3
- package/dist/types/rules/use-tokens-typography/utils.d.ts +0 -39
- package/dist/types-ts4.5/rules/no-legacy-icons/helpers.d.ts +1 -6
- package/dist/types-ts4.5/rules/use-heading/config/index.d.ts +2 -1
- package/dist/types-ts4.5/rules/use-primitives/config/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-primitives-text/config/index.d.ts +2 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/config/index.d.ts +4 -3
- package/dist/types-ts4.5/rules/use-tokens-typography/utils.d.ts +0 -39
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
|
-
import { type JSXAttribute, type
|
|
2
|
+
import { type JSXAttribute, type Node } from 'eslint-codemod-utils';
|
|
3
3
|
import { type Size } from './migration-map-temp';
|
|
4
4
|
export type iconMigrationError = Rule.ReportDescriptor;
|
|
5
5
|
export type errorsListManual = {
|
|
@@ -50,11 +50,6 @@ export declare const canMigrateColor: (color: string) => boolean;
|
|
|
50
50
|
export declare const locToString: (node: Node) => string;
|
|
51
51
|
export declare const createCantMigrateReExportError: (node: Node, packageName: string, exportName: string, errors: errorsListManual) => void;
|
|
52
52
|
export declare const createCantMigrateIdentifierError: (node: Node, packageName: string, exportName: string, errors: errorsListManual) => void;
|
|
53
|
-
export declare const findUNSAFEProp: (iconAttr: JSXAttribute, button: JSXOpeningElement) => {
|
|
54
|
-
UNSAFE_size: "small" | "large" | "xlarge" | null;
|
|
55
|
-
UNSAFE_propName: "UNSAFE_iconAfter_size" | "UNSAFE_iconBefore_size" | "UNSAFE_size" | null;
|
|
56
|
-
};
|
|
57
|
-
export declare const createCantMigrateUnsafeProp: (node: Node, propName: string, value: string, packageName: string, iconName: string, errors: errorsListManual) => void;
|
|
58
53
|
export declare const createCantFindSuitableReplacementError: (node: Node, importSource: string, iconName: string, errors: errorsListManual, sizeIssue?: boolean) => void;
|
|
59
54
|
export declare const createCantMigrateFunctionUnknownError: (node: Node, importSource: string, iconName: string, errors: errorsListManual) => void;
|
|
60
55
|
export declare const createCantMigrateColorError: (node: Node, colorValue: string, errors: errorsListManual, importSource: string, iconName: string) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type Pattern = 'native-elements';
|
|
2
2
|
export interface RuleConfig {
|
|
3
3
|
patterns: Pattern[];
|
|
4
|
+
enableUnsafeAutofix: false;
|
|
4
5
|
}
|
|
5
|
-
export declare const getConfig: (overrides: Partial<RuleConfig>) =>
|
|
6
|
+
export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
|
|
6
7
|
export {};
|
|
@@ -2,5 +2,5 @@ type Pattern = 'compiled-css-function' | 'compiled-styled-object' | 'css-templat
|
|
|
2
2
|
export interface RuleConfig {
|
|
3
3
|
patterns: Pattern[];
|
|
4
4
|
}
|
|
5
|
-
export declare const getConfig: (overrides: Partial<RuleConfig>) =>
|
|
5
|
+
export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
|
|
6
6
|
export {};
|
|
@@ -2,6 +2,7 @@ type Pattern = 'paragraph-elements' | 'span-elements' | 'strong-elements' | 'emp
|
|
|
2
2
|
export interface RuleConfig {
|
|
3
3
|
patterns: Pattern[];
|
|
4
4
|
inheritColor: boolean;
|
|
5
|
+
enableUnsafeAutofix: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const getConfig: (overrides: Partial<RuleConfig>) =>
|
|
7
|
+
export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
|
|
7
8
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type JSONSchema4 } from '@typescript-eslint/utils/dist/json-schema';
|
|
2
2
|
export type RuleConfig = {
|
|
3
|
-
failSilently
|
|
4
|
-
shouldEnforceFallbacks
|
|
3
|
+
failSilently: boolean;
|
|
4
|
+
shouldEnforceFallbacks: boolean;
|
|
5
|
+
enableUnsafeAutofix: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const ruleSchema: JSONSchema4;
|
|
7
|
-
export declare const getConfig: (overrides: RuleConfig) => RuleConfig;
|
|
8
|
+
export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
|
|
@@ -42,7 +42,6 @@ export declare const fontFamilyTokens: ({
|
|
|
42
42
|
introduced: string;
|
|
43
43
|
description: string;
|
|
44
44
|
deprecated?: undefined;
|
|
45
|
-
responsiveSmallerVariant?: undefined;
|
|
46
45
|
};
|
|
47
46
|
value: string;
|
|
48
47
|
filePath: string;
|
|
@@ -54,7 +53,6 @@ export declare const fontFamilyTokens: ({
|
|
|
54
53
|
introduced: string;
|
|
55
54
|
description: string;
|
|
56
55
|
deprecated?: undefined;
|
|
57
|
-
responsiveSmallerVariant?: undefined;
|
|
58
56
|
};
|
|
59
57
|
value: string;
|
|
60
58
|
};
|
|
@@ -68,7 +66,6 @@ export declare const fontFamilyTokens: ({
|
|
|
68
66
|
introduced: string;
|
|
69
67
|
description: string;
|
|
70
68
|
deprecated: string;
|
|
71
|
-
responsiveSmallerVariant?: undefined;
|
|
72
69
|
};
|
|
73
70
|
value: string;
|
|
74
71
|
filePath: string;
|
|
@@ -80,7 +77,6 @@ export declare const fontFamilyTokens: ({
|
|
|
80
77
|
introduced: string;
|
|
81
78
|
description: string;
|
|
82
79
|
deprecated: string;
|
|
83
|
-
responsiveSmallerVariant?: undefined;
|
|
84
80
|
};
|
|
85
81
|
value: string;
|
|
86
82
|
};
|
|
@@ -93,7 +89,6 @@ export declare const fontFamilyTokens: ({
|
|
|
93
89
|
state: string;
|
|
94
90
|
introduced: string;
|
|
95
91
|
description: string;
|
|
96
|
-
responsiveSmallerVariant: string;
|
|
97
92
|
deprecated?: undefined;
|
|
98
93
|
};
|
|
99
94
|
value: string;
|
|
@@ -105,7 +100,6 @@ export declare const fontFamilyTokens: ({
|
|
|
105
100
|
state: string;
|
|
106
101
|
introduced: string;
|
|
107
102
|
description: string;
|
|
108
|
-
responsiveSmallerVariant: string;
|
|
109
103
|
deprecated?: undefined;
|
|
110
104
|
};
|
|
111
105
|
value: {
|
|
@@ -120,39 +114,6 @@ export declare const fontFamilyTokens: ({
|
|
|
120
114
|
name: string;
|
|
121
115
|
path: string[];
|
|
122
116
|
cleanName: string;
|
|
123
|
-
} | {
|
|
124
|
-
attributes: {
|
|
125
|
-
group: string;
|
|
126
|
-
state: string;
|
|
127
|
-
introduced: string;
|
|
128
|
-
description: string;
|
|
129
|
-
deprecated?: undefined;
|
|
130
|
-
responsiveSmallerVariant?: undefined;
|
|
131
|
-
};
|
|
132
|
-
value: string;
|
|
133
|
-
filePath: string;
|
|
134
|
-
isSource: boolean;
|
|
135
|
-
original: {
|
|
136
|
-
attributes: {
|
|
137
|
-
group: string;
|
|
138
|
-
state: string;
|
|
139
|
-
introduced: string;
|
|
140
|
-
description: string;
|
|
141
|
-
deprecated?: undefined;
|
|
142
|
-
responsiveSmallerVariant?: undefined;
|
|
143
|
-
};
|
|
144
|
-
value: {
|
|
145
|
-
fontWeight: string;
|
|
146
|
-
fontSize: string;
|
|
147
|
-
lineHeight: string;
|
|
148
|
-
fontFamily: string;
|
|
149
|
-
fontStyle: string;
|
|
150
|
-
letterSpacing: string;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
name: string;
|
|
154
|
-
path: string[];
|
|
155
|
-
cleanName: string;
|
|
156
117
|
})[];
|
|
157
118
|
export declare function findFontFamilyValueForToken(tokenName: string): string;
|
|
158
119
|
export declare function notUndefined<V>(value: V | undefined): value is V;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
|
-
import { type JSXAttribute, type
|
|
2
|
+
import { type JSXAttribute, type Node } from 'eslint-codemod-utils';
|
|
3
3
|
import { type Size } from './migration-map-temp';
|
|
4
4
|
export type iconMigrationError = Rule.ReportDescriptor;
|
|
5
5
|
export type errorsListManual = {
|
|
@@ -50,11 +50,6 @@ export declare const canMigrateColor: (color: string) => boolean;
|
|
|
50
50
|
export declare const locToString: (node: Node) => string;
|
|
51
51
|
export declare const createCantMigrateReExportError: (node: Node, packageName: string, exportName: string, errors: errorsListManual) => void;
|
|
52
52
|
export declare const createCantMigrateIdentifierError: (node: Node, packageName: string, exportName: string, errors: errorsListManual) => void;
|
|
53
|
-
export declare const findUNSAFEProp: (iconAttr: JSXAttribute, button: JSXOpeningElement) => {
|
|
54
|
-
UNSAFE_size: "small" | "large" | "xlarge" | null;
|
|
55
|
-
UNSAFE_propName: "UNSAFE_iconAfter_size" | "UNSAFE_iconBefore_size" | "UNSAFE_size" | null;
|
|
56
|
-
};
|
|
57
|
-
export declare const createCantMigrateUnsafeProp: (node: Node, propName: string, value: string, packageName: string, iconName: string, errors: errorsListManual) => void;
|
|
58
53
|
export declare const createCantFindSuitableReplacementError: (node: Node, importSource: string, iconName: string, errors: errorsListManual, sizeIssue?: boolean) => void;
|
|
59
54
|
export declare const createCantMigrateFunctionUnknownError: (node: Node, importSource: string, iconName: string, errors: errorsListManual) => void;
|
|
60
55
|
export declare const createCantMigrateColorError: (node: Node, colorValue: string, errors: errorsListManual, importSource: string, iconName: string) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type Pattern = 'native-elements';
|
|
2
2
|
export interface RuleConfig {
|
|
3
3
|
patterns: Pattern[];
|
|
4
|
+
enableUnsafeAutofix: false;
|
|
4
5
|
}
|
|
5
|
-
export declare const getConfig: (overrides: Partial<RuleConfig>) =>
|
|
6
|
+
export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
|
|
6
7
|
export {};
|
|
@@ -2,5 +2,5 @@ type Pattern = 'compiled-css-function' | 'compiled-styled-object' | 'css-templat
|
|
|
2
2
|
export interface RuleConfig {
|
|
3
3
|
patterns: Pattern[];
|
|
4
4
|
}
|
|
5
|
-
export declare const getConfig: (overrides: Partial<RuleConfig>) =>
|
|
5
|
+
export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
|
|
6
6
|
export {};
|
|
@@ -2,6 +2,7 @@ type Pattern = 'paragraph-elements' | 'span-elements' | 'strong-elements' | 'emp
|
|
|
2
2
|
export interface RuleConfig {
|
|
3
3
|
patterns: Pattern[];
|
|
4
4
|
inheritColor: boolean;
|
|
5
|
+
enableUnsafeAutofix: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const getConfig: (overrides: Partial<RuleConfig>) =>
|
|
7
|
+
export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
|
|
7
8
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type JSONSchema4 } from '@typescript-eslint/utils/dist/json-schema';
|
|
2
2
|
export type RuleConfig = {
|
|
3
|
-
failSilently
|
|
4
|
-
shouldEnforceFallbacks
|
|
3
|
+
failSilently: boolean;
|
|
4
|
+
shouldEnforceFallbacks: boolean;
|
|
5
|
+
enableUnsafeAutofix: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const ruleSchema: JSONSchema4;
|
|
7
|
-
export declare const getConfig: (overrides: RuleConfig) => RuleConfig;
|
|
8
|
+
export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
|
|
@@ -42,7 +42,6 @@ export declare const fontFamilyTokens: ({
|
|
|
42
42
|
introduced: string;
|
|
43
43
|
description: string;
|
|
44
44
|
deprecated?: undefined;
|
|
45
|
-
responsiveSmallerVariant?: undefined;
|
|
46
45
|
};
|
|
47
46
|
value: string;
|
|
48
47
|
filePath: string;
|
|
@@ -54,7 +53,6 @@ export declare const fontFamilyTokens: ({
|
|
|
54
53
|
introduced: string;
|
|
55
54
|
description: string;
|
|
56
55
|
deprecated?: undefined;
|
|
57
|
-
responsiveSmallerVariant?: undefined;
|
|
58
56
|
};
|
|
59
57
|
value: string;
|
|
60
58
|
};
|
|
@@ -68,7 +66,6 @@ export declare const fontFamilyTokens: ({
|
|
|
68
66
|
introduced: string;
|
|
69
67
|
description: string;
|
|
70
68
|
deprecated: string;
|
|
71
|
-
responsiveSmallerVariant?: undefined;
|
|
72
69
|
};
|
|
73
70
|
value: string;
|
|
74
71
|
filePath: string;
|
|
@@ -80,7 +77,6 @@ export declare const fontFamilyTokens: ({
|
|
|
80
77
|
introduced: string;
|
|
81
78
|
description: string;
|
|
82
79
|
deprecated: string;
|
|
83
|
-
responsiveSmallerVariant?: undefined;
|
|
84
80
|
};
|
|
85
81
|
value: string;
|
|
86
82
|
};
|
|
@@ -93,7 +89,6 @@ export declare const fontFamilyTokens: ({
|
|
|
93
89
|
state: string;
|
|
94
90
|
introduced: string;
|
|
95
91
|
description: string;
|
|
96
|
-
responsiveSmallerVariant: string;
|
|
97
92
|
deprecated?: undefined;
|
|
98
93
|
};
|
|
99
94
|
value: string;
|
|
@@ -105,7 +100,6 @@ export declare const fontFamilyTokens: ({
|
|
|
105
100
|
state: string;
|
|
106
101
|
introduced: string;
|
|
107
102
|
description: string;
|
|
108
|
-
responsiveSmallerVariant: string;
|
|
109
103
|
deprecated?: undefined;
|
|
110
104
|
};
|
|
111
105
|
value: {
|
|
@@ -120,39 +114,6 @@ export declare const fontFamilyTokens: ({
|
|
|
120
114
|
name: string;
|
|
121
115
|
path: string[];
|
|
122
116
|
cleanName: string;
|
|
123
|
-
} | {
|
|
124
|
-
attributes: {
|
|
125
|
-
group: string;
|
|
126
|
-
state: string;
|
|
127
|
-
introduced: string;
|
|
128
|
-
description: string;
|
|
129
|
-
deprecated?: undefined;
|
|
130
|
-
responsiveSmallerVariant?: undefined;
|
|
131
|
-
};
|
|
132
|
-
value: string;
|
|
133
|
-
filePath: string;
|
|
134
|
-
isSource: boolean;
|
|
135
|
-
original: {
|
|
136
|
-
attributes: {
|
|
137
|
-
group: string;
|
|
138
|
-
state: string;
|
|
139
|
-
introduced: string;
|
|
140
|
-
description: string;
|
|
141
|
-
deprecated?: undefined;
|
|
142
|
-
responsiveSmallerVariant?: undefined;
|
|
143
|
-
};
|
|
144
|
-
value: {
|
|
145
|
-
fontWeight: string;
|
|
146
|
-
fontSize: string;
|
|
147
|
-
lineHeight: string;
|
|
148
|
-
fontFamily: string;
|
|
149
|
-
fontStyle: string;
|
|
150
|
-
letterSpacing: string;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
name: string;
|
|
154
|
-
path: string[];
|
|
155
|
-
cleanName: string;
|
|
156
117
|
})[];
|
|
157
118
|
export declare function findFontFamilyValueForToken(tokenName: string): string;
|
|
158
119
|
export declare function notUndefined<V>(value: V | undefined): value is V;
|
package/package.json
CHANGED