@atlaskit/eslint-plugin-design-system 13.41.3 → 13.42.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 +16 -0
- package/README.md +0 -1
- package/dist/cjs/presets/all-flat.codegen.js +1 -2
- package/dist/cjs/presets/all.codegen.js +1 -2
- package/dist/cjs/rules/index.codegen.js +1 -3
- package/dist/cjs/rules/use-primitives/utils/is-valid-css-properties-to-transform.js +5 -4
- package/dist/es2019/presets/all-flat.codegen.js +1 -2
- package/dist/es2019/presets/all.codegen.js +1 -2
- package/dist/es2019/rules/index.codegen.js +1 -3
- package/dist/es2019/rules/use-primitives/utils/is-valid-css-properties-to-transform.js +5 -4
- package/dist/esm/presets/all-flat.codegen.js +1 -2
- package/dist/esm/presets/all.codegen.js +1 -2
- package/dist/esm/rules/index.codegen.js +1 -3
- package/dist/esm/rules/use-primitives/utils/is-valid-css-properties-to-transform.js +5 -4
- package/dist/types/presets/all-flat.codegen.d.ts +1 -1
- package/dist/types/presets/all.codegen.d.ts +1 -1
- package/dist/types/rules/ensure-design-token-usage/index.d.ts +1 -1
- package/dist/types/rules/ensure-design-token-usage/rule-meta.d.ts +1 -1
- package/dist/types/rules/ensure-design-token-usage/utils.d.ts +1 -1
- package/dist/types/rules/index.codegen.d.ts +1 -1
- package/dist/types/rules/no-deprecated-imports/handlers/icon.d.ts +1 -1
- package/dist/types/rules/use-heading/transformers/common.d.ts +2 -2
- package/dist/types/rules/use-latest-xcss-syntax-typography/linters/common.d.ts +1 -1
- package/dist/types/rules/use-latest-xcss-syntax-typography/linters/wrapped-token-value.d.ts +1 -1
- package/dist/types/rules/use-primitives/transformers/compiled-styled/index.d.ts +1 -1
- package/dist/types/rules/use-primitives/transformers/emotion-css/index.d.ts +1 -1
- package/dist/types/rules/use-primitives/utils/is-valid-css-properties-to-transform.d.ts +1 -1
- package/dist/types/rules/use-primitives/utils/validate-styles.d.ts +1 -1
- package/dist/types/rules/use-primitives-text/transformers/common.d.ts +1 -1
- package/dist/types/rules/use-primitives-text/transformers/unsafe-small-text.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/config/index.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/banned-properties.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/font-family.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/font-weight.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/restricted-capitalisation.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/style-object.d.ts +1 -1
- package/dist/types/rules/use-tokens-typography/transformers/untokenized-properties.d.ts +1 -1
- package/dist/types/rules/utils/create-no-exported-rule/check-if-supported-export.d.ts +1 -1
- package/dist/types/rules/utils/get-first-supported-import.d.ts +1 -1
- 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/rules/ensure-design-token-usage/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/ensure-design-token-usage/rule-meta.d.ts +1 -1
- package/dist/types-ts4.5/rules/ensure-design-token-usage/utils.d.ts +1 -1
- package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-deprecated-imports/handlers/icon.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-heading/transformers/common.d.ts +2 -2
- package/dist/types-ts4.5/rules/use-latest-xcss-syntax-typography/linters/common.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-latest-xcss-syntax-typography/linters/wrapped-token-value.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-primitives/transformers/compiled-styled/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-primitives/transformers/emotion-css/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-primitives/utils/is-valid-css-properties-to-transform.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-primitives/utils/validate-styles.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-primitives-text/transformers/common.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-primitives-text/transformers/unsafe-small-text.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/config/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/banned-properties.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/font-family.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/font-weight.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/restricted-capitalisation.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/style-object.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/transformers/untokenized-properties.d.ts +1 -1
- package/dist/types-ts4.5/rules/utils/create-no-exported-rule/check-if-supported-export.d.ts +1 -1
- package/dist/types-ts4.5/rules/utils/get-first-supported-import.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cjs/rules/no-legacy-icons/checks.js +0 -619
- package/dist/cjs/rules/no-legacy-icons/helpers.js +0 -900
- package/dist/cjs/rules/no-legacy-icons/index.js +0 -91
- package/dist/cjs/rules/no-legacy-icons/upcoming-icons.js +0 -7
- package/dist/es2019/rules/no-legacy-icons/checks.js +0 -520
- package/dist/es2019/rules/no-legacy-icons/helpers.js +0 -853
- package/dist/es2019/rules/no-legacy-icons/index.js +0 -87
- package/dist/es2019/rules/no-legacy-icons/upcoming-icons.js +0 -1
- package/dist/esm/rules/no-legacy-icons/checks.js +0 -613
- package/dist/esm/rules/no-legacy-icons/helpers.js +0 -891
- package/dist/esm/rules/no-legacy-icons/index.js +0 -85
- package/dist/esm/rules/no-legacy-icons/upcoming-icons.js +0 -1
- package/dist/types/rules/no-legacy-icons/checks.d.ts +0 -16
- package/dist/types/rules/no-legacy-icons/helpers.d.ts +0 -151
- package/dist/types/rules/no-legacy-icons/index.d.ts +0 -2
- package/dist/types/rules/no-legacy-icons/upcoming-icons.d.ts +0 -1
- package/dist/types-ts4.5/rules/no-legacy-icons/checks.d.ts +0 -16
- package/dist/types-ts4.5/rules/no-legacy-icons/helpers.d.ts +0 -156
- package/dist/types-ts4.5/rules/no-legacy-icons/index.d.ts +0 -2
- package/dist/types-ts4.5/rules/no-legacy-icons/upcoming-icons.d.ts +0 -1
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { createLintRule } from '../utils/create-rule';
|
|
2
|
-
import { errorBoundary } from '../utils/error-boundary';
|
|
3
|
-
import { createChecks } from './checks';
|
|
4
|
-
import { createHelpers } from './helpers';
|
|
5
|
-
const rule = createLintRule({
|
|
6
|
-
meta: {
|
|
7
|
-
name: 'no-legacy-icons',
|
|
8
|
-
fixable: 'code',
|
|
9
|
-
hasSuggestions: true,
|
|
10
|
-
type: 'problem',
|
|
11
|
-
docs: {
|
|
12
|
-
description: 'Enforces no legacy icons are used.',
|
|
13
|
-
recommended: false,
|
|
14
|
-
severity: 'warn'
|
|
15
|
-
},
|
|
16
|
-
schema: [{
|
|
17
|
-
type: 'object',
|
|
18
|
-
properties: {
|
|
19
|
-
shouldErrorForManualMigration: {
|
|
20
|
-
type: 'boolean'
|
|
21
|
-
},
|
|
22
|
-
shouldErrorForAutoMigration: {
|
|
23
|
-
type: 'boolean'
|
|
24
|
-
},
|
|
25
|
-
shouldUseSafeMigrationMode: {
|
|
26
|
-
type: 'boolean'
|
|
27
|
-
},
|
|
28
|
-
quiet: {
|
|
29
|
-
type: 'boolean'
|
|
30
|
-
},
|
|
31
|
-
shouldUseMigrationPath: {
|
|
32
|
-
type: 'boolean'
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
additionalProperties: false
|
|
36
|
-
}],
|
|
37
|
-
messages: {
|
|
38
|
-
noLegacyIconsAutoMigration: `Auto Migration:\nLegacy icon '{{iconName}}' from '{{importSource}}' detected.\nAutomatic migration is possible.\n\n{{guidance}}\nAtlassians: See https://go.atlassian.com/icon-migration-guide for details.'`,
|
|
39
|
-
noLegacyIconsManualMigration: `Manual Migration:\nLegacy icon '{{iconName}}' from '{{importSource}}' detected.\nAutomatic migration not possible.\n\n{{guidance}}\nAtlassians: See https://go.atlassian.com/icon-migration-guide for details.`,
|
|
40
|
-
cantFindSuitableReplacement: `No suitable replacement found for '{{iconName}}' from '{{importSource}}'{{sizeGuidance}}. Please manually migrate this icon.`,
|
|
41
|
-
cantMigrateReExport: `'{{exportName}}' is a re-export of icon from '{{packageName}}' and cannot be automatically migrated. Please remove this re-export, and migrate any usages to the new icon APIs.`,
|
|
42
|
-
cantMigrateColor: `This icon's \`primaryColor\` prop is set to {{colorValue}}, which isn't a design token supported in the new Icon API. Please switch to an appropriate \`color.icon\`, \`color.link\` or \`color.text\` token, or currentColor in buttons and menus.`,
|
|
43
|
-
cantMigrateSpreadProps: `This usage of Icon uses spread props in a way that can't be automatically migrated. Please explicitly define the following props after spread in order to auto-migrate: '{{missingProps}}' `,
|
|
44
|
-
cantMigrateSizeUnknown: `This usage of Icon sets the size via a variable or function that can't be automatically migrated. Please migrate manually to the correct \`LEGACY_size\` and \`spacing\` props.`,
|
|
45
|
-
cantMigrateFunctionUnknown: `Icon '{{iconName}}', from entrypoint '{{importSource}}', is passed into a function/component and can't be migrated automatically. Please manually migrate this icon.`,
|
|
46
|
-
cantMigrateIdentifierMapOrArray: `This icon is passed to other components via a map or array, and can't be migrated automatically. Please manually migrate wherever this expression is used to the new API, or use the icon components directly.`,
|
|
47
|
-
cantMigrateIdentifier: `This reference to {{iconName}} from {{iconSource}} can't be migrated automatically to the new components and API. Please manually migrate this and any other references.`
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
create(context) {
|
|
51
|
-
const {
|
|
52
|
-
getConfigFlag
|
|
53
|
-
} = createHelpers(context);
|
|
54
|
-
const failSilently = getConfigFlag('failSilently', false);
|
|
55
|
-
const {
|
|
56
|
-
checkImportDeclarations,
|
|
57
|
-
checkVariableDeclarations,
|
|
58
|
-
checkExportDefaultDeclaration,
|
|
59
|
-
checkExportNamedVariables,
|
|
60
|
-
checkArrayOrMap,
|
|
61
|
-
checkIconAsProp,
|
|
62
|
-
checkJSXElement,
|
|
63
|
-
checkCallExpression,
|
|
64
|
-
throwErrors,
|
|
65
|
-
checkIconReference
|
|
66
|
-
} = createChecks(context);
|
|
67
|
-
return errorBoundary({
|
|
68
|
-
// Track imports of relevant components
|
|
69
|
-
ImportDeclaration: checkImportDeclarations,
|
|
70
|
-
// Keep track of the relevant variable declarations and renames
|
|
71
|
-
VariableDeclaration: checkVariableDeclarations,
|
|
72
|
-
// Case: default re-exports. Can't be auto-migrated
|
|
73
|
-
ExportDefaultDeclaration: checkExportDefaultDeclaration,
|
|
74
|
-
ExportNamedDeclaration: checkExportNamedVariables,
|
|
75
|
-
// Legacy icons found in arrays/objects
|
|
76
|
-
'ObjectExpression > Property > Identifier, ArrayExpression > Identifier ': checkArrayOrMap,
|
|
77
|
-
// Legacy icons passed in via props, as JSX identifier (i.e. icon={AddIcon})
|
|
78
|
-
'JSXOpeningElement > JSXAttribute > JSXExpressionContainer > Identifier': checkIconAsProp,
|
|
79
|
-
JSXElement: checkJSXElement,
|
|
80
|
-
// Icons called as an argument of a function (i.e. icon={DefaultIcon(AddIcon)})
|
|
81
|
-
CallExpression: checkCallExpression,
|
|
82
|
-
Identifier: checkIconReference,
|
|
83
|
-
'Program:exit': throwErrors
|
|
84
|
-
}, failSilently);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
export default rule;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const upcomingIcons = [];
|