@atlaskit/eslint-plugin-design-system 11.8.4 → 11.10.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 +24 -0
- package/dist/cjs/ast-nodes/root.js +4 -1
- package/dist/cjs/index.codegen.js +1 -1
- package/dist/cjs/rules/use-tokens-typography/transformers/style-object.js +1 -1
- package/dist/cjs/rules/utils/is-node.js +1 -1
- package/dist/es2019/ast-nodes/root.js +2 -1
- package/dist/es2019/index.codegen.js +3 -3
- package/dist/es2019/rules/use-tokens-typography/transformers/style-object.js +1 -1
- package/dist/es2019/rules/utils/is-node.js +1 -1
- package/dist/esm/ast-nodes/root.js +4 -1
- package/dist/esm/index.codegen.js +3 -3
- package/dist/esm/rules/use-tokens-typography/transformers/style-object.js +1 -1
- package/dist/esm/rules/utils/is-node.js +1 -1
- package/dist/types/ast-nodes/root.d.ts +1 -1
- package/dist/types/index.codegen.d.ts +3 -3
- package/dist/types-ts4.5/ast-nodes/root.d.ts +1 -1
- package/dist/types-ts4.5/index.codegen.d.ts +3 -3
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 11.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
|
|
8
|
+
[`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
|
|
9
|
+
Update `React` from v16 to v18
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#105414](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105414)
|
|
14
|
+
[`6fe5695da9ee6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6fe5695da9ee6) -
|
|
15
|
+
`use-tokens-typography` bug fix for font size 0 and non-pixel values.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
18
|
+
## 11.9.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- [#108380](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108380)
|
|
23
|
+
[`14e491279e7ae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/14e491279e7ae) -
|
|
24
|
+
Fix `ensure-design-token-usage` to allow tokens for all Primitives, not just the root
|
|
25
|
+
`@atlaskit/primitives` entrypoint.
|
|
26
|
+
|
|
3
27
|
## 11.8.4
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -24,7 +24,10 @@ var Root = exports.Root = {
|
|
|
24
24
|
if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'ImportDeclaration')) {
|
|
25
25
|
return false;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
var names = typeof name === 'string' ? [name] : name;
|
|
28
|
+
if (!names.some(function (name) {
|
|
29
|
+
return (0, _eslintCodemodUtils.hasImportDeclaration)(node, name);
|
|
30
|
+
})) {
|
|
28
31
|
return false;
|
|
29
32
|
}
|
|
30
33
|
return true;
|
|
@@ -20,7 +20,7 @@ var _index = require("./rules/index.codegen");
|
|
|
20
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
22
22
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
23
|
-
* @codegen <<SignedSource::
|
|
23
|
+
* @codegen <<SignedSource::1ca7a384145f3bf3577ede9b88907a52>>
|
|
24
24
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
25
25
|
*/
|
|
26
26
|
// this uses require because not all node versions this package supports use the same import assertions/attributes
|
|
@@ -226,7 +226,7 @@ var StyleObject = exports.StyleObject = {
|
|
|
226
226
|
var fontSizeRaw = (0, _utils.getValueForPropertyNode)(fontSizeNode, context);
|
|
227
227
|
|
|
228
228
|
// Without a valid fontSize value we can't be certain what token should be used; exit
|
|
229
|
-
if (
|
|
229
|
+
if (fontSizeRaw === undefined || fontSizeRaw === null) {
|
|
230
230
|
return {
|
|
231
231
|
success: false
|
|
232
232
|
};
|
|
@@ -62,7 +62,7 @@ var isDecendantOfPrimitive = exports.isDecendantOfPrimitive = function isDecenda
|
|
|
62
62
|
if ((0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXElement')) {
|
|
63
63
|
// @ts-ignore
|
|
64
64
|
if (primitivesToCheck.includes(node.openingElement.name.name)) {
|
|
65
|
-
var importDeclaration = _astNodes.Root.findImportsByModule((0, _contextCompat.getSourceCode)(context).ast.body, '@atlaskit/primitives');
|
|
65
|
+
var importDeclaration = _astNodes.Root.findImportsByModule((0, _contextCompat.getSourceCode)(context).ast.body, ['@atlaskit/primitives', '@atlaskit/primitives/box', '@atlaskit/primitives/text', '@atlaskit/primitives/compiled']);
|
|
66
66
|
if (importDeclaration.length) {
|
|
67
67
|
return true;
|
|
68
68
|
}
|
|
@@ -18,7 +18,8 @@ export const Root = {
|
|
|
18
18
|
if (!isNodeOfType(node, 'ImportDeclaration')) {
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
let names = typeof name === 'string' ? [name] : name;
|
|
22
|
+
if (!names.some(name => hasImportDeclaration(node, name))) {
|
|
22
23
|
return false;
|
|
23
24
|
}
|
|
24
25
|
return true;
|
|
@@ -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::1ca7a384145f3bf3577ede9b88907a52>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ const meta = {
|
|
|
21
21
|
name,
|
|
22
22
|
version
|
|
23
23
|
};
|
|
24
|
-
const plugin = {
|
|
24
|
+
export const plugin = {
|
|
25
25
|
meta,
|
|
26
26
|
rules,
|
|
27
27
|
configs: {
|
|
@@ -48,5 +48,5 @@ const plugin = {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
const configs = plugin.configs;
|
|
51
|
-
export { configs, meta,
|
|
51
|
+
export { configs, meta, rules };
|
|
52
52
|
export default plugin;
|
|
@@ -220,7 +220,7 @@ export const StyleObject = {
|
|
|
220
220
|
const fontSizeRaw = getValueForPropertyNode(fontSizeNode, context);
|
|
221
221
|
|
|
222
222
|
// Without a valid fontSize value we can't be certain what token should be used; exit
|
|
223
|
-
if (
|
|
223
|
+
if (fontSizeRaw === undefined || fontSizeRaw === null) {
|
|
224
224
|
return {
|
|
225
225
|
success: false
|
|
226
226
|
};
|
|
@@ -55,7 +55,7 @@ export const isDecendantOfPrimitive = (node, context) => {
|
|
|
55
55
|
if (isNodeOfType(node, 'JSXElement')) {
|
|
56
56
|
// @ts-ignore
|
|
57
57
|
if (primitivesToCheck.includes(node.openingElement.name.name)) {
|
|
58
|
-
const importDeclaration = Root.findImportsByModule(getSourceCode(context).ast.body, '@atlaskit/primitives');
|
|
58
|
+
const importDeclaration = Root.findImportsByModule(getSourceCode(context).ast.body, ['@atlaskit/primitives', '@atlaskit/primitives/box', '@atlaskit/primitives/text', '@atlaskit/primitives/compiled']);
|
|
59
59
|
if (importDeclaration.length) {
|
|
60
60
|
return true;
|
|
61
61
|
}
|
|
@@ -18,7 +18,10 @@ export var Root = {
|
|
|
18
18
|
if (!isNodeOfType(node, 'ImportDeclaration')) {
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
var names = typeof name === 'string' ? [name] : name;
|
|
22
|
+
if (!names.some(function (name) {
|
|
23
|
+
return hasImportDeclaration(node, name);
|
|
24
|
+
})) {
|
|
22
25
|
return false;
|
|
23
26
|
}
|
|
24
27
|
return true;
|
|
@@ -3,7 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
/**
|
|
5
5
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::1ca7a384145f3bf3577ede9b88907a52>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -22,7 +22,7 @@ var meta = {
|
|
|
22
22
|
name: name,
|
|
23
23
|
version: version
|
|
24
24
|
};
|
|
25
|
-
var plugin = {
|
|
25
|
+
export var plugin = {
|
|
26
26
|
meta: meta,
|
|
27
27
|
rules: rules,
|
|
28
28
|
configs: {
|
|
@@ -45,5 +45,5 @@ var plugin = {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
var configs = plugin.configs;
|
|
48
|
-
export { configs, meta,
|
|
48
|
+
export { configs, meta, rules };
|
|
49
49
|
export default plugin;
|
|
@@ -221,7 +221,7 @@ export var StyleObject = {
|
|
|
221
221
|
var fontSizeRaw = getValueForPropertyNode(fontSizeNode, context);
|
|
222
222
|
|
|
223
223
|
// Without a valid fontSize value we can't be certain what token should be used; exit
|
|
224
|
-
if (
|
|
224
|
+
if (fontSizeRaw === undefined || fontSizeRaw === null) {
|
|
225
225
|
return {
|
|
226
226
|
success: false
|
|
227
227
|
};
|
|
@@ -56,7 +56,7 @@ export var isDecendantOfPrimitive = function isDecendantOfPrimitive(node, contex
|
|
|
56
56
|
if (isNodeOfType(node, 'JSXElement')) {
|
|
57
57
|
// @ts-ignore
|
|
58
58
|
if (primitivesToCheck.includes(node.openingElement.name.name)) {
|
|
59
|
-
var importDeclaration = Root.findImportsByModule(getSourceCode(context).ast.body, '@atlaskit/primitives');
|
|
59
|
+
var importDeclaration = Root.findImportsByModule(getSourceCode(context).ast.body, ['@atlaskit/primitives', '@atlaskit/primitives/box', '@atlaskit/primitives/text', '@atlaskit/primitives/compiled']);
|
|
60
60
|
if (importDeclaration.length) {
|
|
61
61
|
return true;
|
|
62
62
|
}
|
|
@@ -10,7 +10,7 @@ export declare const Root: {
|
|
|
10
10
|
* import type { StackProps } from '@atlaskit/primitives'
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
findImportsByModule(root: (Directive | Statement | ModuleDeclaration)[], name: string): ImportDeclaration[];
|
|
13
|
+
findImportsByModule(root: (Directive | Statement | ModuleDeclaration)[], name: string | string[]): ImportDeclaration[];
|
|
14
14
|
insertImport(root: (Directive | Statement | ModuleDeclaration)[], data: {
|
|
15
15
|
module: string;
|
|
16
16
|
specifiers: ImportData;
|
|
@@ -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::1ca7a384145f3bf3577ede9b88907a52>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { ESLint } from 'eslint';
|
|
@@ -9,7 +9,7 @@ declare const meta: {
|
|
|
9
9
|
name: string;
|
|
10
10
|
version: string;
|
|
11
11
|
};
|
|
12
|
-
declare const plugin: {
|
|
12
|
+
export declare const plugin: {
|
|
13
13
|
meta: {
|
|
14
14
|
name: string;
|
|
15
15
|
version: string;
|
|
@@ -420,5 +420,5 @@ declare const configs: {
|
|
|
420
420
|
};
|
|
421
421
|
};
|
|
422
422
|
};
|
|
423
|
-
export { configs, meta,
|
|
423
|
+
export { configs, meta, rules };
|
|
424
424
|
export default plugin;
|
|
@@ -10,7 +10,7 @@ export declare const Root: {
|
|
|
10
10
|
* import type { StackProps } from '@atlaskit/primitives'
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
findImportsByModule(root: (Directive | Statement | ModuleDeclaration)[], name: string): ImportDeclaration[];
|
|
13
|
+
findImportsByModule(root: (Directive | Statement | ModuleDeclaration)[], name: string | string[]): ImportDeclaration[];
|
|
14
14
|
insertImport(root: (Directive | Statement | ModuleDeclaration)[], data: {
|
|
15
15
|
module: string;
|
|
16
16
|
specifiers: ImportData;
|
|
@@ -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::1ca7a384145f3bf3577ede9b88907a52>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { ESLint } from 'eslint';
|
|
@@ -9,7 +9,7 @@ declare const meta: {
|
|
|
9
9
|
name: string;
|
|
10
10
|
version: string;
|
|
11
11
|
};
|
|
12
|
-
declare const plugin: {
|
|
12
|
+
export declare const plugin: {
|
|
13
13
|
meta: {
|
|
14
14
|
name: string;
|
|
15
15
|
version: string;
|
|
@@ -444,5 +444,5 @@ declare const configs: {
|
|
|
444
444
|
};
|
|
445
445
|
};
|
|
446
446
|
};
|
|
447
|
-
export { configs, meta,
|
|
447
|
+
export { configs, meta, rules };
|
|
448
448
|
export default plugin;
|
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.
|
|
4
|
+
"version": "11.10.0",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@atlaskit/eslint-utils": "^1.
|
|
47
|
-
"@atlaskit/icon": "^23.
|
|
48
|
-
"@atlaskit/icon-lab": "^2.
|
|
46
|
+
"@atlaskit/eslint-utils": "^1.9.0",
|
|
47
|
+
"@atlaskit/icon": "^23.5.0",
|
|
48
|
+
"@atlaskit/icon-lab": "^2.3.0",
|
|
49
49
|
"@atlaskit/tokens": "*",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@typescript-eslint/utils": "^7.1.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@af/formatting": "*",
|
|
61
|
-
"@atlaskit/ds-lib": "^3.
|
|
62
|
-
"@atlaskit/theme": "^14.
|
|
61
|
+
"@atlaskit/ds-lib": "^3.5.0",
|
|
62
|
+
"@atlaskit/theme": "^14.1.0",
|
|
63
63
|
"@atlassian/codegen": "*",
|
|
64
64
|
"@atlassian/eslint-utils": "^0.5.0",
|
|
65
65
|
"@atlassian/ts-loader": "*",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"eslint": "^8.57.0",
|
|
75
75
|
"jscodeshift": "^0.13.0",
|
|
76
76
|
"outdent": "^0.5.0",
|
|
77
|
-
"react": "^
|
|
77
|
+
"react": "^18.2.0",
|
|
78
78
|
"ts-jest": "^29.2.2",
|
|
79
79
|
"typescript": "~5.4.2"
|
|
80
80
|
},
|