@atlaskit/eslint-plugin-design-system 13.22.0 → 13.23.1
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 +1 -0
- package/dist/cjs/presets/all-flat.codegen.js +2 -1
- package/dist/cjs/presets/all.codegen.js +2 -1
- package/dist/cjs/rules/index.codegen.js +3 -1
- package/dist/cjs/rules/use-spotlight-package/index.js +34 -0
- package/dist/cjs/rules/use-spotlight-package/linters/import-declaration/index.js +38 -0
- package/dist/cjs/rules/use-spotlight-package/linters/index.js +12 -0
- package/dist/es2019/presets/all-flat.codegen.js +2 -1
- package/dist/es2019/presets/all.codegen.js +2 -1
- package/dist/es2019/rules/index.codegen.js +3 -1
- package/dist/es2019/rules/use-spotlight-package/index.js +26 -0
- package/dist/es2019/rules/use-spotlight-package/linters/import-declaration/index.js +34 -0
- package/dist/es2019/rules/use-spotlight-package/linters/index.js +1 -0
- package/dist/esm/presets/all-flat.codegen.js +2 -1
- package/dist/esm/presets/all.codegen.js +2 -1
- package/dist/esm/rules/index.codegen.js +3 -1
- package/dist/esm/rules/use-spotlight-package/index.js +27 -0
- package/dist/esm/rules/use-spotlight-package/linters/import-declaration/index.js +32 -0
- package/dist/esm/rules/use-spotlight-package/linters/index.js +1 -0
- 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/index.codegen.d.ts +1 -1
- package/dist/types/rules/use-spotlight-package/index.d.ts +3 -0
- package/dist/types/rules/use-spotlight-package/linters/import-declaration/index.d.ts +16 -0
- package/dist/types/rules/use-spotlight-package/linters/index.d.ts +1 -0
- 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/index.codegen.d.ts +1 -1
- package/dist/types-ts4.5/rules/use-spotlight-package/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/use-spotlight-package/linters/import-declaration/index.d.ts +16 -0
- package/dist/types-ts4.5/rules/use-spotlight-package/linters/index.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 13.23.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`70773e71f139a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/70773e71f139a) -
|
|
8
|
+
Update description for use-spotlight-package.
|
|
9
|
+
- [`70773e71f139a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/70773e71f139a) -
|
|
10
|
+
Update tests.
|
|
11
|
+
|
|
12
|
+
## 13.23.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [`8bb8c54e2f01f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8bb8c54e2f01f) -
|
|
17
|
+
Create use-spotlight-package rule.
|
|
18
|
+
|
|
3
19
|
## 13.22.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -111,6 +111,7 @@ module.exports = {
|
|
|
111
111
|
| <a href="./packages/design-system/eslint-plugin/src/rules/use-primitives/README.md">use-primitives</a> | Encourage the usage of primitives components. | | Yes | Yes |
|
|
112
112
|
| <a href="./packages/design-system/eslint-plugin/src/rules/use-primitives-text/README.md">use-primitives-text</a> | Encourage the usage of text components. | | Yes | Yes |
|
|
113
113
|
| <a href="./packages/design-system/eslint-plugin/src/rules/use-should-render-to-parent/README.md">use-should-render-to-parent</a> | Encourages makers to use the `shouldRenderToParent` where possible in Atlassian Design System `Popup` and `DropdownMenu` components. | Yes | | Yes |
|
|
114
|
+
| <a href="./packages/design-system/eslint-plugin/src/rules/use-spotlight-package/README.md">use-spotlight-package</a> | Discourage the use of deprecated imports from @atlaskit/onboarding in favor of @atlaskit/spotlight. | | Yes | Yes |
|
|
114
115
|
| <a href="./packages/design-system/eslint-plugin/src/rules/use-tag-group-label/README.md">use-tag-group-label</a> | Ensures tag groups are described to assistive technology by a direct label or by another element. | Yes | | Yes |
|
|
115
116
|
| <a href="./packages/design-system/eslint-plugin/src/rules/use-tokens-shape/README.md">use-tokens-shape</a> | Enforces usage of shape design tokens rather than hard-coded values. | | Yes | Yes |
|
|
116
117
|
| <a href="./packages/design-system/eslint-plugin/src/rules/use-tokens-space/README.md">use-tokens-space</a> | Enforces usage of space design tokens rather than hard-coded values. | | Yes | Yes |
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::5aac2d8dc7c2832bcb8a96a143d60db5>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -75,6 +75,7 @@ var rules = {
|
|
|
75
75
|
'@atlaskit/design-system/use-primitives': 'warn',
|
|
76
76
|
'@atlaskit/design-system/use-primitives-text': 'warn',
|
|
77
77
|
'@atlaskit/design-system/use-should-render-to-parent': 'warn',
|
|
78
|
+
'@atlaskit/design-system/use-spotlight-package': 'warn',
|
|
78
79
|
'@atlaskit/design-system/use-tag-group-label': 'warn',
|
|
79
80
|
'@atlaskit/design-system/use-tokens-shape': 'error',
|
|
80
81
|
'@atlaskit/design-system/use-tokens-space': 'error',
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::43ea4411c4e338a916772d4bfda146cc>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -74,6 +74,7 @@ var rules = {
|
|
|
74
74
|
'@atlaskit/design-system/use-primitives': 'warn',
|
|
75
75
|
'@atlaskit/design-system/use-primitives-text': 'warn',
|
|
76
76
|
'@atlaskit/design-system/use-should-render-to-parent': 'warn',
|
|
77
|
+
'@atlaskit/design-system/use-spotlight-package': 'warn',
|
|
77
78
|
'@atlaskit/design-system/use-tag-group-label': 'warn',
|
|
78
79
|
'@atlaskit/design-system/use-tokens-shape': 'error',
|
|
79
80
|
'@atlaskit/design-system/use-tokens-space': 'error',
|
|
@@ -67,6 +67,7 @@ var _usePopupLabel = _interopRequireDefault(require("./use-popup-label"));
|
|
|
67
67
|
var _usePrimitives = _interopRequireDefault(require("./use-primitives"));
|
|
68
68
|
var _usePrimitivesText = _interopRequireDefault(require("./use-primitives-text"));
|
|
69
69
|
var _useShouldRenderToParent = _interopRequireDefault(require("./use-should-render-to-parent"));
|
|
70
|
+
var _useSpotlightPackage = _interopRequireDefault(require("./use-spotlight-package"));
|
|
70
71
|
var _useTagGroupLabel = _interopRequireDefault(require("./use-tag-group-label"));
|
|
71
72
|
var _useTokensShape = _interopRequireDefault(require("./use-tokens-shape"));
|
|
72
73
|
var _useTokensSpace = _interopRequireDefault(require("./use-tokens-space"));
|
|
@@ -74,7 +75,7 @@ var _useTokensTypography = _interopRequireDefault(require("./use-tokens-typograp
|
|
|
74
75
|
var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
|
|
75
76
|
/**
|
|
76
77
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
77
|
-
* @codegen <<SignedSource::
|
|
78
|
+
* @codegen <<SignedSource::732bff0fc39d7ff05b6688694101698d>>
|
|
78
79
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
79
80
|
*/
|
|
80
81
|
|
|
@@ -141,6 +142,7 @@ var rules = exports.rules = {
|
|
|
141
142
|
'use-primitives': _usePrimitives.default,
|
|
142
143
|
'use-primitives-text': _usePrimitivesText.default,
|
|
143
144
|
'use-should-render-to-parent': _useShouldRenderToParent.default,
|
|
145
|
+
'use-spotlight-package': _useSpotlightPackage.default,
|
|
144
146
|
'use-tag-group-label': _useTagGroupLabel.default,
|
|
145
147
|
'use-tokens-shape': _useTokensShape.default,
|
|
146
148
|
'use-tokens-space': _useTokensSpace.default,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _createRule = require("../utils/create-rule");
|
|
10
|
+
var _linters = require("./linters");
|
|
11
|
+
var rule = (0, _createRule.createLintRule)({
|
|
12
|
+
meta: {
|
|
13
|
+
name: 'use-spotlight-package',
|
|
14
|
+
type: 'problem',
|
|
15
|
+
fixable: 'code',
|
|
16
|
+
hasSuggestions: true,
|
|
17
|
+
docs: {
|
|
18
|
+
description: 'Discourage the use of @atlaskit/onboarding in favor of @atlaskit/spotlight.',
|
|
19
|
+
recommended: false,
|
|
20
|
+
severity: 'warn'
|
|
21
|
+
},
|
|
22
|
+
messages: (0, _defineProperty2.default)({}, 'use-spotlight-package', '@atlaskit/onboarding is deprecated in favor of @atlaskit/spotlight. Please migrate your spotlight experiences accordingly.')
|
|
23
|
+
},
|
|
24
|
+
create: function create(context) {
|
|
25
|
+
return {
|
|
26
|
+
'ImportDeclaration[source.value="@atlaskit/onboarding"]': function ImportDeclarationSourceValueAtlaskit_onboarding(node) {
|
|
27
|
+
return _linters.ImportDeclaration.lint(node, {
|
|
28
|
+
context: context
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var _default = exports.default = rule;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ImportDeclaration = void 0;
|
|
7
|
+
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
8
|
+
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
9
|
+
|
|
10
|
+
var messageId = 'use-spotlight-package';
|
|
11
|
+
var ImportDeclaration = exports.ImportDeclaration = {
|
|
12
|
+
lint: function lint(node, _ref) {
|
|
13
|
+
var context = _ref.context;
|
|
14
|
+
// Check whether all criteria needed to make a transformation are met
|
|
15
|
+
var _ImportDeclaration$_c = ImportDeclaration._check(node),
|
|
16
|
+
success = _ImportDeclaration$_c.success,
|
|
17
|
+
ref = _ImportDeclaration$_c.ref;
|
|
18
|
+
if (!success) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
context.report({
|
|
22
|
+
node: ref,
|
|
23
|
+
messageId: messageId
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
_check: function _check(node) {
|
|
27
|
+
if (!(0, _eslintCodemodUtils.isNodeOfType)(node, 'ImportDeclaration')) {
|
|
28
|
+
return {
|
|
29
|
+
success: false,
|
|
30
|
+
ref: undefined
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
success: true,
|
|
35
|
+
ref: node
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ImportDeclaration", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _importDeclaration.ImportDeclaration;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _importDeclaration = require("./import-declaration");
|
|
@@ -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::5aac2d8dc7c2832bcb8a96a143d60db5>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -69,6 +69,7 @@ const rules = {
|
|
|
69
69
|
'@atlaskit/design-system/use-primitives': 'warn',
|
|
70
70
|
'@atlaskit/design-system/use-primitives-text': 'warn',
|
|
71
71
|
'@atlaskit/design-system/use-should-render-to-parent': 'warn',
|
|
72
|
+
'@atlaskit/design-system/use-spotlight-package': 'warn',
|
|
72
73
|
'@atlaskit/design-system/use-tag-group-label': 'warn',
|
|
73
74
|
'@atlaskit/design-system/use-tokens-shape': 'error',
|
|
74
75
|
'@atlaskit/design-system/use-tokens-space': 'error',
|
|
@@ -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::43ea4411c4e338a916772d4bfda146cc>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -68,6 +68,7 @@ const rules = {
|
|
|
68
68
|
'@atlaskit/design-system/use-primitives': 'warn',
|
|
69
69
|
'@atlaskit/design-system/use-primitives-text': 'warn',
|
|
70
70
|
'@atlaskit/design-system/use-should-render-to-parent': 'warn',
|
|
71
|
+
'@atlaskit/design-system/use-spotlight-package': 'warn',
|
|
71
72
|
'@atlaskit/design-system/use-tag-group-label': 'warn',
|
|
72
73
|
'@atlaskit/design-system/use-tokens-shape': 'error',
|
|
73
74
|
'@atlaskit/design-system/use-tokens-space': 'error',
|
|
@@ -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::732bff0fc39d7ff05b6688694101698d>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -66,6 +66,7 @@ import usePopupLabel from './use-popup-label';
|
|
|
66
66
|
import usePrimitives from './use-primitives';
|
|
67
67
|
import usePrimitivesText from './use-primitives-text';
|
|
68
68
|
import useShouldRenderToParent from './use-should-render-to-parent';
|
|
69
|
+
import useSpotlightPackage from './use-spotlight-package';
|
|
69
70
|
import useTagGroupLabel from './use-tag-group-label';
|
|
70
71
|
import useTokensShape from './use-tokens-shape';
|
|
71
72
|
import useTokensSpace from './use-tokens-space';
|
|
@@ -134,6 +135,7 @@ export const rules = {
|
|
|
134
135
|
'use-primitives': usePrimitives,
|
|
135
136
|
'use-primitives-text': usePrimitivesText,
|
|
136
137
|
'use-should-render-to-parent': useShouldRenderToParent,
|
|
138
|
+
'use-spotlight-package': useSpotlightPackage,
|
|
137
139
|
'use-tag-group-label': useTagGroupLabel,
|
|
138
140
|
'use-tokens-shape': useTokensShape,
|
|
139
141
|
'use-tokens-space': useTokensSpace,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createLintRule } from '../utils/create-rule';
|
|
2
|
+
import { ImportDeclaration } from './linters';
|
|
3
|
+
const rule = createLintRule({
|
|
4
|
+
meta: {
|
|
5
|
+
name: 'use-spotlight-package',
|
|
6
|
+
type: 'problem',
|
|
7
|
+
fixable: 'code',
|
|
8
|
+
hasSuggestions: true,
|
|
9
|
+
docs: {
|
|
10
|
+
description: 'Discourage the use of @atlaskit/onboarding in favor of @atlaskit/spotlight.',
|
|
11
|
+
recommended: false,
|
|
12
|
+
severity: 'warn'
|
|
13
|
+
},
|
|
14
|
+
messages: {
|
|
15
|
+
['use-spotlight-package']: '@atlaskit/onboarding is deprecated in favor of @atlaskit/spotlight. Please migrate your spotlight experiences accordingly.'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
create(context) {
|
|
19
|
+
return {
|
|
20
|
+
'ImportDeclaration[source.value="@atlaskit/onboarding"]': node => ImportDeclaration.lint(node, {
|
|
21
|
+
context
|
|
22
|
+
})
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export default rule;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
2
|
+
|
|
3
|
+
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
4
|
+
const messageId = 'use-spotlight-package';
|
|
5
|
+
export const ImportDeclaration = {
|
|
6
|
+
lint(node, {
|
|
7
|
+
context
|
|
8
|
+
}) {
|
|
9
|
+
// Check whether all criteria needed to make a transformation are met
|
|
10
|
+
const {
|
|
11
|
+
success,
|
|
12
|
+
ref
|
|
13
|
+
} = ImportDeclaration._check(node);
|
|
14
|
+
if (!success) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
context.report({
|
|
18
|
+
node: ref,
|
|
19
|
+
messageId
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
_check(node) {
|
|
23
|
+
if (!isNodeOfType(node, 'ImportDeclaration')) {
|
|
24
|
+
return {
|
|
25
|
+
success: false,
|
|
26
|
+
ref: undefined
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
success: true,
|
|
31
|
+
ref: node
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImportDeclaration } from './import-declaration';
|
|
@@ -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::5aac2d8dc7c2832bcb8a96a143d60db5>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -69,6 +69,7 @@ var rules = {
|
|
|
69
69
|
'@atlaskit/design-system/use-primitives': 'warn',
|
|
70
70
|
'@atlaskit/design-system/use-primitives-text': 'warn',
|
|
71
71
|
'@atlaskit/design-system/use-should-render-to-parent': 'warn',
|
|
72
|
+
'@atlaskit/design-system/use-spotlight-package': 'warn',
|
|
72
73
|
'@atlaskit/design-system/use-tag-group-label': 'warn',
|
|
73
74
|
'@atlaskit/design-system/use-tokens-shape': 'error',
|
|
74
75
|
'@atlaskit/design-system/use-tokens-space': 'error',
|
|
@@ -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::43ea4411c4e338a916772d4bfda146cc>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -68,6 +68,7 @@ var rules = {
|
|
|
68
68
|
'@atlaskit/design-system/use-primitives': 'warn',
|
|
69
69
|
'@atlaskit/design-system/use-primitives-text': 'warn',
|
|
70
70
|
'@atlaskit/design-system/use-should-render-to-parent': 'warn',
|
|
71
|
+
'@atlaskit/design-system/use-spotlight-package': 'warn',
|
|
71
72
|
'@atlaskit/design-system/use-tag-group-label': 'warn',
|
|
72
73
|
'@atlaskit/design-system/use-tokens-shape': 'error',
|
|
73
74
|
'@atlaskit/design-system/use-tokens-space': 'error',
|
|
@@ -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::732bff0fc39d7ff05b6688694101698d>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -66,6 +66,7 @@ import usePopupLabel from './use-popup-label';
|
|
|
66
66
|
import usePrimitives from './use-primitives';
|
|
67
67
|
import usePrimitivesText from './use-primitives-text';
|
|
68
68
|
import useShouldRenderToParent from './use-should-render-to-parent';
|
|
69
|
+
import useSpotlightPackage from './use-spotlight-package';
|
|
69
70
|
import useTagGroupLabel from './use-tag-group-label';
|
|
70
71
|
import useTokensShape from './use-tokens-shape';
|
|
71
72
|
import useTokensSpace from './use-tokens-space';
|
|
@@ -134,6 +135,7 @@ export var rules = {
|
|
|
134
135
|
'use-primitives': usePrimitives,
|
|
135
136
|
'use-primitives-text': usePrimitivesText,
|
|
136
137
|
'use-should-render-to-parent': useShouldRenderToParent,
|
|
138
|
+
'use-spotlight-package': useSpotlightPackage,
|
|
137
139
|
'use-tag-group-label': useTagGroupLabel,
|
|
138
140
|
'use-tokens-shape': useTokensShape,
|
|
139
141
|
'use-tokens-space': useTokensSpace,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { createLintRule } from '../utils/create-rule';
|
|
3
|
+
import { ImportDeclaration } from './linters';
|
|
4
|
+
var rule = createLintRule({
|
|
5
|
+
meta: {
|
|
6
|
+
name: 'use-spotlight-package',
|
|
7
|
+
type: 'problem',
|
|
8
|
+
fixable: 'code',
|
|
9
|
+
hasSuggestions: true,
|
|
10
|
+
docs: {
|
|
11
|
+
description: 'Discourage the use of @atlaskit/onboarding in favor of @atlaskit/spotlight.',
|
|
12
|
+
recommended: false,
|
|
13
|
+
severity: 'warn'
|
|
14
|
+
},
|
|
15
|
+
messages: _defineProperty({}, 'use-spotlight-package', '@atlaskit/onboarding is deprecated in favor of @atlaskit/spotlight. Please migrate your spotlight experiences accordingly.')
|
|
16
|
+
},
|
|
17
|
+
create: function create(context) {
|
|
18
|
+
return {
|
|
19
|
+
'ImportDeclaration[source.value="@atlaskit/onboarding"]': function ImportDeclarationSourceValueAtlaskit_onboarding(node) {
|
|
20
|
+
return ImportDeclaration.lint(node, {
|
|
21
|
+
context: context
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export default rule;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
2
|
+
|
|
3
|
+
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
4
|
+
var messageId = 'use-spotlight-package';
|
|
5
|
+
export var ImportDeclaration = {
|
|
6
|
+
lint: function lint(node, _ref) {
|
|
7
|
+
var context = _ref.context;
|
|
8
|
+
// Check whether all criteria needed to make a transformation are met
|
|
9
|
+
var _ImportDeclaration$_c = ImportDeclaration._check(node),
|
|
10
|
+
success = _ImportDeclaration$_c.success,
|
|
11
|
+
ref = _ImportDeclaration$_c.ref;
|
|
12
|
+
if (!success) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
context.report({
|
|
16
|
+
node: ref,
|
|
17
|
+
messageId: messageId
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
_check: function _check(node) {
|
|
21
|
+
if (!isNodeOfType(node, 'ImportDeclaration')) {
|
|
22
|
+
return {
|
|
23
|
+
success: false,
|
|
24
|
+
ref: undefined
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
success: true,
|
|
29
|
+
ref: node
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImportDeclaration } from './import-declaration';
|
|
@@ -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::5aac2d8dc7c2832bcb8a96a143d60db5>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { Linter } from 'eslint';
|
|
@@ -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::43ea4411c4e338a916772d4bfda146cc>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { ESLint } from 'eslint';
|
|
@@ -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::732bff0fc39d7ff05b6688694101698d>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { Rule } from 'eslint';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import { type ImportDeclaration as ImportDeclarationNode } from 'eslint-codemod-utils';
|
|
3
|
+
type Check = {
|
|
4
|
+
success: false;
|
|
5
|
+
ref: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
success: true;
|
|
8
|
+
ref: ImportDeclarationNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const ImportDeclaration: {
|
|
11
|
+
lint(node: Rule.Node, { context }: {
|
|
12
|
+
context: Rule.RuleContext;
|
|
13
|
+
}): void;
|
|
14
|
+
_check(node: Rule.Node): Check;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImportDeclaration } from './import-declaration';
|
|
@@ -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::5aac2d8dc7c2832bcb8a96a143d60db5>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { Linter } from 'eslint';
|
|
@@ -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::43ea4411c4e338a916772d4bfda146cc>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { ESLint } from 'eslint';
|
|
@@ -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::732bff0fc39d7ff05b6688694101698d>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { Rule } from 'eslint';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import { type ImportDeclaration as ImportDeclarationNode } from 'eslint-codemod-utils';
|
|
3
|
+
type Check = {
|
|
4
|
+
success: false;
|
|
5
|
+
ref: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
success: true;
|
|
8
|
+
ref: ImportDeclarationNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const ImportDeclaration: {
|
|
11
|
+
lint(node: Rule.Node, { context }: {
|
|
12
|
+
context: Rule.RuleContext;
|
|
13
|
+
}): void;
|
|
14
|
+
_check(node: Rule.Node): Check;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImportDeclaration } from './import-declaration';
|
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": "13.
|
|
4
|
+
"version": "13.23.1",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@atlaskit/eslint-utils": "^2.0.0",
|
|
42
42
|
"@atlaskit/icon": "^28.5.0",
|
|
43
|
-
"@atlaskit/icon-lab": "^5.
|
|
44
|
-
"@atlaskit/tokens": "^7.
|
|
43
|
+
"@atlaskit/icon-lab": "^5.11.0",
|
|
44
|
+
"@atlaskit/tokens": "^7.1.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@typescript-eslint/utils": "^7.1.0",
|
|
47
47
|
"ajv": "^6.12.6",
|