@atlaskit/eslint-plugin-design-system 13.25.0 → 13.27.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 +17 -0
- package/README.md +73 -71
- package/dist/cjs/presets/all-flat.codegen.js +4 -2
- package/dist/cjs/presets/all.codegen.js +4 -2
- package/dist/cjs/presets/recommended-flat.codegen.js +2 -2
- package/dist/cjs/presets/recommended.codegen.js +2 -2
- package/dist/cjs/rules/index.codegen.js +7 -3
- package/dist/cjs/rules/{lozenge-appearance-and-isbold-migration → lozenge-isBold-and-lozenge-badge-appearance-migration}/index.js +115 -19
- package/dist/cjs/rules/no-to-match-snapshot/index.js +49 -0
- package/dist/cjs/rules/no-unsafe-inline-snapshot/index.js +139 -0
- package/dist/es2019/presets/all-flat.codegen.js +4 -2
- package/dist/es2019/presets/all.codegen.js +4 -2
- package/dist/es2019/presets/recommended-flat.codegen.js +2 -2
- package/dist/es2019/presets/recommended.codegen.js +2 -2
- package/dist/es2019/rules/index.codegen.js +7 -3
- package/dist/es2019/rules/{lozenge-appearance-and-isbold-migration → lozenge-isBold-and-lozenge-badge-appearance-migration}/index.js +109 -15
- package/dist/es2019/rules/no-to-match-snapshot/index.js +43 -0
- package/dist/es2019/rules/no-unsafe-inline-snapshot/index.js +134 -0
- package/dist/esm/presets/all-flat.codegen.js +4 -2
- package/dist/esm/presets/all.codegen.js +4 -2
- package/dist/esm/presets/recommended-flat.codegen.js +2 -2
- package/dist/esm/presets/recommended.codegen.js +2 -2
- package/dist/esm/rules/index.codegen.js +7 -3
- package/dist/esm/rules/{lozenge-appearance-and-isbold-migration → lozenge-isBold-and-lozenge-badge-appearance-migration}/index.js +115 -19
- package/dist/esm/rules/no-to-match-snapshot/index.js +43 -0
- package/dist/esm/rules/no-unsafe-inline-snapshot/index.js +133 -0
- package/dist/types/presets/all-flat.codegen.d.ts +1 -1
- package/dist/types/presets/all.codegen.d.ts +1 -1
- package/dist/types/presets/recommended-flat.codegen.d.ts +1 -1
- package/dist/types/presets/recommended.codegen.d.ts +1 -1
- package/dist/types/rules/index.codegen.d.ts +1 -1
- package/dist/types/rules/no-to-match-snapshot/index.d.ts +4 -0
- package/dist/types/rules/no-unsafe-inline-snapshot/index.d.ts +4 -0
- package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +1 -1
- package/dist/types-ts4.5/presets/all.codegen.d.ts +1 -1
- package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +1 -1
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +1 -1
- package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-to-match-snapshot/index.d.ts +4 -0
- package/dist/types-ts4.5/rules/no-unsafe-inline-snapshot/index.d.ts +4 -0
- package/package.json +3 -3
- /package/dist/types/rules/{lozenge-appearance-and-isbold-migration → lozenge-isBold-and-lozenge-badge-appearance-migration}/index.d.ts +0 -0
- /package/dist/types-ts4.5/rules/{lozenge-appearance-and-isbold-migration → lozenge-isBold-and-lozenge-badge-appearance-migration}/index.d.ts +0 -0
|
@@ -2,18 +2,20 @@ import { isNodeOfType } from 'eslint-codemod-utils';
|
|
|
2
2
|
import { createLintRule } from '../utils/create-rule';
|
|
3
3
|
const rule = createLintRule({
|
|
4
4
|
meta: {
|
|
5
|
-
name: 'lozenge-
|
|
5
|
+
name: 'lozenge-isBold-and-lozenge-badge-appearance-migration',
|
|
6
6
|
fixable: 'code',
|
|
7
7
|
type: 'suggestion',
|
|
8
8
|
docs: {
|
|
9
|
-
description: 'Helps migrate
|
|
9
|
+
description: 'Helps migrate Lozenge isBold prop and appearance values (for both Lozenge and Badge components) as part of the Labelling System Phase 1 migration.',
|
|
10
10
|
recommended: true,
|
|
11
11
|
severity: 'warn'
|
|
12
12
|
},
|
|
13
13
|
messages: {
|
|
14
14
|
updateAppearance: 'Update appearance value to new semantic value.',
|
|
15
15
|
migrateTag: 'Non-bold <Lozenge> variants should migrate to <Tag> component.',
|
|
16
|
-
manualReview: "Dynamic 'isBold' props require manual review before migration."
|
|
16
|
+
manualReview: "Dynamic 'isBold' props require manual review before migration.",
|
|
17
|
+
updateBadgeAppearance: 'Update Badge appearance value "{{oldValue}}" to new semantic value "{{newValue}}".',
|
|
18
|
+
dynamicBadgeAppearance: 'Dynamic appearance prop values require manual review to ensure they use the new semantic values: neutral, information, inverse, danger, success.'
|
|
17
19
|
}
|
|
18
20
|
},
|
|
19
21
|
create(context) {
|
|
@@ -22,6 +24,11 @@ const rule = createLintRule({
|
|
|
22
24
|
*/
|
|
23
25
|
const lozengeImports = {}; // local name -> import source
|
|
24
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Contains a map of imported Badge components.
|
|
29
|
+
*/
|
|
30
|
+
const badgeImports = {}; // local name -> import source
|
|
31
|
+
|
|
25
32
|
/**
|
|
26
33
|
* Check if a JSX attribute value is a literal false
|
|
27
34
|
*/
|
|
@@ -30,14 +37,25 @@ const rule = createLintRule({
|
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
/**
|
|
33
|
-
* Check if a JSX attribute value is dynamic (not a literal
|
|
40
|
+
* Check if a JSX attribute value is dynamic (not a static literal value)
|
|
41
|
+
* Can be used for any prop type (boolean, string, etc.)
|
|
34
42
|
*/
|
|
35
43
|
function isDynamicExpression(node) {
|
|
36
|
-
if (!node
|
|
44
|
+
if (!node) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// If it's a plain literal (e.g., appearance="value"), it's not dynamic
|
|
49
|
+
if (node.type === 'Literal') {
|
|
37
50
|
return false;
|
|
38
51
|
}
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
|
|
53
|
+
// If it's an expression container with a non-literal expression, it's dynamic
|
|
54
|
+
if (node.type === 'JSXExpressionContainer') {
|
|
55
|
+
const expr = node.expression;
|
|
56
|
+
return expr && expr.type !== 'Literal';
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
41
59
|
}
|
|
42
60
|
|
|
43
61
|
/**
|
|
@@ -70,6 +88,21 @@ const rule = createLintRule({
|
|
|
70
88
|
return mapping[oldValue] || oldValue;
|
|
71
89
|
}
|
|
72
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Map Badge old appearance values to new semantic appearance values
|
|
93
|
+
*/
|
|
94
|
+
function mapBadgeToNewAppearanceValue(oldValue) {
|
|
95
|
+
const mapping = {
|
|
96
|
+
added: 'success',
|
|
97
|
+
removed: 'danger',
|
|
98
|
+
default: 'neutral',
|
|
99
|
+
primary: 'information',
|
|
100
|
+
primaryInverted: 'inverse',
|
|
101
|
+
important: 'danger'
|
|
102
|
+
};
|
|
103
|
+
return mapping[oldValue] || oldValue;
|
|
104
|
+
}
|
|
105
|
+
|
|
73
106
|
/**
|
|
74
107
|
* Extract the string value from a JSX attribute value
|
|
75
108
|
*/
|
|
@@ -86,6 +119,25 @@ const rule = createLintRule({
|
|
|
86
119
|
return null;
|
|
87
120
|
}
|
|
88
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Create a fixer function to replace an appearance prop value
|
|
124
|
+
* Handles both Literal and JSXExpressionContainer with Literal
|
|
125
|
+
*/
|
|
126
|
+
function createAppearanceFixer(attrValue, newValue) {
|
|
127
|
+
return fixer => {
|
|
128
|
+
if (!attrValue) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
if (attrValue.type === 'Literal') {
|
|
132
|
+
return fixer.replaceText(attrValue, `"${newValue}"`);
|
|
133
|
+
}
|
|
134
|
+
if (attrValue.type === 'JSXExpressionContainer' && 'expression' in attrValue && attrValue.expression && attrValue.expression.type === 'Literal') {
|
|
135
|
+
return fixer.replaceText(attrValue.expression, `"${newValue}"`);
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
89
141
|
/**
|
|
90
142
|
* Generate the replacement JSX element text
|
|
91
143
|
*/
|
|
@@ -147,6 +199,18 @@ const rule = createLintRule({
|
|
|
147
199
|
}
|
|
148
200
|
});
|
|
149
201
|
}
|
|
202
|
+
// Track Badge imports
|
|
203
|
+
if (moduleSource === '@atlaskit/badge' || moduleSource.startsWith('@atlaskit/badge')) {
|
|
204
|
+
node.specifiers.forEach(spec => {
|
|
205
|
+
if (spec.type === 'ImportDefaultSpecifier') {
|
|
206
|
+
badgeImports[spec.local.name] = moduleSource;
|
|
207
|
+
} else if (spec.type === 'ImportSpecifier' && spec.imported.type === 'Identifier') {
|
|
208
|
+
if (spec.imported.name === 'Badge' || spec.imported.name === 'default') {
|
|
209
|
+
badgeImports[spec.local.name] = moduleSource;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
150
214
|
}
|
|
151
215
|
},
|
|
152
216
|
JSXElement(node) {
|
|
@@ -158,6 +222,43 @@ const rule = createLintRule({
|
|
|
158
222
|
}
|
|
159
223
|
const elementName = node.openingElement.name.name;
|
|
160
224
|
|
|
225
|
+
// Handle Badge components
|
|
226
|
+
if (badgeImports[elementName]) {
|
|
227
|
+
// Find the appearance prop
|
|
228
|
+
const appearanceProp = node.openingElement.attributes.find(attr => attr.type === 'JSXAttribute' && attr.name.type === 'JSXIdentifier' && attr.name.name === 'appearance');
|
|
229
|
+
if (!appearanceProp || appearanceProp.type !== 'JSXAttribute') {
|
|
230
|
+
// No appearance prop or it's a spread attribute, nothing to migrate
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Check if it's a dynamic expression
|
|
235
|
+
if (isDynamicExpression(appearanceProp.value)) {
|
|
236
|
+
context.report({
|
|
237
|
+
node: appearanceProp,
|
|
238
|
+
messageId: 'dynamicBadgeAppearance'
|
|
239
|
+
});
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Extract the string value
|
|
244
|
+
const stringValue = extractStringValue(appearanceProp.value);
|
|
245
|
+
if (stringValue && typeof stringValue === 'string') {
|
|
246
|
+
const mappedValue = mapBadgeToNewAppearanceValue(stringValue);
|
|
247
|
+
if (mappedValue !== stringValue) {
|
|
248
|
+
context.report({
|
|
249
|
+
node: appearanceProp,
|
|
250
|
+
messageId: 'updateBadgeAppearance',
|
|
251
|
+
data: {
|
|
252
|
+
oldValue: stringValue,
|
|
253
|
+
newValue: mappedValue
|
|
254
|
+
},
|
|
255
|
+
fix: createAppearanceFixer(appearanceProp.value, mappedValue)
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
161
262
|
// Only process if this is a Lozenge component we've imported
|
|
162
263
|
if (!lozengeImports[elementName]) {
|
|
163
264
|
return;
|
|
@@ -178,14 +279,7 @@ const rule = createLintRule({
|
|
|
178
279
|
context.report({
|
|
179
280
|
node: appearanceProp,
|
|
180
281
|
messageId: 'updateAppearance',
|
|
181
|
-
fix:
|
|
182
|
-
if (appearanceProp.value.type === 'Literal') {
|
|
183
|
-
return fixer.replaceText(appearanceProp.value, `"${mappedValue}"`);
|
|
184
|
-
} else if (appearanceProp.value.type === 'JSXExpressionContainer' && appearanceProp.value.expression && appearanceProp.value.expression.type === 'Literal') {
|
|
185
|
-
return fixer.replaceText(appearanceProp.value.expression, `"${mappedValue}"`);
|
|
186
|
-
}
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
282
|
+
fix: createAppearanceFixer(appearanceProp.value, mappedValue)
|
|
189
283
|
});
|
|
190
284
|
}
|
|
191
285
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
+
import { createLintRule } from '../utils/create-rule';
|
|
3
|
+
export const name = 'no-to-match-snapshot';
|
|
4
|
+
const rule = createLintRule({
|
|
5
|
+
meta: {
|
|
6
|
+
name,
|
|
7
|
+
type: 'problem',
|
|
8
|
+
docs: {
|
|
9
|
+
description: 'Disallow using toMatchSnapshot() in favor of toMatchInlineSnapshot(). See https://hello.atlassian.net/wiki/spaces/DST/pages/6105892000/DSTRFC-038+-+Removal+of+.toMatchSnapshot for rationale.',
|
|
10
|
+
recommended: false,
|
|
11
|
+
severity: 'error'
|
|
12
|
+
},
|
|
13
|
+
messages: {
|
|
14
|
+
useInlineSnapshot: 'Use toMatchInlineSnapshot() instead of toMatchSnapshot(). See https://hello.atlassian.net/wiki/spaces/DST/pages/6105892000/DSTRFC-038+-+Removal+of+.toMatchSnapshot for rationale.'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
create(context) {
|
|
18
|
+
return {
|
|
19
|
+
MemberExpression(node) {
|
|
20
|
+
// Check if this is a call to toMatchSnapshot
|
|
21
|
+
if (!isNodeOfType(node.property, 'Identifier') || node.property.name !== 'toMatchSnapshot') {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Check if the object is an expect() call
|
|
26
|
+
if (!isNodeOfType(node.object, 'CallExpression') || !isNodeOfType(node.object.callee, 'Identifier') || node.object.callee.name !== 'expect') {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Only report if this is being called (i.e., it's part of a CallExpression)
|
|
31
|
+
// We want to catch expect(...).toMatchSnapshot() but not just the property access
|
|
32
|
+
if (!node.parent || !isNodeOfType(node.parent, 'CallExpression')) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
context.report({
|
|
36
|
+
node: node.property,
|
|
37
|
+
messageId: 'useInlineSnapshot'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export default rule;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
+
import { getSourceCode } from '@atlaskit/eslint-utils/context-compat';
|
|
3
|
+
import { createLintRule } from '../utils/create-rule';
|
|
4
|
+
export const name = 'no-unsafe-inline-snapshot';
|
|
5
|
+
const MAX_LINES = 100;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Checks if a snapshot contains internal implementation details
|
|
9
|
+
*/
|
|
10
|
+
function containsInternalDetails(snapshotContent) {
|
|
11
|
+
const issues = [];
|
|
12
|
+
|
|
13
|
+
// Check for className attributes (unless they equal "REDACTED")
|
|
14
|
+
// Handles: className="value", className='value', and whitespace variations
|
|
15
|
+
const classNameRegex = /className\s*=\s*(["'])((?:(?!\1)[^\\]|\\.)*)\1/gi;
|
|
16
|
+
let match;
|
|
17
|
+
while ((match = classNameRegex.exec(snapshotContent)) !== null) {
|
|
18
|
+
const classNameValue = match[2];
|
|
19
|
+
if (classNameValue && classNameValue !== 'REDACTED') {
|
|
20
|
+
issues.push(`className="${classNameValue}"`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Check for style attributes (unless they equal "REDACTED")
|
|
25
|
+
// Handles: style="value", style='value', and whitespace variations
|
|
26
|
+
// Style values can contain colons, semicolons, etc., so we need to capture the full quoted value
|
|
27
|
+
const styleRegex = /style\s*=\s*(["'])((?:(?!\1)[^\\]|\\.)*)\1/gi;
|
|
28
|
+
while ((match = styleRegex.exec(snapshotContent)) !== null) {
|
|
29
|
+
const styleValue = match[2];
|
|
30
|
+
if (styleValue && styleValue !== 'REDACTED') {
|
|
31
|
+
issues.push(`style="${styleValue}"`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Check for style blocks (unless they contain "REDACTED")
|
|
36
|
+
const styleBlockRegex = /<style[^>]*>([\s\S]*?)<\/style>/gi;
|
|
37
|
+
while ((match = styleBlockRegex.exec(snapshotContent)) !== null) {
|
|
38
|
+
const styleContent = match[1];
|
|
39
|
+
if (styleContent && !styleContent.trim().includes('REDACTED')) {
|
|
40
|
+
issues.push('style block');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
hasIssues: issues.length > 0,
|
|
45
|
+
issues
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Extracts the snapshot content from a template literal or string literal
|
|
51
|
+
*/
|
|
52
|
+
function extractSnapshotContent(node, sourceCode) {
|
|
53
|
+
if (isNodeOfType(node, 'TemplateLiteral')) {
|
|
54
|
+
// For template literals, get the raw text including the template parts
|
|
55
|
+
return sourceCode.getText(node);
|
|
56
|
+
}
|
|
57
|
+
if (isNodeOfType(node, 'Literal') && typeof node.value === 'string') {
|
|
58
|
+
return node.value;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const rule = createLintRule({
|
|
63
|
+
meta: {
|
|
64
|
+
name,
|
|
65
|
+
type: 'problem',
|
|
66
|
+
docs: {
|
|
67
|
+
description: 'Enforce guardrails on toMatchInlineSnapshot usage: snapshots must not exceed 100 lines and must not contain internal implementation details like className or style attributes.',
|
|
68
|
+
recommended: false,
|
|
69
|
+
severity: 'error'
|
|
70
|
+
},
|
|
71
|
+
messages: {
|
|
72
|
+
exceedsMaxLines: `Inline snapshot exceeds ${MAX_LINES} lines. Consider breaking it into smaller snapshots or using a different testing approach.`,
|
|
73
|
+
containsInternalDetails: 'Inline snapshot contains internal implementation details: {{details}}. Use "REDACTED" for className and style values, or remove these details from the snapshot.'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
create(context) {
|
|
77
|
+
const sourceCode = getSourceCode(context);
|
|
78
|
+
return {
|
|
79
|
+
MemberExpression(node) {
|
|
80
|
+
// Check if this is a call to toMatchInlineSnapshot
|
|
81
|
+
if (!isNodeOfType(node.property, 'Identifier') || node.property.name !== 'toMatchInlineSnapshot') {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Check if the object is an expect() call
|
|
86
|
+
if (!isNodeOfType(node.object, 'CallExpression') || !isNodeOfType(node.object.callee, 'Identifier') || node.object.callee.name !== 'expect') {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Only report if this is being called (i.e., it's part of a CallExpression)
|
|
91
|
+
if (!node.parent || !isNodeOfType(node.parent, 'CallExpression')) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Get the snapshot content from the first argument
|
|
96
|
+
const callExpression = node.parent;
|
|
97
|
+
if (callExpression.arguments.length === 0) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const snapshotArg = callExpression.arguments[0];
|
|
101
|
+
const snapshotContent = extractSnapshotContent(snapshotArg, sourceCode);
|
|
102
|
+
if (!snapshotContent) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Check line count
|
|
107
|
+
const lines = snapshotContent.split('\n');
|
|
108
|
+
if (lines.length > MAX_LINES) {
|
|
109
|
+
context.report({
|
|
110
|
+
node: snapshotArg,
|
|
111
|
+
messageId: 'exceedsMaxLines'
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Check for internal implementation details
|
|
117
|
+
const {
|
|
118
|
+
hasIssues,
|
|
119
|
+
issues
|
|
120
|
+
} = containsInternalDetails(snapshotContent);
|
|
121
|
+
if (hasIssues) {
|
|
122
|
+
context.report({
|
|
123
|
+
node: snapshotArg,
|
|
124
|
+
messageId: 'containsInternalDetails',
|
|
125
|
+
data: {
|
|
126
|
+
details: issues.slice(0, 3).join(', ') // Show first 3 issues
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
export default rule;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::d7a0407a6c6b10bfbba790523d06f97d>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ var rules = {
|
|
|
15
15
|
'@atlaskit/design-system/ensure-icon-color': 'error',
|
|
16
16
|
'@atlaskit/design-system/ensure-proper-xcss-usage': 'error',
|
|
17
17
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
18
|
-
'@atlaskit/design-system/lozenge-
|
|
18
|
+
'@atlaskit/design-system/lozenge-isBold-and-lozenge-badge-appearance-migration': 'warn',
|
|
19
19
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
20
20
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
21
21
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
@@ -47,7 +47,9 @@ var rules = {
|
|
|
47
47
|
'@atlaskit/design-system/no-physical-properties': 'error',
|
|
48
48
|
'@atlaskit/design-system/no-separator-with-list-elements': 'warn',
|
|
49
49
|
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
50
|
+
'@atlaskit/design-system/no-to-match-snapshot': 'error',
|
|
50
51
|
'@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
|
|
52
|
+
'@atlaskit/design-system/no-unsafe-inline-snapshot': 'error',
|
|
51
53
|
'@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
|
|
52
54
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
|
|
53
55
|
'@atlaskit/design-system/no-unused-css-map': 'warn',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::e632a96e9bae920c23e25114f40e3c0d>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ var rules = {
|
|
|
14
14
|
'@atlaskit/design-system/ensure-icon-color': 'error',
|
|
15
15
|
'@atlaskit/design-system/ensure-proper-xcss-usage': 'error',
|
|
16
16
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
17
|
-
'@atlaskit/design-system/lozenge-
|
|
17
|
+
'@atlaskit/design-system/lozenge-isBold-and-lozenge-badge-appearance-migration': 'warn',
|
|
18
18
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
19
19
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
20
20
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
@@ -46,7 +46,9 @@ var rules = {
|
|
|
46
46
|
'@atlaskit/design-system/no-physical-properties': 'error',
|
|
47
47
|
'@atlaskit/design-system/no-separator-with-list-elements': 'warn',
|
|
48
48
|
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
49
|
+
'@atlaskit/design-system/no-to-match-snapshot': 'error',
|
|
49
50
|
'@atlaskit/design-system/no-unsafe-design-token-usage': 'error',
|
|
51
|
+
'@atlaskit/design-system/no-unsafe-inline-snapshot': 'error',
|
|
50
52
|
'@atlaskit/design-system/no-unsafe-style-overrides': 'warn',
|
|
51
53
|
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': 'error',
|
|
52
54
|
'@atlaskit/design-system/no-unused-css-map': 'warn',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::7ed1a8eeaaea559980cb2c533ba9a2e6>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ var rules = {
|
|
|
11
11
|
'@atlaskit/design-system/consistent-css-prop-usage': 'error',
|
|
12
12
|
'@atlaskit/design-system/ensure-design-token-usage': 'error',
|
|
13
13
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
14
|
-
'@atlaskit/design-system/lozenge-
|
|
14
|
+
'@atlaskit/design-system/lozenge-isBold-and-lozenge-badge-appearance-migration': 'warn',
|
|
15
15
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
16
16
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
17
17
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::32a0942d7edc5a3fdc70dd0833bb8aca>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ var rules = {
|
|
|
10
10
|
'@atlaskit/design-system/consistent-css-prop-usage': 'error',
|
|
11
11
|
'@atlaskit/design-system/ensure-design-token-usage': 'error',
|
|
12
12
|
'@atlaskit/design-system/icon-label': 'warn',
|
|
13
|
-
'@atlaskit/design-system/lozenge-
|
|
13
|
+
'@atlaskit/design-system/lozenge-isBold-and-lozenge-badge-appearance-migration': 'warn',
|
|
14
14
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
15
15
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
16
16
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::62347cf64e4ac99b927fce9d1a2bd894>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ import ensureDesignTokenUsagePreview from './ensure-design-token-usage-preview';
|
|
|
11
11
|
import ensureIconColor from './ensure-icon-color';
|
|
12
12
|
import ensureProperXcssUsage from './ensure-proper-xcss-usage';
|
|
13
13
|
import iconLabel from './icon-label';
|
|
14
|
-
import
|
|
14
|
+
import lozengeIsBoldAndLozengeBadgeAppearanceMigration from './lozenge-isBold-and-lozenge-badge-appearance-migration';
|
|
15
15
|
import noBannedImports from './no-banned-imports';
|
|
16
16
|
import noBooleanAutofocusOnModalDialog from './no-boolean-autofocus-on-modal-dialog';
|
|
17
17
|
import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
|
|
@@ -44,7 +44,9 @@ import noNestedStyles from './no-nested-styles';
|
|
|
44
44
|
import noPhysicalProperties from './no-physical-properties';
|
|
45
45
|
import noSeparatorWithListElements from './no-separator-with-list-elements';
|
|
46
46
|
import noStyledTaggedTemplateExpression from './no-styled-tagged-template-expression';
|
|
47
|
+
import noToMatchSnapshot from './no-to-match-snapshot';
|
|
47
48
|
import noUnsafeDesignTokenUsage from './no-unsafe-design-token-usage';
|
|
49
|
+
import noUnsafeInlineSnapshot from './no-unsafe-inline-snapshot';
|
|
48
50
|
import noUnsafeStyleOverrides from './no-unsafe-style-overrides';
|
|
49
51
|
import noUnsupportedDragAndDropLibraries from './no-unsupported-drag-and-drop-libraries';
|
|
50
52
|
import noUnusedCssMap from './no-unused-css-map';
|
|
@@ -81,7 +83,7 @@ export var rules = {
|
|
|
81
83
|
'ensure-icon-color': ensureIconColor,
|
|
82
84
|
'ensure-proper-xcss-usage': ensureProperXcssUsage,
|
|
83
85
|
'icon-label': iconLabel,
|
|
84
|
-
'lozenge-
|
|
86
|
+
'lozenge-isBold-and-lozenge-badge-appearance-migration': lozengeIsBoldAndLozengeBadgeAppearanceMigration,
|
|
85
87
|
'no-banned-imports': noBannedImports,
|
|
86
88
|
'no-boolean-autofocus-on-modal-dialog': noBooleanAutofocusOnModalDialog,
|
|
87
89
|
'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
|
|
@@ -114,7 +116,9 @@ export var rules = {
|
|
|
114
116
|
'no-physical-properties': noPhysicalProperties,
|
|
115
117
|
'no-separator-with-list-elements': noSeparatorWithListElements,
|
|
116
118
|
'no-styled-tagged-template-expression': noStyledTaggedTemplateExpression,
|
|
119
|
+
'no-to-match-snapshot': noToMatchSnapshot,
|
|
117
120
|
'no-unsafe-design-token-usage': noUnsafeDesignTokenUsage,
|
|
121
|
+
'no-unsafe-inline-snapshot': noUnsafeInlineSnapshot,
|
|
118
122
|
'no-unsafe-style-overrides': noUnsafeStyleOverrides,
|
|
119
123
|
'no-unsupported-drag-and-drop-libraries': noUnsupportedDragAndDropLibraries,
|
|
120
124
|
'no-unused-css-map': noUnusedCssMap,
|