@atlaskit/eslint-plugin-ui-styling-standard 1.4.2 → 1.4.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/README.md +1 -1
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/presets/all-flat.codegen.js +1 -2
- package/dist/cjs/presets/recommended-flat.codegen.js +1 -2
- package/dist/cjs/rules/no-array-arguments/index.js +1 -1
- package/dist/cjs/rules/no-container-queries/index.js +0 -2
- package/dist/cjs/rules/no-dynamic-styles/index.js +1 -1
- package/dist/cjs/rules/no-exported-styles/index.js +0 -2
- package/dist/cjs/rules/no-global-styles/index.js +1 -1
- package/dist/cjs/rules/no-imported-style-values/index.js +1 -2
- package/dist/cjs/rules/no-nested-selectors/index.js +1 -2
- package/dist/cjs/rules/no-unsafe-selectors/walk-css-map.js +1 -1
- package/dist/cjs/rules/no-unsafe-values/index.js +0 -2
- package/dist/cjs/rules/no-unsafe-values/messages.js +2 -2
- package/dist/cjs/rules/no-unsafe-values/utils.js +1 -0
- package/dist/cjs/rules/use-compiled/index.js +5 -3
- package/dist/cjs/rules/use-compiled/is-safe.js +3 -0
- package/dist/es2019/rules/no-array-arguments/index.js +0 -2
- package/dist/es2019/rules/no-container-queries/index.js +0 -2
- package/dist/es2019/rules/no-dynamic-styles/index.js +0 -1
- package/dist/es2019/rules/no-exported-styles/index.js +0 -2
- package/dist/es2019/rules/no-global-styles/index.js +1 -1
- package/dist/es2019/rules/no-imported-style-values/index.js +0 -4
- package/dist/es2019/rules/no-unsafe-selectors/walk-css-map.js +1 -1
- package/dist/es2019/rules/no-unsafe-values/index.js +0 -2
- package/dist/es2019/rules/no-unsafe-values/utils.js +1 -0
- package/dist/es2019/rules/use-compiled/index.js +5 -3
- package/dist/es2019/rules/use-compiled/is-safe.js +3 -0
- package/dist/esm/rules/no-array-arguments/index.js +0 -2
- package/dist/esm/rules/no-container-queries/index.js +0 -2
- package/dist/esm/rules/no-dynamic-styles/index.js +0 -1
- package/dist/esm/rules/no-exported-styles/index.js +0 -2
- package/dist/esm/rules/no-global-styles/index.js +1 -1
- package/dist/esm/rules/no-imported-style-values/index.js +0 -4
- package/dist/esm/rules/no-unsafe-selectors/walk-css-map.js +1 -1
- package/dist/esm/rules/no-unsafe-values/index.js +0 -2
- package/dist/esm/rules/no-unsafe-values/messages.js +2 -2
- package/dist/esm/rules/no-unsafe-values/utils.js +1 -0
- package/dist/esm/rules/use-compiled/index.js +5 -3
- package/dist/esm/rules/use-compiled/is-safe.js +3 -0
- package/dist/types/index.codegen.d.ts +348 -4
- package/dist/types/rules/no-unsafe-values/utils.d.ts +1 -1
- package/dist/types/rules/utils/create-rule-with-typed-config.d.ts +1 -1
- package/dist/types-ts4.5/index.codegen.d.ts +526 -2
- package/dist/types-ts4.5/rules/no-unsafe-values/utils.d.ts +1 -1
- package/dist/types-ts4.5/rules/utils/create-rule-with-typed-config.d.ts +1 -1
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-ui-styling-standard
|
|
2
2
|
|
|
3
|
+
## 1.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`23bcc5bbc9cee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/23bcc5bbc9cee) -
|
|
8
|
+
Internal changes to how border radius is applied.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 1.4.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#192710](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/192710)
|
|
16
|
+
[`b3b30f3bc4453`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b3b30f3bc4453) -
|
|
17
|
+
Internal changes to how border radius and border width values are applied. No visual change.
|
|
18
|
+
|
|
3
19
|
## 1.4.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ module.exports = {
|
|
|
58
58
|
| <a href="./packages/design-system/eslint-plugin-ui-styling-standard/src/rules/no-styled/README.md">no-styled</a> | Disallows usage of the `styled` imports | Yes | | |
|
|
59
59
|
| <a href="./packages/design-system/eslint-plugin-ui-styling-standard/src/rules/no-unsafe-selectors/README.md">no-unsafe-selectors</a> | Disallows use of nested styles in `css` functions. | Yes | Yes | Yes |
|
|
60
60
|
| <a href="./packages/design-system/eslint-plugin-ui-styling-standard/src/rules/no-unsafe-values/README.md">no-unsafe-values</a> | Disallows styles that are difficult/impossible to statically anaylze. | Yes | | |
|
|
61
|
-
| <a href="./packages/design-system/eslint-plugin-ui-styling-standard/src/rules/use-compiled/README.md">use-compiled</a> | Ensures usage of `@compiled/react` instead of other CSS-in-JS libraries
|
|
61
|
+
| <a href="./packages/design-system/eslint-plugin-ui-styling-standard/src/rules/use-compiled/README.md">use-compiled</a> | Ensures usage of `@compiled/react` or `@atlaskit/css` instead of other CSS-in-JS libraries | Yes | Yes | |
|
|
62
62
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/consistent-css-prop-usage/usage">@atlaskit/design-system/consistent-css-prop-usage</a> | Ensures consistency with `css` and `xcss` prop usages | Yes | Yes | |
|
|
63
63
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-css-tagged-template-expression/usage">@atlaskit/design-system/no-css-tagged-template-expression</a> | Disallows any `css` tagged template expressions that originate from Emotion, Styled Components or Compiled | Yes | Yes | |
|
|
64
64
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-keyframes-tagged-template-expression/usage">@atlaskit/design-system/no-keyframes-tagged-template-expression</a> | Disallows any `keyframe` tagged template expressions that originate from Emotion, Styled Components or Compiled | Yes | Yes | |
|
package/dist/cjs/index.js
CHANGED
|
@@ -35,5 +35,4 @@ Object.defineProperty(exports, "rules", {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
var _index = _interopRequireWildcard(require("./index.codegen"));
|
|
38
|
-
function
|
|
39
|
-
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 && {}.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; }
|
|
38
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var atlaskitDesignSystemPlugin = _interopRequireWildcard(require("@atlaskit/eslint-plugin-design-system"));
|
|
9
|
-
function
|
|
10
|
-
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 && {}.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; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
10
|
/**
|
|
12
11
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
13
12
|
* @codegen <<SignedSource::4595bc1a07f9da4186e2df84cea56831>>
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var atlaskitDesignSystemPlugin = _interopRequireWildcard(require("@atlaskit/eslint-plugin-design-system"));
|
|
9
|
-
function
|
|
10
|
-
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 && {}.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; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
10
|
/**
|
|
12
11
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
13
12
|
* @codegen <<SignedSource::4595bc1a07f9da4186e2df84cea56831>>
|
|
@@ -9,7 +9,7 @@ var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
|
9
9
|
var _createRule = require("../utils/create-rule");
|
|
10
10
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
11
11
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
13
|
var schema = [{
|
|
14
14
|
type: 'object',
|
|
15
15
|
properties: {
|
|
@@ -9,8 +9,6 @@ var _estraverse = _interopRequireDefault(require("estraverse"));
|
|
|
9
9
|
var _contextCompat = require("@atlaskit/eslint-utils/context-compat");
|
|
10
10
|
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
11
11
|
var _createRule = require("../utils/create-rule");
|
|
12
|
-
/* eslint-disable @atlassian/tangerine/import/entry-points */
|
|
13
|
-
|
|
14
12
|
var schema = [{
|
|
15
13
|
type: 'object',
|
|
16
14
|
properties: {
|
|
@@ -11,7 +11,7 @@ var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
|
11
11
|
var _createRule = require("../utils/create-rule");
|
|
12
12
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
13
13
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
15
|
var schema = [{
|
|
16
16
|
type: 'object',
|
|
17
17
|
properties: {
|
|
@@ -7,8 +7,6 @@ exports.rule = exports.default = void 0;
|
|
|
7
7
|
var _createNoExportedRule = require("@atlaskit/eslint-utils/create-no-exported-rule");
|
|
8
8
|
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
9
9
|
var _createRule = require("../utils/create-rule");
|
|
10
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
11
|
-
|
|
12
10
|
var schema = [{
|
|
13
11
|
type: 'object',
|
|
14
12
|
properties: {
|
|
@@ -54,7 +54,7 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
54
54
|
var _loop = function _loop() {
|
|
55
55
|
var importName = _step.value;
|
|
56
56
|
var specifier = node.specifiers.filter(isImportSpecifier).find(function (specifier) {
|
|
57
|
-
return specifier.imported.name === importName;
|
|
57
|
+
return 'name' in specifier.imported && specifier.imported.name === importName;
|
|
58
58
|
});
|
|
59
59
|
if (specifier) {
|
|
60
60
|
context.report({
|
|
@@ -14,8 +14,7 @@ var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
|
14
14
|
var _createRule = require("../utils/create-rule");
|
|
15
15
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
16
16
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
18
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
17
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
18
|
var schema = [{
|
|
20
19
|
type: 'object',
|
|
21
20
|
properties: {
|
|
@@ -12,8 +12,7 @@ var _contextCompat = require("@atlaskit/eslint-utils/context-compat");
|
|
|
12
12
|
var _schema = require("@atlaskit/eslint-utils/schema");
|
|
13
13
|
var _walkStyleProperties = require("@atlaskit/eslint-utils/walk-style-properties");
|
|
14
14
|
var _createRuleWithTypedConfig = require("../utils/create-rule-with-typed-config");
|
|
15
|
-
function
|
|
16
|
-
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 && {}.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; }
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
16
|
var getCssSelector = function getCssSelector(key) {
|
|
18
17
|
if (key.type === 'Literal' && typeof key.value === 'string') {
|
|
19
18
|
return key.value;
|
|
@@ -22,7 +22,7 @@ function walkCssMap(_ref) {
|
|
|
22
22
|
return node.type === 'ImportDeclaration' && importSources.includes(node.source.value);
|
|
23
23
|
});
|
|
24
24
|
var specifier = importDeclaration === null || importDeclaration === void 0 ? void 0 : importDeclaration.specifiers.find(function (specifier) {
|
|
25
|
-
return specifier.type === 'ImportSpecifier' && specifier.imported.name === 'cssMap';
|
|
25
|
+
return specifier.type === 'ImportSpecifier' && 'name' in specifier.imported && specifier.imported.name === 'cssMap';
|
|
26
26
|
});
|
|
27
27
|
if (!specifier) {
|
|
28
28
|
return;
|
|
@@ -9,8 +9,6 @@ var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
|
9
9
|
var _createRule = require("../utils/create-rule");
|
|
10
10
|
var _messages = require("./messages");
|
|
11
11
|
var _utils = require("./utils");
|
|
12
|
-
/* eslint-disable @atlassian/tangerine/import/entry-points */
|
|
13
|
-
|
|
14
12
|
var schema = [{
|
|
15
13
|
type: 'object',
|
|
16
14
|
additionalProperties: false,
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.messages = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _outdent = _interopRequireDefault(require("outdent"));
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9,
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0;
|
|
11
11
|
var whereToGetHelp = "If you think this should be allowed, or if you're running into issues, reach out in #help-ui-styling-standard";
|
|
12
12
|
var messages = exports.messages = {
|
|
13
13
|
'no-array-values': (0, _outdent.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n Arrays are not allowed in style objects. Support is inconsistent between styling libraries.\n\n Compose styles with the css prop instead.\n\n ", "\n "])), whereToGetHelp),
|
|
@@ -20,5 +20,5 @@ var messages = exports.messages = {
|
|
|
20
20
|
'no-spread-elements': (0, _outdent.default)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n Spread elements are not allowed in style objects.\n\n Compose styles with the css prop instead.\n\n ", "\n "])), whereToGetHelp),
|
|
21
21
|
// Fallback case if a more specific message is not applicable
|
|
22
22
|
'no-unsafe-values': (0, _outdent.default)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n Unsafe values are not allowed in style objects.\n\n ", "\n "])), whereToGetHelp),
|
|
23
|
-
'no-variables': (0, _outdent.default)(
|
|
23
|
+
'no-variables': (0, _outdent.default)(_templateObject0 || (_templateObject0 = (0, _taggedTemplateLiteral2.default)(["\n Variables are not allowed in style objects, unless they:\n\n - Have a simple, static value.\n - Are defined in the same file.\n\n Use the style prop to apply dynamic values instead.\n\n ", "\n "])), whereToGetHelp)
|
|
24
24
|
};
|
|
@@ -310,6 +310,7 @@ var Linter = exports.Linter = /*#__PURE__*/function () {
|
|
|
310
310
|
return;
|
|
311
311
|
}
|
|
312
312
|
if (value.type === 'BinaryExpression') {
|
|
313
|
+
// @ts-ignore -- this needs to be `ts-ignore` because this only errors in jira's typechecking due to update, not platform's
|
|
313
314
|
this.lintValue(value.left);
|
|
314
315
|
this.lintValue(value.right);
|
|
315
316
|
return;
|
|
@@ -51,12 +51,12 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
51
51
|
type: 'problem',
|
|
52
52
|
fixable: 'code',
|
|
53
53
|
docs: {
|
|
54
|
-
description: 'Ensures usage of `@compiled/react` instead of other CSS-in-JS libraries',
|
|
54
|
+
description: 'Ensures usage of `@compiled/react` or `@atlaskit/css` instead of other CSS-in-JS libraries',
|
|
55
55
|
recommended: true,
|
|
56
56
|
severity: 'error'
|
|
57
57
|
},
|
|
58
58
|
messages: {
|
|
59
|
-
'use-compiled': "Use '@compiled/react' instead of '{{importSource}}'"
|
|
59
|
+
'use-compiled': "Use '@atlaskit/css' or '@compiled/react' instead of '{{importSource}}'"
|
|
60
60
|
},
|
|
61
61
|
schema: schema
|
|
62
62
|
},
|
|
@@ -105,7 +105,8 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
105
105
|
case 7:
|
|
106
106
|
_context.next = 9;
|
|
107
107
|
return fixer.replaceText(
|
|
108
|
-
//
|
|
108
|
+
// TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
|
|
109
|
+
// @ts-ignore - types don't accept comment nodes
|
|
109
110
|
pragma, "/** @jsxImportSource @compiled/react */");
|
|
110
111
|
case 9:
|
|
111
112
|
case "end":
|
|
@@ -243,6 +244,7 @@ function fixImport(_ref4) {
|
|
|
243
244
|
})();
|
|
244
245
|
}
|
|
245
246
|
function buildImportDeclaration(specifiers, source) {
|
|
247
|
+
// @ts-ignore - this needs to be `ts-ignore` because this only errors in jira's typechecking due to update, not platform's
|
|
246
248
|
return "".concat((0, _eslintCodemodUtils.importDeclaration)({
|
|
247
249
|
specifiers: specifiers,
|
|
248
250
|
source: (0, _eslintCodemodUtils.literal)(source)
|
|
@@ -14,6 +14,9 @@ function isSafeUsage(_ref) {
|
|
|
14
14
|
var context = _ref.context,
|
|
15
15
|
specifier = _ref.specifier,
|
|
16
16
|
supportedImports = _ref.supportedImports;
|
|
17
|
+
if (!('name' in specifier.imported)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
17
20
|
var importName = specifier.imported.name;
|
|
18
21
|
if (!supportedImports.has(importName)) {
|
|
19
22
|
return false;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
2
|
-
|
|
3
1
|
import { getScope, getSourceCode } from '@atlaskit/eslint-utils/context-compat';
|
|
4
2
|
import { getImportSources, hasStyleObjectArguments } from '@atlaskit/eslint-utils/is-supported-import';
|
|
5
3
|
import { createLintRule } from '../utils/create-rule';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @atlassian/tangerine/import/entry-points */
|
|
2
|
-
|
|
3
1
|
import estraverse from 'estraverse';
|
|
4
2
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
5
3
|
import { getImportSources, isCss, isCssMap, isKeyframes, isStyled, isXcss } from '@atlaskit/eslint-utils/is-supported-import';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
2
1
|
import esquery from 'esquery';
|
|
3
2
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
4
3
|
import { getImportSources, hasStyleObjectArguments } from '@atlaskit/eslint-utils/is-supported-import';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
2
|
-
|
|
3
1
|
import { createNoExportedRule } from '@atlaskit/eslint-utils/create-no-exported-rule';
|
|
4
2
|
import { isCss, isCssMap, isKeyframes, isStyled, isXcss } from '@atlaskit/eslint-utils/is-supported-import';
|
|
5
3
|
import { createLintRule } from '../utils/create-rule';
|
|
@@ -38,7 +38,7 @@ export const rule = createLintRule({
|
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
for (const importName of restrictedImports[importSource]) {
|
|
41
|
-
const specifier = node.specifiers.filter(isImportSpecifier).find(specifier => specifier.imported.name === importName);
|
|
41
|
+
const specifier = node.specifiers.filter(isImportSpecifier).find(specifier => 'name' in specifier.imported && specifier.imported.name === importName);
|
|
42
42
|
if (specifier) {
|
|
43
43
|
context.report({
|
|
44
44
|
node: specifier,
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
4
|
-
|
|
5
1
|
import esquery from 'esquery';
|
|
6
2
|
import estraverse from 'estraverse';
|
|
7
3
|
import { getAllowedDynamicKeys, getAllowedFunctionCalls, isAllowListedVariable } from '@atlaskit/eslint-utils/allowed-function-calls';
|
|
@@ -12,7 +12,7 @@ export function walkCssMap({
|
|
|
12
12
|
}) {
|
|
13
13
|
const program = getSourceCode(context).ast;
|
|
14
14
|
const importDeclaration = program.body.find(node => node.type === 'ImportDeclaration' && importSources.includes(node.source.value));
|
|
15
|
-
const specifier = importDeclaration === null || importDeclaration === void 0 ? void 0 : importDeclaration.specifiers.find(specifier => specifier.type === 'ImportSpecifier' && specifier.imported.name === 'cssMap');
|
|
15
|
+
const specifier = importDeclaration === null || importDeclaration === void 0 ? void 0 : importDeclaration.specifiers.find(specifier => specifier.type === 'ImportSpecifier' && 'name' in specifier.imported && specifier.imported.name === 'cssMap');
|
|
16
16
|
if (!specifier) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @atlassian/tangerine/import/entry-points */
|
|
2
|
-
|
|
3
1
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
4
2
|
import { getImportSources, isCss, isCssMap, isKeyframes, isStyled, isXcss } from '@atlaskit/eslint-utils/is-supported-import';
|
|
5
3
|
import { createLintRule } from '../utils/create-rule';
|
|
@@ -249,6 +249,7 @@ export class Linter {
|
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
if (value.type === 'BinaryExpression') {
|
|
252
|
+
// @ts-ignore -- this needs to be `ts-ignore` because this only errors in jira's typechecking due to update, not platform's
|
|
252
253
|
this.lintValue(value.left);
|
|
253
254
|
this.lintValue(value.right);
|
|
254
255
|
return;
|
|
@@ -39,12 +39,12 @@ export const rule = createLintRule({
|
|
|
39
39
|
type: 'problem',
|
|
40
40
|
fixable: 'code',
|
|
41
41
|
docs: {
|
|
42
|
-
description: 'Ensures usage of `@compiled/react` instead of other CSS-in-JS libraries',
|
|
42
|
+
description: 'Ensures usage of `@compiled/react` or `@atlaskit/css` instead of other CSS-in-JS libraries',
|
|
43
43
|
recommended: true,
|
|
44
44
|
severity: 'error'
|
|
45
45
|
},
|
|
46
46
|
messages: {
|
|
47
|
-
'use-compiled': `Use '@compiled/react' instead of '{{importSource}}'`
|
|
47
|
+
'use-compiled': `Use '@atlaskit/css' or '@compiled/react' instead of '{{importSource}}'`
|
|
48
48
|
},
|
|
49
49
|
schema
|
|
50
50
|
},
|
|
@@ -77,7 +77,8 @@ export const rule = createLintRule({
|
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
yield fixer.replaceText(
|
|
80
|
-
//
|
|
80
|
+
// TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
|
|
81
|
+
// @ts-ignore - types don't accept comment nodes
|
|
81
82
|
pragma, `/** @jsxImportSource @compiled/react */`);
|
|
82
83
|
}
|
|
83
84
|
});
|
|
@@ -176,6 +177,7 @@ function* fixImport({
|
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
function buildImportDeclaration(specifiers, source) {
|
|
180
|
+
// @ts-ignore - this needs to be `ts-ignore` because this only errors in jira's typechecking due to update, not platform's
|
|
179
181
|
return `${importDeclaration({
|
|
180
182
|
specifiers,
|
|
181
183
|
source: literal(source)
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
2
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
3
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
5
|
-
|
|
6
4
|
import { getScope, getSourceCode } from '@atlaskit/eslint-utils/context-compat';
|
|
7
5
|
import { getImportSources, hasStyleObjectArguments } from '@atlaskit/eslint-utils/is-supported-import';
|
|
8
6
|
import { createLintRule } from '../utils/create-rule';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @atlassian/tangerine/import/entry-points */
|
|
2
|
-
|
|
3
1
|
import estraverse from 'estraverse';
|
|
4
2
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
5
3
|
import { getImportSources, isCss, isCssMap, isKeyframes, isStyled, isXcss } from '@atlaskit/eslint-utils/is-supported-import';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
2
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
3
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
5
4
|
import esquery from 'esquery';
|
|
6
5
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
7
6
|
import { getImportSources, hasStyleObjectArguments } from '@atlaskit/eslint-utils/is-supported-import';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
2
|
-
|
|
3
1
|
import { createNoExportedRule } from '@atlaskit/eslint-utils/create-no-exported-rule';
|
|
4
2
|
import { isCss, isCssMap, isKeyframes, isStyled, isXcss } from '@atlaskit/eslint-utils/is-supported-import';
|
|
5
3
|
import { createLintRule } from '../utils/create-rule';
|
|
@@ -48,7 +48,7 @@ export var rule = createLintRule({
|
|
|
48
48
|
var _loop = function _loop() {
|
|
49
49
|
var importName = _step.value;
|
|
50
50
|
var specifier = node.specifiers.filter(isImportSpecifier).find(function (specifier) {
|
|
51
|
-
return specifier.imported.name === importName;
|
|
51
|
+
return 'name' in specifier.imported && specifier.imported.name === importName;
|
|
52
52
|
});
|
|
53
53
|
if (specifier) {
|
|
54
54
|
context.report({
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
2
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
3
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
7
|
-
|
|
8
4
|
import esquery from 'esquery';
|
|
9
5
|
import estraverse from 'estraverse';
|
|
10
6
|
import { getAllowedDynamicKeys, getAllowedFunctionCalls, isAllowListedVariable } from '@atlaskit/eslint-utils/allowed-function-calls';
|
|
@@ -15,7 +15,7 @@ export function walkCssMap(_ref) {
|
|
|
15
15
|
return node.type === 'ImportDeclaration' && importSources.includes(node.source.value);
|
|
16
16
|
});
|
|
17
17
|
var specifier = importDeclaration === null || importDeclaration === void 0 ? void 0 : importDeclaration.specifiers.find(function (specifier) {
|
|
18
|
-
return specifier.type === 'ImportSpecifier' && specifier.imported.name === 'cssMap';
|
|
18
|
+
return specifier.type === 'ImportSpecifier' && 'name' in specifier.imported && specifier.imported.name === 'cssMap';
|
|
19
19
|
});
|
|
20
20
|
if (!specifier) {
|
|
21
21
|
return;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @atlassian/tangerine/import/entry-points */
|
|
2
|
-
|
|
3
1
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
4
2
|
import { getImportSources, isCss, isCssMap, isKeyframes, isStyled, isXcss } from '@atlaskit/eslint-utils/is-supported-import';
|
|
5
3
|
import { createLintRule } from '../utils/create-rule';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9,
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0;
|
|
3
3
|
import outdent from 'outdent';
|
|
4
4
|
var whereToGetHelp = "If you think this should be allowed, or if you're running into issues, reach out in #help-ui-styling-standard";
|
|
5
5
|
export var messages = {
|
|
@@ -13,5 +13,5 @@ export var messages = {
|
|
|
13
13
|
'no-spread-elements': outdent(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n Spread elements are not allowed in style objects.\n\n Compose styles with the css prop instead.\n\n ", "\n "])), whereToGetHelp),
|
|
14
14
|
// Fallback case if a more specific message is not applicable
|
|
15
15
|
'no-unsafe-values': outdent(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n Unsafe values are not allowed in style objects.\n\n ", "\n "])), whereToGetHelp),
|
|
16
|
-
'no-variables': outdent(
|
|
16
|
+
'no-variables': outdent(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["\n Variables are not allowed in style objects, unless they:\n\n - Have a simple, static value.\n - Are defined in the same file.\n\n Use the style prop to apply dynamic values instead.\n\n ", "\n "])), whereToGetHelp)
|
|
17
17
|
};
|
|
@@ -303,6 +303,7 @@ export var Linter = /*#__PURE__*/function () {
|
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
305
|
if (value.type === 'BinaryExpression') {
|
|
306
|
+
// @ts-ignore -- this needs to be `ts-ignore` because this only errors in jira's typechecking due to update, not platform's
|
|
306
307
|
this.lintValue(value.left);
|
|
307
308
|
this.lintValue(value.right);
|
|
308
309
|
return;
|
|
@@ -44,12 +44,12 @@ export var rule = createLintRule({
|
|
|
44
44
|
type: 'problem',
|
|
45
45
|
fixable: 'code',
|
|
46
46
|
docs: {
|
|
47
|
-
description: 'Ensures usage of `@compiled/react` instead of other CSS-in-JS libraries',
|
|
47
|
+
description: 'Ensures usage of `@compiled/react` or `@atlaskit/css` instead of other CSS-in-JS libraries',
|
|
48
48
|
recommended: true,
|
|
49
49
|
severity: 'error'
|
|
50
50
|
},
|
|
51
51
|
messages: {
|
|
52
|
-
'use-compiled': "Use '@compiled/react' instead of '{{importSource}}'"
|
|
52
|
+
'use-compiled': "Use '@atlaskit/css' or '@compiled/react' instead of '{{importSource}}'"
|
|
53
53
|
},
|
|
54
54
|
schema: schema
|
|
55
55
|
},
|
|
@@ -98,7 +98,8 @@ export var rule = createLintRule({
|
|
|
98
98
|
case 7:
|
|
99
99
|
_context.next = 9;
|
|
100
100
|
return fixer.replaceText(
|
|
101
|
-
//
|
|
101
|
+
// TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
|
|
102
|
+
// @ts-ignore - types don't accept comment nodes
|
|
102
103
|
pragma, "/** @jsxImportSource @compiled/react */");
|
|
103
104
|
case 9:
|
|
104
105
|
case "end":
|
|
@@ -236,6 +237,7 @@ function fixImport(_ref4) {
|
|
|
236
237
|
})();
|
|
237
238
|
}
|
|
238
239
|
function buildImportDeclaration(specifiers, source) {
|
|
240
|
+
// @ts-ignore - this needs to be `ts-ignore` because this only errors in jira's typechecking due to update, not platform's
|
|
239
241
|
return "".concat(importDeclaration({
|
|
240
242
|
specifiers: specifiers,
|
|
241
243
|
source: literal(source)
|
|
@@ -5,6 +5,9 @@ export function isSafeUsage(_ref) {
|
|
|
5
5
|
var context = _ref.context,
|
|
6
6
|
specifier = _ref.specifier,
|
|
7
7
|
supportedImports = _ref.supportedImports;
|
|
8
|
+
if (!('name' in specifier.imported)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
8
11
|
var importName = specifier.imported.name;
|
|
9
12
|
if (!supportedImports.has(importName)) {
|
|
10
13
|
return false;
|