@atlaskit/eslint-plugin-design-system 10.17.0 → 10.17.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 +18 -0
- package/README.md +1 -1
- package/dist/cjs/rules/no-legacy-icons/helpers.js +6 -3
- package/dist/cjs/rules/no-legacy-icons/upcoming-icons.js +1 -1
- package/dist/es2019/rules/no-legacy-icons/helpers.js +6 -3
- package/dist/es2019/rules/no-legacy-icons/upcoming-icons.js +1 -1
- package/dist/esm/rules/no-legacy-icons/helpers.js +6 -3
- package/dist/esm/rules/no-legacy-icons/upcoming-icons.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 10.17.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#133689](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/133689)
|
|
8
|
+
[`5b1de3a5df2be`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5b1de3a5df2be) -
|
|
9
|
+
Fix bug in no-legacy-icons where in certain tooling, the token() function wasn't recognised
|
|
10
|
+
correctly when resolving icon colors.
|
|
11
|
+
|
|
12
|
+
## 10.17.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#133643](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/133643)
|
|
17
|
+
[`1ab5ca9bddc97`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1ab5ca9bddc97) -
|
|
18
|
+
Updated the list of upcoming icons after a new set of icons were added
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 10.17.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ module.exports = {
|
|
|
68
68
|
| <a href="./src/rules/no-html-button/README.md">no-html-button</a> | Discourage direct usage of HTML button elements in favor of Atlassian Design System button components. | Yes | | |
|
|
69
69
|
| <a href="./src/rules/no-invalid-css-map/README.md">no-invalid-css-map</a> | Checks the validity of a CSS map created through cssMap. This is intended to be used alongside TypeScript's type-checking. | Yes | | |
|
|
70
70
|
| <a href="./src/rules/no-keyframes-tagged-template-expression/README.md">no-keyframes-tagged-template-expression</a> | Disallows any `keyframe` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
|
|
71
|
-
| <a href="./src/rules/no-legacy-icons/README.md">no-legacy-icons</a> | Enforces no legacy icons are used. | |
|
|
71
|
+
| <a href="./src/rules/no-legacy-icons/README.md">no-legacy-icons</a> | Enforces no legacy icons are used. | | Yes | |
|
|
72
72
|
| <a href="./src/rules/no-margin/README.md">no-margin</a> | Disallow using the margin CSS property. | | | |
|
|
73
73
|
| <a href="./src/rules/no-nested-styles/README.md">no-nested-styles</a> | Disallows use of nested styles in `css` functions. | Yes | | |
|
|
74
74
|
| <a href="./src/rules/no-physical-properties/README.md">no-physical-properties</a> | Disallow physical properties and values in `css` function calls. | | Yes | |
|
|
@@ -9,7 +9,6 @@ exports.locToString = exports.isSize = exports.isInsideNewButton = exports.isIns
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
11
11
|
var _UNSAFE_migrationMap = _interopRequireWildcard(require("@atlaskit/icon/UNSAFE_migration-map"));
|
|
12
|
-
var _getImportName = require("../utils/get-import-name");
|
|
13
12
|
var _upcomingIcons = require("./upcoming-icons");
|
|
14
13
|
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); }
|
|
15
14
|
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 && Object.prototype.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; }
|
|
@@ -322,8 +321,12 @@ var createHelpers = exports.createHelpers = function createHelpers(context) {
|
|
|
322
321
|
* @returns The value of the token call, or null if it could not be extracted
|
|
323
322
|
*/
|
|
324
323
|
var getTokenCallValue = function getTokenCallValue(value) {
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
/**
|
|
325
|
+
* Previously, we used getImportName() to extract the token name from a token() call.
|
|
326
|
+
* However, this was failing in the Issue Automat so we are now using a simpler approach.
|
|
327
|
+
*/
|
|
328
|
+
|
|
329
|
+
if ((0, _eslintCodemodUtils.isNodeOfType)(value, 'JSXExpressionContainer') && (0, _eslintCodemodUtils.isNodeOfType)(value.expression, 'CallExpression') && 'name' in value.expression.callee && value.expression.callee.name === 'token') {
|
|
327
330
|
// propName={token("color...."}
|
|
328
331
|
return getLiteralStringValue(value.expression.arguments[0]);
|
|
329
332
|
}
|
|
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.upcomingIcons = void 0;
|
|
7
|
-
var upcomingIcons = exports.upcomingIcons = [
|
|
7
|
+
var upcomingIcons = exports.upcomingIcons = [];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isNodeOfType, literal } from 'eslint-codemod-utils';
|
|
2
2
|
import baseMigrationMap, { migrationOutcomeDescriptionMap } from '@atlaskit/icon/UNSAFE_migration-map';
|
|
3
|
-
import { getImportName } from '../utils/get-import-name';
|
|
4
3
|
import { upcomingIcons } from './upcoming-icons';
|
|
5
4
|
const sizes = ['small', 'medium', 'large', 'xlarge'];
|
|
6
5
|
export const isSize = size => sizes.includes(size);
|
|
@@ -308,8 +307,12 @@ export const createHelpers = context => {
|
|
|
308
307
|
* @returns The value of the token call, or null if it could not be extracted
|
|
309
308
|
*/
|
|
310
309
|
const getTokenCallValue = value => {
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
/**
|
|
311
|
+
* Previously, we used getImportName() to extract the token name from a token() call.
|
|
312
|
+
* However, this was failing in the Issue Automat so we are now using a simpler approach.
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
if (isNodeOfType(value, 'JSXExpressionContainer') && isNodeOfType(value.expression, 'CallExpression') && 'name' in value.expression.callee && value.expression.callee.name === 'token') {
|
|
313
316
|
// propName={token("color...."}
|
|
314
317
|
return getLiteralStringValue(value.expression.arguments[0]);
|
|
315
318
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const upcomingIcons = [
|
|
1
|
+
export const upcomingIcons = [];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { isNodeOfType, literal } from 'eslint-codemod-utils';
|
|
3
3
|
import baseMigrationMap, { migrationOutcomeDescriptionMap } from '@atlaskit/icon/UNSAFE_migration-map';
|
|
4
|
-
import { getImportName } from '../utils/get-import-name';
|
|
5
4
|
import { upcomingIcons } from './upcoming-icons';
|
|
6
5
|
var sizes = ['small', 'medium', 'large', 'xlarge'];
|
|
7
6
|
export var isSize = function isSize(size) {
|
|
@@ -312,8 +311,12 @@ export var createHelpers = function createHelpers(context) {
|
|
|
312
311
|
* @returns The value of the token call, or null if it could not be extracted
|
|
313
312
|
*/
|
|
314
313
|
var getTokenCallValue = function getTokenCallValue(value) {
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
/**
|
|
315
|
+
* Previously, we used getImportName() to extract the token name from a token() call.
|
|
316
|
+
* However, this was failing in the Issue Automat so we are now using a simpler approach.
|
|
317
|
+
*/
|
|
318
|
+
|
|
319
|
+
if (isNodeOfType(value, 'JSXExpressionContainer') && isNodeOfType(value.expression, 'CallExpression') && 'name' in value.expression.callee && value.expression.callee.name === 'token') {
|
|
317
320
|
// propName={token("color...."}
|
|
318
321
|
return getLiteralStringValue(value.expression.arguments[0]);
|
|
319
322
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var upcomingIcons = [
|
|
1
|
+
export var upcomingIcons = [];
|
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": "10.17.
|
|
4
|
+
"version": "10.17.2",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@atlaskit/eslint-utils": "^1.7.0",
|
|
45
|
-
"@atlaskit/icon": "^22.
|
|
45
|
+
"@atlaskit/icon": "^22.15.0",
|
|
46
46
|
"@atlaskit/tokens": "*",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@typescript-eslint/utils": "^5.48.1",
|