@atlaskit/eslint-plugin-design-system 8.15.0 → 8.15.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 +13 -0
- package/dist/cjs/rules/no-deprecated-design-token-usage/index.js +18 -1
- package/dist/cjs/rules/no-unsafe-design-token-usage/index.js +4 -4
- package/dist/es2019/rules/no-deprecated-design-token-usage/index.js +18 -1
- package/dist/es2019/rules/no-unsafe-design-token-usage/index.js +4 -4
- package/dist/esm/rules/no-deprecated-design-token-usage/index.js +18 -1
- package/dist/esm/rules/no-unsafe-design-token-usage/index.js +4 -4
- package/package.json +2 -2
- package/tmp/api-report-tmp.d.ts +0 -118
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 8.15.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#57118](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57118) [`b9bd80957181`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b9bd80957181) - Upgrade Emotion v10 (@emotion/core) to Emotion v11 (@emotion/react). No behaviour change expected.
|
|
8
|
+
|
|
9
|
+
## 8.15.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#43718](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43718) [`8aebcad547a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8aebcad547a) - Deprecated tokens are now warned against even when a replacement token has not been specified
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 8.15.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -21,6 +21,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
21
21
|
fixable: 'code',
|
|
22
22
|
type: 'problem',
|
|
23
23
|
messages: {
|
|
24
|
+
tokenDeprecated: 'The token "{{name}}" is deprecated, Please refer to the changelog for guidance on how to migrate. https://atlassian.design/components/tokens/changelog',
|
|
24
25
|
tokenRenamed: 'The token "{{name}}" is deprecated in favour of "{{replacement}}".'
|
|
25
26
|
}
|
|
26
27
|
},
|
|
@@ -45,7 +46,11 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
45
46
|
}).find(function (t) {
|
|
46
47
|
return (0, _tokenIds.getTokenId)(t.path) === tokenKey;
|
|
47
48
|
});
|
|
48
|
-
if (migrationMeta) {
|
|
49
|
+
if (!migrationMeta) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (migrationMeta.replacement) {
|
|
53
|
+
// Replacement specified, apply fixer
|
|
49
54
|
var replacement = (0, _tokenIds.getTokenId)(migrationMeta.replacement);
|
|
50
55
|
context.report({
|
|
51
56
|
messageId: 'tokenRenamed',
|
|
@@ -60,6 +65,18 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
60
65
|
});
|
|
61
66
|
return;
|
|
62
67
|
}
|
|
68
|
+
|
|
69
|
+
// No replacement specified
|
|
70
|
+
if (migrationMeta.state === 'deprecated' && !migrationMeta.replacement) {
|
|
71
|
+
context.report({
|
|
72
|
+
messageId: 'tokenDeprecated',
|
|
73
|
+
node: node,
|
|
74
|
+
data: {
|
|
75
|
+
name: tokenKey
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
63
80
|
}
|
|
64
81
|
};
|
|
65
82
|
}
|
|
@@ -129,7 +129,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
129
129
|
}).find(function (t) {
|
|
130
130
|
return (0, _tokenIds.getTokenId)(t.path) === tokenKey;
|
|
131
131
|
});
|
|
132
|
-
if (typeof tokenKey === 'string' && deletedMigrationMeta) {
|
|
132
|
+
if (typeof tokenKey === 'string' && deletedMigrationMeta && deletedMigrationMeta.replacement) {
|
|
133
133
|
var cleanTokenKey = (0, _tokenIds.getTokenId)(deletedMigrationMeta.replacement);
|
|
134
134
|
context.report({
|
|
135
135
|
messageId: 'tokenRemoved',
|
|
@@ -144,14 +144,14 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
144
144
|
});
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
var
|
|
147
|
+
var tokenMeta = _renameMapping.default.filter(function (t) {
|
|
148
148
|
return t.state === 'experimental';
|
|
149
149
|
}).find(function (t) {
|
|
150
150
|
return (0, _tokenIds.getTokenId)(t.path) === tokenKey;
|
|
151
151
|
});
|
|
152
152
|
var tokenNames = Object.keys(_tokenNames.default);
|
|
153
|
-
if (typeof tokenKey === 'string' &&
|
|
154
|
-
var replacementValue =
|
|
153
|
+
if (typeof tokenKey === 'string' && tokenMeta && tokenMeta.replacement) {
|
|
154
|
+
var replacementValue = tokenMeta.replacement;
|
|
155
155
|
var isReplacementAToken = tokenNames.includes(replacementValue);
|
|
156
156
|
context.report({
|
|
157
157
|
messageId: 'tokenIsExperimental',
|
|
@@ -14,6 +14,7 @@ const rule = createLintRule({
|
|
|
14
14
|
fixable: 'code',
|
|
15
15
|
type: 'problem',
|
|
16
16
|
messages: {
|
|
17
|
+
tokenDeprecated: 'The token "{{name}}" is deprecated, Please refer to the changelog for guidance on how to migrate. https://atlassian.design/components/tokens/changelog',
|
|
17
18
|
tokenRenamed: 'The token "{{name}}" is deprecated in favour of "{{replacement}}".'
|
|
18
19
|
}
|
|
19
20
|
},
|
|
@@ -34,7 +35,11 @@ const rule = createLintRule({
|
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
const migrationMeta = renameMapping.filter(t => t.state === 'deprecated').find(t => getTokenId(t.path) === tokenKey);
|
|
37
|
-
if (migrationMeta) {
|
|
38
|
+
if (!migrationMeta) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (migrationMeta.replacement) {
|
|
42
|
+
// Replacement specified, apply fixer
|
|
38
43
|
const replacement = getTokenId(migrationMeta.replacement);
|
|
39
44
|
context.report({
|
|
40
45
|
messageId: 'tokenRenamed',
|
|
@@ -47,6 +52,18 @@ const rule = createLintRule({
|
|
|
47
52
|
});
|
|
48
53
|
return;
|
|
49
54
|
}
|
|
55
|
+
|
|
56
|
+
// No replacement specified
|
|
57
|
+
if (migrationMeta.state === 'deprecated' && !migrationMeta.replacement) {
|
|
58
|
+
context.report({
|
|
59
|
+
messageId: 'tokenDeprecated',
|
|
60
|
+
node,
|
|
61
|
+
data: {
|
|
62
|
+
name: tokenKey
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
50
67
|
}
|
|
51
68
|
};
|
|
52
69
|
}
|
|
@@ -137,7 +137,7 @@ token('color.background.blanket');
|
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
139
|
const deletedMigrationMeta = renameMapping.filter(t => t.state === 'deleted').find(t => getTokenId(t.path) === tokenKey);
|
|
140
|
-
if (typeof tokenKey === 'string' && deletedMigrationMeta) {
|
|
140
|
+
if (typeof tokenKey === 'string' && deletedMigrationMeta && deletedMigrationMeta.replacement) {
|
|
141
141
|
const cleanTokenKey = getTokenId(deletedMigrationMeta.replacement);
|
|
142
142
|
context.report({
|
|
143
143
|
messageId: 'tokenRemoved',
|
|
@@ -150,10 +150,10 @@ token('color.background.blanket');
|
|
|
150
150
|
});
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
|
-
const
|
|
153
|
+
const tokenMeta = renameMapping.filter(t => t.state === 'experimental').find(t => getTokenId(t.path) === tokenKey);
|
|
154
154
|
const tokenNames = Object.keys(tokens);
|
|
155
|
-
if (typeof tokenKey === 'string' &&
|
|
156
|
-
const replacementValue =
|
|
155
|
+
if (typeof tokenKey === 'string' && tokenMeta && tokenMeta.replacement) {
|
|
156
|
+
const replacementValue = tokenMeta.replacement;
|
|
157
157
|
const isReplacementAToken = tokenNames.includes(replacementValue);
|
|
158
158
|
context.report({
|
|
159
159
|
messageId: 'tokenIsExperimental',
|
|
@@ -14,6 +14,7 @@ var rule = createLintRule({
|
|
|
14
14
|
fixable: 'code',
|
|
15
15
|
type: 'problem',
|
|
16
16
|
messages: {
|
|
17
|
+
tokenDeprecated: 'The token "{{name}}" is deprecated, Please refer to the changelog for guidance on how to migrate. https://atlassian.design/components/tokens/changelog',
|
|
17
18
|
tokenRenamed: 'The token "{{name}}" is deprecated in favour of "{{replacement}}".'
|
|
18
19
|
}
|
|
19
20
|
},
|
|
@@ -38,7 +39,11 @@ var rule = createLintRule({
|
|
|
38
39
|
}).find(function (t) {
|
|
39
40
|
return getTokenId(t.path) === tokenKey;
|
|
40
41
|
});
|
|
41
|
-
if (migrationMeta) {
|
|
42
|
+
if (!migrationMeta) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (migrationMeta.replacement) {
|
|
46
|
+
// Replacement specified, apply fixer
|
|
42
47
|
var replacement = getTokenId(migrationMeta.replacement);
|
|
43
48
|
context.report({
|
|
44
49
|
messageId: 'tokenRenamed',
|
|
@@ -53,6 +58,18 @@ var rule = createLintRule({
|
|
|
53
58
|
});
|
|
54
59
|
return;
|
|
55
60
|
}
|
|
61
|
+
|
|
62
|
+
// No replacement specified
|
|
63
|
+
if (migrationMeta.state === 'deprecated' && !migrationMeta.replacement) {
|
|
64
|
+
context.report({
|
|
65
|
+
messageId: 'tokenDeprecated',
|
|
66
|
+
node: node,
|
|
67
|
+
data: {
|
|
68
|
+
name: tokenKey
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
56
73
|
}
|
|
57
74
|
};
|
|
58
75
|
}
|
|
@@ -124,7 +124,7 @@ var rule = createLintRule({
|
|
|
124
124
|
}).find(function (t) {
|
|
125
125
|
return getTokenId(t.path) === tokenKey;
|
|
126
126
|
});
|
|
127
|
-
if (typeof tokenKey === 'string' && deletedMigrationMeta) {
|
|
127
|
+
if (typeof tokenKey === 'string' && deletedMigrationMeta && deletedMigrationMeta.replacement) {
|
|
128
128
|
var cleanTokenKey = getTokenId(deletedMigrationMeta.replacement);
|
|
129
129
|
context.report({
|
|
130
130
|
messageId: 'tokenRemoved',
|
|
@@ -139,14 +139,14 @@ var rule = createLintRule({
|
|
|
139
139
|
});
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
var
|
|
142
|
+
var tokenMeta = renameMapping.filter(function (t) {
|
|
143
143
|
return t.state === 'experimental';
|
|
144
144
|
}).find(function (t) {
|
|
145
145
|
return getTokenId(t.path) === tokenKey;
|
|
146
146
|
});
|
|
147
147
|
var tokenNames = Object.keys(tokens);
|
|
148
|
-
if (typeof tokenKey === 'string' &&
|
|
149
|
-
var replacementValue =
|
|
148
|
+
if (typeof tokenKey === 'string' && tokenMeta && tokenMeta.replacement) {
|
|
149
|
+
var replacementValue = tokenMeta.replacement;
|
|
150
150
|
var isReplacementAToken = tokenNames.includes(replacementValue);
|
|
151
151
|
context.report({
|
|
152
152
|
messageId: 'tokenIsExperimental',
|
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": "8.15.
|
|
4
|
+
"version": "8.15.2",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
51
51
|
"@atlassian/codegen": "*",
|
|
52
52
|
"@atlassian/eslint-utils": "^0.3.0",
|
|
53
|
-
"@emotion/
|
|
53
|
+
"@emotion/react": "^11.7.1",
|
|
54
54
|
"@emotion/styled": "^11.0.0",
|
|
55
55
|
"@types/eslint": "^8.4.5",
|
|
56
56
|
"eslint": "^7.7.0",
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/eslint-plugin-design-system"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { Rule } from 'eslint';
|
|
8
|
-
import { RuleListener } from '@typescript-eslint/utils/dist/ts-eslint/Rule';
|
|
9
|
-
import { RuleModule } from '@typescript-eslint/utils/dist/ts-eslint/Rule';
|
|
10
|
-
|
|
11
|
-
// @public (undocumented)
|
|
12
|
-
export const configs: {
|
|
13
|
-
all: {
|
|
14
|
-
plugins: string[];
|
|
15
|
-
rules: {
|
|
16
|
-
'@atlaskit/design-system/consistent-css-prop-usage': string;
|
|
17
|
-
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
18
|
-
'@atlaskit/design-system/ensure-design-token-usage/preview': string;
|
|
19
|
-
'@atlaskit/design-system/icon-label': string;
|
|
20
|
-
'@atlaskit/design-system/no-banned-imports': string;
|
|
21
|
-
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
22
|
-
'@atlaskit/design-system/no-deprecated-apis': string;
|
|
23
|
-
'@atlaskit/design-system/no-deprecated-design-token-usage': string;
|
|
24
|
-
'@atlaskit/design-system/no-deprecated-imports': string;
|
|
25
|
-
'@atlaskit/design-system/no-margin': string;
|
|
26
|
-
'@atlaskit/design-system/no-nested-styles': string;
|
|
27
|
-
'@atlaskit/design-system/no-physical-properties': string;
|
|
28
|
-
'@atlaskit/design-system/no-unsafe-design-token-usage': string;
|
|
29
|
-
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': string;
|
|
30
|
-
'@atlaskit/design-system/prefer-primitives': string;
|
|
31
|
-
'@atlaskit/design-system/use-drawer-label': string;
|
|
32
|
-
'@atlaskit/design-system/use-href-in-link-item': string;
|
|
33
|
-
'@atlaskit/design-system/use-primitives': string;
|
|
34
|
-
'@atlaskit/design-system/use-visually-hidden': string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
recommended: {
|
|
38
|
-
plugins: string[];
|
|
39
|
-
rules: {
|
|
40
|
-
'@atlaskit/design-system/consistent-css-prop-usage': string;
|
|
41
|
-
'@atlaskit/design-system/ensure-design-token-usage': string;
|
|
42
|
-
'@atlaskit/design-system/icon-label': string;
|
|
43
|
-
'@atlaskit/design-system/no-banned-imports': string;
|
|
44
|
-
'@atlaskit/design-system/no-deprecated-apis': string;
|
|
45
|
-
'@atlaskit/design-system/no-deprecated-design-token-usage': string;
|
|
46
|
-
'@atlaskit/design-system/no-deprecated-imports': string;
|
|
47
|
-
'@atlaskit/design-system/no-nested-styles': string;
|
|
48
|
-
'@atlaskit/design-system/no-unsafe-design-token-usage': string;
|
|
49
|
-
'@atlaskit/design-system/no-unsupported-drag-and-drop-libraries': string;
|
|
50
|
-
'@atlaskit/design-system/use-drawer-label': string;
|
|
51
|
-
'@atlaskit/design-system/use-href-in-link-item': string;
|
|
52
|
-
'@atlaskit/design-system/use-visually-hidden': string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// @public (undocumented)
|
|
58
|
-
type DeprecatedConfig = DeprecatedImportConfig | DeprecatedJSXAttributeConfig;
|
|
59
|
-
|
|
60
|
-
// @public (undocumented)
|
|
61
|
-
type DeprecatedImportConfig = {
|
|
62
|
-
[key: string]: DeprecatedImportConfigEntry;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// @public (undocumented)
|
|
66
|
-
type DeprecatedImportConfigEntry = {
|
|
67
|
-
message?: string;
|
|
68
|
-
importSpecifiers?: {
|
|
69
|
-
importName: string;
|
|
70
|
-
message: string;
|
|
71
|
-
}[];
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// @public (undocumented)
|
|
75
|
-
type DeprecatedJSXAttributeConfig = {
|
|
76
|
-
[key: string]: DeprecatedJSXAttributeConfigEntry[];
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// @public (undocumented)
|
|
80
|
-
type DeprecatedJSXAttributeConfigEntry = {
|
|
81
|
-
moduleSpecifier: string;
|
|
82
|
-
namedSpecifiers?: string[];
|
|
83
|
-
actionableVersion?: string;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
// @public (undocumented)
|
|
87
|
-
export const filterActionableDeprecations: (originalDeprecatedConfig: string, rootPackageJson: string) => string;
|
|
88
|
-
|
|
89
|
-
// @public (undocumented)
|
|
90
|
-
export const rules: {
|
|
91
|
-
'consistent-css-prop-usage': Rule.RuleModule;
|
|
92
|
-
'ensure-design-token-usage': Rule.RuleModule;
|
|
93
|
-
'ensure-design-token-usage/preview': Rule.RuleModule;
|
|
94
|
-
'icon-label': Rule.RuleModule;
|
|
95
|
-
'no-banned-imports': Rule.RuleModule;
|
|
96
|
-
'no-css-tagged-template-expression': Rule.RuleModule;
|
|
97
|
-
'no-deprecated-apis': RuleModule<string, [{
|
|
98
|
-
deprecatedConfig: DeprecatedConfig;
|
|
99
|
-
}], RuleListener>;
|
|
100
|
-
'no-deprecated-design-token-usage': Rule.RuleModule;
|
|
101
|
-
'no-deprecated-imports': RuleModule<string, [{
|
|
102
|
-
deprecatedConfig: DeprecatedConfig;
|
|
103
|
-
}], RuleListener>;
|
|
104
|
-
'no-margin': Rule.RuleModule;
|
|
105
|
-
'no-nested-styles': Rule.RuleModule;
|
|
106
|
-
'no-physical-properties': Rule.RuleModule;
|
|
107
|
-
'no-unsafe-design-token-usage': Rule.RuleModule;
|
|
108
|
-
'no-unsupported-drag-and-drop-libraries': Rule.RuleModule;
|
|
109
|
-
'prefer-primitives': Rule.RuleModule;
|
|
110
|
-
'use-drawer-label': Rule.RuleModule;
|
|
111
|
-
'use-href-in-link-item': Rule.RuleModule;
|
|
112
|
-
'use-primitives': Rule.RuleModule;
|
|
113
|
-
'use-visually-hidden': Rule.RuleModule;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
// (No @packageDocumentation comment for this package)
|
|
117
|
-
|
|
118
|
-
```
|