@atlaskit/eslint-plugin-design-system 13.40.2 → 13.40.4
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/dist/cjs/rules/consistent-css-prop-usage/index.js +1 -0
- package/dist/cjs/rules/use-spotlight-package/linters/import-declaration/index.js +25 -0
- package/dist/es2019/rules/consistent-css-prop-usage/index.js +1 -0
- package/dist/es2019/rules/use-spotlight-package/linters/import-declaration/index.js +25 -0
- package/dist/esm/rules/consistent-css-prop-usage/index.js +1 -0
- package/dist/esm/rules/use-spotlight-package/linters/import-declaration/index.js +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 13.40.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1f45f35f80c0a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f45f35f80c0a) -
|
|
8
|
+
use-spotlight-package now triggers for specific import specifiers, and ignores modal related
|
|
9
|
+
specifiers.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 13.40.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`000d0a2d3aca2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/000d0a2d3aca2) -
|
|
17
|
+
Remove non-erasable syntax (e.g. enums, namespaces with runtime code) from package
|
|
18
|
+
|
|
3
19
|
## 13.40.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -73,6 +73,7 @@ var JSXExpressionLinter = /*#__PURE__*/function () {
|
|
|
73
73
|
* @param configuration What css-related functions to account for (eg. css, xcss, cssMap), and whether to detect bottom vs top expressions.
|
|
74
74
|
* @param expression The expression to traverse and lint.
|
|
75
75
|
*/
|
|
76
|
+
|
|
76
77
|
function JSXExpressionLinter(context, cssAttributeName, configuration, expression) {
|
|
77
78
|
(0, _classCallCheck2.default)(this, JSXExpressionLinter);
|
|
78
79
|
this.context = context;
|
|
@@ -8,6 +8,13 @@ var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
|
8
8
|
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
9
9
|
|
|
10
10
|
var messageId = 'use-spotlight-package';
|
|
11
|
+
var BANNED_IMPORTS = [
|
|
12
|
+
// 'Modal',
|
|
13
|
+
'Spotlight', 'SpotlightCard', 'SpotlightManager', 'SpotlightTarget', 'SpotlightTransition',
|
|
14
|
+
// 'modalButtonTheme',
|
|
15
|
+
'spotlightButtonTheme', 'useSpotlight',
|
|
16
|
+
// 'ModalTransition',
|
|
17
|
+
'SpotlightPulse'];
|
|
11
18
|
var ImportDeclaration = exports.ImportDeclaration = {
|
|
12
19
|
lint: function lint(node, _ref) {
|
|
13
20
|
var context = _ref.context;
|
|
@@ -30,6 +37,24 @@ var ImportDeclaration = exports.ImportDeclaration = {
|
|
|
30
37
|
ref: undefined
|
|
31
38
|
};
|
|
32
39
|
}
|
|
40
|
+
if (!node.specifiers) {
|
|
41
|
+
return {
|
|
42
|
+
success: false,
|
|
43
|
+
ref: undefined
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var isViolation = node.specifiers.some(function (specifier) {
|
|
47
|
+
if (!(0, _eslintCodemodUtils.isNodeOfType)(specifier, 'ImportSpecifier')) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return BANNED_IMPORTS.includes(specifier.imported.name);
|
|
51
|
+
});
|
|
52
|
+
if (!isViolation) {
|
|
53
|
+
return {
|
|
54
|
+
success: false,
|
|
55
|
+
ref: undefined
|
|
56
|
+
};
|
|
57
|
+
}
|
|
33
58
|
return {
|
|
34
59
|
success: true,
|
|
35
60
|
ref: node
|
|
@@ -58,6 +58,7 @@ class JSXExpressionLinter {
|
|
|
58
58
|
* @param configuration What css-related functions to account for (eg. css, xcss, cssMap), and whether to detect bottom vs top expressions.
|
|
59
59
|
* @param expression The expression to traverse and lint.
|
|
60
60
|
*/
|
|
61
|
+
|
|
61
62
|
constructor(context, cssAttributeName, configuration, expression) {
|
|
62
63
|
this.context = context;
|
|
63
64
|
this.cssAttributeName = cssAttributeName;
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
4
4
|
const messageId = 'use-spotlight-package';
|
|
5
|
+
const BANNED_IMPORTS = [
|
|
6
|
+
// 'Modal',
|
|
7
|
+
'Spotlight', 'SpotlightCard', 'SpotlightManager', 'SpotlightTarget', 'SpotlightTransition',
|
|
8
|
+
// 'modalButtonTheme',
|
|
9
|
+
'spotlightButtonTheme', 'useSpotlight',
|
|
10
|
+
// 'ModalTransition',
|
|
11
|
+
'SpotlightPulse'];
|
|
5
12
|
export const ImportDeclaration = {
|
|
6
13
|
lint(node, {
|
|
7
14
|
context
|
|
@@ -26,6 +33,24 @@ export const ImportDeclaration = {
|
|
|
26
33
|
ref: undefined
|
|
27
34
|
};
|
|
28
35
|
}
|
|
36
|
+
if (!node.specifiers) {
|
|
37
|
+
return {
|
|
38
|
+
success: false,
|
|
39
|
+
ref: undefined
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const isViolation = node.specifiers.some(specifier => {
|
|
43
|
+
if (!isNodeOfType(specifier, 'ImportSpecifier')) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return BANNED_IMPORTS.includes(specifier.imported.name);
|
|
47
|
+
});
|
|
48
|
+
if (!isViolation) {
|
|
49
|
+
return {
|
|
50
|
+
success: false,
|
|
51
|
+
ref: undefined
|
|
52
|
+
};
|
|
53
|
+
}
|
|
29
54
|
return {
|
|
30
55
|
success: true,
|
|
31
56
|
ref: node
|
|
@@ -66,6 +66,7 @@ var JSXExpressionLinter = /*#__PURE__*/function () {
|
|
|
66
66
|
* @param configuration What css-related functions to account for (eg. css, xcss, cssMap), and whether to detect bottom vs top expressions.
|
|
67
67
|
* @param expression The expression to traverse and lint.
|
|
68
68
|
*/
|
|
69
|
+
|
|
69
70
|
function JSXExpressionLinter(context, cssAttributeName, configuration, expression) {
|
|
70
71
|
_classCallCheck(this, JSXExpressionLinter);
|
|
71
72
|
this.context = context;
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
4
4
|
var messageId = 'use-spotlight-package';
|
|
5
|
+
var BANNED_IMPORTS = [
|
|
6
|
+
// 'Modal',
|
|
7
|
+
'Spotlight', 'SpotlightCard', 'SpotlightManager', 'SpotlightTarget', 'SpotlightTransition',
|
|
8
|
+
// 'modalButtonTheme',
|
|
9
|
+
'spotlightButtonTheme', 'useSpotlight',
|
|
10
|
+
// 'ModalTransition',
|
|
11
|
+
'SpotlightPulse'];
|
|
5
12
|
export var ImportDeclaration = {
|
|
6
13
|
lint: function lint(node, _ref) {
|
|
7
14
|
var context = _ref.context;
|
|
@@ -24,6 +31,24 @@ export var ImportDeclaration = {
|
|
|
24
31
|
ref: undefined
|
|
25
32
|
};
|
|
26
33
|
}
|
|
34
|
+
if (!node.specifiers) {
|
|
35
|
+
return {
|
|
36
|
+
success: false,
|
|
37
|
+
ref: undefined
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
var isViolation = node.specifiers.some(function (specifier) {
|
|
41
|
+
if (!isNodeOfType(specifier, 'ImportSpecifier')) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
return BANNED_IMPORTS.includes(specifier.imported.name);
|
|
45
|
+
});
|
|
46
|
+
if (!isViolation) {
|
|
47
|
+
return {
|
|
48
|
+
success: false,
|
|
49
|
+
ref: undefined
|
|
50
|
+
};
|
|
51
|
+
}
|
|
27
52
|
return {
|
|
28
53
|
success: true,
|
|
29
54
|
ref: node
|
package/package.json
CHANGED