@atlaskit/eslint-plugin-design-system 11.0.0 → 11.0.2
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 +19 -0
- package/dist/cjs/rules/no-legacy-icons/checks.js +2 -2
- package/dist/cjs/rules/no-legacy-icons/helpers.js +10 -10
- package/dist/cjs/rules/no-legacy-icons/index.js +7 -7
- package/dist/es2019/rules/no-legacy-icons/checks.js +2 -2
- package/dist/es2019/rules/no-legacy-icons/helpers.js +1 -1
- package/dist/es2019/rules/no-legacy-icons/index.js +7 -7
- package/dist/esm/rules/no-legacy-icons/checks.js +2 -2
- package/dist/esm/rules/no-legacy-icons/helpers.js +1 -1
- package/dist/esm/rules/no-legacy-icons/index.js +7 -7
- package/dist/types/rules/no-legacy-icons/helpers.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-legacy-icons/helpers.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 11.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171994](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171994)
|
|
8
|
+
[`be58e4bb2e387`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/be58e4bb2e387) -
|
|
9
|
+
Migrating usages of UNSAFE types and entrypoints that have been renamed in `@atlaskit/icon` and
|
|
10
|
+
`@atlaskit/icon-lab`.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 11.0.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#169436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/169436)
|
|
18
|
+
[`8c910a5de1c93`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8c910a5de1c93) -
|
|
19
|
+
Updates `no-legacy-icon` to no longer error on references to @atlaskit/icon-object
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 11.0.0
|
|
4
23
|
|
|
5
24
|
### Major Changes
|
|
@@ -39,7 +39,7 @@ var createChecks = exports.createChecks = function createChecks(context) {
|
|
|
39
39
|
var moduleSource = node.source.value;
|
|
40
40
|
|
|
41
41
|
// Find the imports for legacy icons
|
|
42
|
-
if (moduleSource && typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'
|
|
42
|
+
if (moduleSource && typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'].find(function (val) {
|
|
43
43
|
return moduleSource.startsWith(val);
|
|
44
44
|
}) && node.specifiers.length > 0) {
|
|
45
45
|
var _iterator = _createForOfIteratorHelper(node.specifiers),
|
|
@@ -181,7 +181,7 @@ var createChecks = exports.createChecks = function createChecks(context) {
|
|
|
181
181
|
// Case: export {default as AddIcon} from '@atlaskit/icon/glyph/add';
|
|
182
182
|
if (node.source && (0, _eslintCodemodUtils.isNodeOfType)(node.source, 'Literal') && Object.keys(node.source).includes('value')) {
|
|
183
183
|
var moduleSource = node.source.value;
|
|
184
|
-
if (typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'
|
|
184
|
+
if (typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'].find(function (val) {
|
|
185
185
|
return moduleSource.startsWith(val);
|
|
186
186
|
}) && node.specifiers.length) {
|
|
187
187
|
var _iterator5 = _createForOfIteratorHelper(node.specifiers),
|
|
@@ -10,7 +10,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
13
|
-
var
|
|
13
|
+
var _migrationMap = _interopRequireWildcard(require("@atlaskit/icon/migration-map"));
|
|
14
14
|
var _upcomingIcons = require("./upcoming-icons");
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -31,8 +31,8 @@ var isSize = exports.isSize = function isSize(size) {
|
|
|
31
31
|
*/
|
|
32
32
|
var getMigrationMapObject = exports.getMigrationMapObject = function getMigrationMapObject(iconPackage) {
|
|
33
33
|
var key = getIconKey(iconPackage);
|
|
34
|
-
if (Object.keys(
|
|
35
|
-
return
|
|
34
|
+
if (Object.keys(_migrationMap.default).includes(key)) {
|
|
35
|
+
return _migrationMap.default[key];
|
|
36
36
|
}
|
|
37
37
|
return null;
|
|
38
38
|
};
|
|
@@ -106,7 +106,7 @@ var createGuidance = exports.createGuidance = function createGuidance(_ref) {
|
|
|
106
106
|
} else {
|
|
107
107
|
guidance += "No equivalent icon for this size, ".concat(size, ", in the current or upcoming set of icons.");
|
|
108
108
|
}
|
|
109
|
-
guidance += "".concat(Object.keys(
|
|
109
|
+
guidance += "".concat(Object.keys(_migrationMap.migrationOutcomeDescriptionMap).includes(upcomingIcon.sizeGuidance[size]) ? " Once the upcoming icons are released, please: ".concat(_migrationMap.migrationOutcomeDescriptionMap[upcomingIcon.sizeGuidance[size]]) : ' No migration size advice given.', "\n");
|
|
110
110
|
} else {
|
|
111
111
|
guidance = "Please wait for the upcoming icons released, as it will contain an alternative for this legacy icon.\nMigration suggestions, depending on the legacy icon size:\n";
|
|
112
112
|
for (var _i = 0, _Object$entries = Object.entries(upcomingIcon.sizeGuidance); _i < _Object$entries.length; _i++) {
|
|
@@ -114,10 +114,10 @@ var createGuidance = exports.createGuidance = function createGuidance(_ref) {
|
|
|
114
114
|
_size = _Object$entries$_i[0],
|
|
115
115
|
value = _Object$entries$_i[1];
|
|
116
116
|
guidance += "\t- ".concat(_size, ": ");
|
|
117
|
-
if (!Object.keys(
|
|
117
|
+
if (!Object.keys(_migrationMap.migrationOutcomeDescriptionMap).includes(value)) {
|
|
118
118
|
guidance += 'No migration advice given.\n';
|
|
119
119
|
} else {
|
|
120
|
-
guidance += "".concat(
|
|
120
|
+
guidance += "".concat(_migrationMap.migrationOutcomeDescriptionMap[value], ".\n");
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -138,7 +138,7 @@ var createGuidance = exports.createGuidance = function createGuidance(_ref) {
|
|
|
138
138
|
} else {
|
|
139
139
|
_guidance += "No equivalent icon for this size, ".concat(size, ", in new set.");
|
|
140
140
|
}
|
|
141
|
-
_guidance += "".concat(Object.keys(
|
|
141
|
+
_guidance += "".concat(Object.keys(_migrationMap.migrationOutcomeDescriptionMap).includes(migrationMapObject.sizeGuidance[size]) ? " Please: ".concat(_migrationMap.migrationOutcomeDescriptionMap[migrationMapObject.sizeGuidance[size]]) : ' No migration size advice given.', "\n");
|
|
142
142
|
} else {
|
|
143
143
|
_guidance = "Use ".concat(iconName, " from ").concat(importPath, " instead.\nMigration suggestions, depending on the legacy icon size:\n");
|
|
144
144
|
Object.entries(migrationMapObject.sizeGuidance).forEach(function (_ref2) {
|
|
@@ -146,10 +146,10 @@ var createGuidance = exports.createGuidance = function createGuidance(_ref) {
|
|
|
146
146
|
size = _ref3[0],
|
|
147
147
|
value = _ref3[1];
|
|
148
148
|
_guidance += "\t- ".concat(size, ": ");
|
|
149
|
-
if (!Object.keys(
|
|
149
|
+
if (!Object.keys(_migrationMap.migrationOutcomeDescriptionMap).includes(value)) {
|
|
150
150
|
_guidance += 'No migration advice given.\n';
|
|
151
151
|
} else {
|
|
152
|
-
_guidance += "".concat(
|
|
152
|
+
_guidance += "".concat(_migrationMap.migrationOutcomeDescriptionMap[value], ".\n");
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
}
|
|
@@ -561,7 +561,7 @@ var checkIfNewIconExist = function checkIfNewIconExist(error) {
|
|
|
561
561
|
return false;
|
|
562
562
|
}
|
|
563
563
|
var iconKey = getIconKey(error.data.importSource);
|
|
564
|
-
var _ref8 =
|
|
564
|
+
var _ref8 = _migrationMap.default[iconKey] || {},
|
|
565
565
|
newIcon = _ref8.newIcon;
|
|
566
566
|
return Boolean(newIcon);
|
|
567
567
|
};
|
|
@@ -41,13 +41,13 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
41
41
|
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.'",
|
|
42
42
|
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.",
|
|
43
43
|
cantFindSuitableReplacement: "No suitable replacement found for '{{iconName}}' from '{{importSource}}'{{sizeGuidance}}. Please manually migrate this icon.",
|
|
44
|
-
cantMigrateReExport: "'{{exportName}}' is a re-export of icon from '{{packageName}}' and cannot be automatically migrated. Please
|
|
45
|
-
cantMigrateColor: "
|
|
46
|
-
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: '{{missingProps}}' ",
|
|
47
|
-
cantMigrateSizeUnknown: "This usage of Icon sets the size via a variable or function that can't be
|
|
48
|
-
cantMigrateFunctionUnknown: "'{{iconName}}' from
|
|
49
|
-
cantMigrateIdentifierMapOrArray: "This icon is passed to other components via a map or array,
|
|
50
|
-
cantMigrateIdentifier: "This
|
|
44
|
+
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.",
|
|
45
|
+
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.",
|
|
46
|
+
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}}' ",
|
|
47
|
+
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.",
|
|
48
|
+
cantMigrateFunctionUnknown: "Icon '{{iconName}}', from entrypoint '{{importSource}}', is passed into a function/component and can't be migrated automatically. Please manually migrate this icon.",
|
|
49
|
+
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.",
|
|
50
|
+
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."
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
create: function create(context) {
|
|
@@ -31,7 +31,7 @@ export const createChecks = context => {
|
|
|
31
31
|
const moduleSource = node.source.value;
|
|
32
32
|
|
|
33
33
|
// Find the imports for legacy icons
|
|
34
|
-
if (moduleSource && typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'
|
|
34
|
+
if (moduleSource && typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'].find(val => moduleSource.startsWith(val)) && node.specifiers.length > 0) {
|
|
35
35
|
for (const spec of node.specifiers) {
|
|
36
36
|
if (spec.local.name) {
|
|
37
37
|
legacyIconImports[spec.local.name] = {
|
|
@@ -135,7 +135,7 @@ export const createChecks = context => {
|
|
|
135
135
|
// Case: export {default as AddIcon} from '@atlaskit/icon/glyph/add';
|
|
136
136
|
if (node.source && isNodeOfType(node.source, 'Literal') && Object.keys(node.source).includes('value')) {
|
|
137
137
|
const moduleSource = node.source.value;
|
|
138
|
-
if (typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'
|
|
138
|
+
if (typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'].find(val => moduleSource.startsWith(val)) && node.specifiers.length) {
|
|
139
139
|
for (const spec of node.specifiers) {
|
|
140
140
|
createCantMigrateReExportError(spec, moduleSource, spec.exported.name, errorsManual);
|
|
141
141
|
addToListOfRanges(spec, errorRanges);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNodeOfType, literal } from 'eslint-codemod-utils';
|
|
2
|
-
import baseMigrationMap, { migrationOutcomeDescriptionMap } from '@atlaskit/icon/
|
|
2
|
+
import baseMigrationMap, { migrationOutcomeDescriptionMap } from '@atlaskit/icon/migration-map';
|
|
3
3
|
import { upcomingIcons } from './upcoming-icons';
|
|
4
4
|
const sizes = ['small', 'medium', 'large', 'xlarge'];
|
|
5
5
|
export const isSize = size => sizes.includes(size);
|
|
@@ -35,13 +35,13 @@ const rule = createLintRule({
|
|
|
35
35
|
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.'`,
|
|
36
36
|
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.`,
|
|
37
37
|
cantFindSuitableReplacement: `No suitable replacement found for '{{iconName}}' from '{{importSource}}'{{sizeGuidance}}. Please manually migrate this icon.`,
|
|
38
|
-
cantMigrateReExport: `'{{exportName}}' is a re-export of icon from '{{packageName}}' and cannot be automatically migrated. Please
|
|
39
|
-
cantMigrateColor: `
|
|
40
|
-
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: '{{missingProps}}' `,
|
|
41
|
-
cantMigrateSizeUnknown: `This usage of Icon sets the size via a variable or function that can't be
|
|
42
|
-
cantMigrateFunctionUnknown: `'{{iconName}}' from
|
|
43
|
-
cantMigrateIdentifierMapOrArray: `This icon is passed to other components via a map or array,
|
|
44
|
-
cantMigrateIdentifier: `This
|
|
38
|
+
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.`,
|
|
39
|
+
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.`,
|
|
40
|
+
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}}' `,
|
|
41
|
+
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.`,
|
|
42
|
+
cantMigrateFunctionUnknown: `Icon '{{iconName}}', from entrypoint '{{importSource}}', is passed into a function/component and can't be migrated automatically. Please manually migrate this icon.`,
|
|
43
|
+
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.`,
|
|
44
|
+
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.`
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
create(context) {
|
|
@@ -33,7 +33,7 @@ export var createChecks = function createChecks(context) {
|
|
|
33
33
|
var moduleSource = node.source.value;
|
|
34
34
|
|
|
35
35
|
// Find the imports for legacy icons
|
|
36
|
-
if (moduleSource && typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'
|
|
36
|
+
if (moduleSource && typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'].find(function (val) {
|
|
37
37
|
return moduleSource.startsWith(val);
|
|
38
38
|
}) && node.specifiers.length > 0) {
|
|
39
39
|
var _iterator = _createForOfIteratorHelper(node.specifiers),
|
|
@@ -175,7 +175,7 @@ export var createChecks = function createChecks(context) {
|
|
|
175
175
|
// Case: export {default as AddIcon} from '@atlaskit/icon/glyph/add';
|
|
176
176
|
if (node.source && isNodeOfType(node.source, 'Literal') && Object.keys(node.source).includes('value')) {
|
|
177
177
|
var moduleSource = node.source.value;
|
|
178
|
-
if (typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'
|
|
178
|
+
if (typeof moduleSource === 'string' && ['@atlaskit/icon/glyph/'].find(function (val) {
|
|
179
179
|
return moduleSource.startsWith(val);
|
|
180
180
|
}) && node.specifiers.length) {
|
|
181
181
|
var _iterator5 = _createForOfIteratorHelper(node.specifiers),
|
|
@@ -7,7 +7,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
7
7
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
8
8
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
9
9
|
import { isNodeOfType, literal } from 'eslint-codemod-utils';
|
|
10
|
-
import baseMigrationMap, { migrationOutcomeDescriptionMap } from '@atlaskit/icon/
|
|
10
|
+
import baseMigrationMap, { migrationOutcomeDescriptionMap } from '@atlaskit/icon/migration-map';
|
|
11
11
|
import { upcomingIcons } from './upcoming-icons';
|
|
12
12
|
var sizes = ['small', 'medium', 'large', 'xlarge'];
|
|
13
13
|
export var isSize = function isSize(size) {
|
|
@@ -35,13 +35,13 @@ var rule = createLintRule({
|
|
|
35
35
|
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.'",
|
|
36
36
|
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.",
|
|
37
37
|
cantFindSuitableReplacement: "No suitable replacement found for '{{iconName}}' from '{{importSource}}'{{sizeGuidance}}. Please manually migrate this icon.",
|
|
38
|
-
cantMigrateReExport: "'{{exportName}}' is a re-export of icon from '{{packageName}}' and cannot be automatically migrated. Please
|
|
39
|
-
cantMigrateColor: "
|
|
40
|
-
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: '{{missingProps}}' ",
|
|
41
|
-
cantMigrateSizeUnknown: "This usage of Icon sets the size via a variable or function that can't be
|
|
42
|
-
cantMigrateFunctionUnknown: "'{{iconName}}' from
|
|
43
|
-
cantMigrateIdentifierMapOrArray: "This icon is passed to other components via a map or array,
|
|
44
|
-
cantMigrateIdentifier: "This
|
|
38
|
+
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.",
|
|
39
|
+
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.",
|
|
40
|
+
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}}' ",
|
|
41
|
+
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.",
|
|
42
|
+
cantMigrateFunctionUnknown: "Icon '{{iconName}}', from entrypoint '{{importSource}}', is passed into a function/component and can't be migrated automatically. Please manually migrate this icon.",
|
|
43
|
+
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.",
|
|
44
|
+
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."
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
create: function create(context) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
2
|
import { type ImportDeclaration, type JSXAttribute, type Node } from 'eslint-codemod-utils';
|
|
3
|
-
import { type IconMigrationSizeGuidance } from '@atlaskit/icon/
|
|
3
|
+
import { type IconMigrationSizeGuidance } from '@atlaskit/icon/migration-map';
|
|
4
4
|
export type IconMigrationError = Rule.ReportDescriptor;
|
|
5
5
|
export type RangeList = {
|
|
6
6
|
start: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
2
|
import { type ImportDeclaration, type JSXAttribute, type Node } from 'eslint-codemod-utils';
|
|
3
|
-
import { type IconMigrationSizeGuidance } from '@atlaskit/icon/
|
|
3
|
+
import { type IconMigrationSizeGuidance } from '@atlaskit/icon/migration-map';
|
|
4
4
|
export type IconMigrationError = Rule.ReportDescriptor;
|
|
5
5
|
export type RangeList = {
|
|
6
6
|
start: number;
|
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": "11.0.
|
|
4
|
+
"version": "11.0.2",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@atlaskit/eslint-utils": "^1.7.0",
|
|
47
|
-
"@atlaskit/icon": "^
|
|
48
|
-
"@atlaskit/icon-lab": "^
|
|
47
|
+
"@atlaskit/icon": "^23.0.0",
|
|
48
|
+
"@atlaskit/icon-lab": "^2.0.0",
|
|
49
49
|
"@atlaskit/tokens": "*",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@typescript-eslint/utils": "^5.48.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@af/formatting": "*",
|
|
61
|
-
"@atlaskit/ds-lib": "^3.
|
|
61
|
+
"@atlaskit/ds-lib": "^3.3.0",
|
|
62
62
|
"@atlaskit/theme": "^14.0.0",
|
|
63
63
|
"@atlassian/codegen": "*",
|
|
64
64
|
"@atlassian/eslint-utils": "^0.5.0",
|