@atlaskit/eslint-plugin-ui-styling-standard 1.4.2 → 1.4.3
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 +8 -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-imported-style-values/index.js +1 -2
- package/dist/cjs/rules/no-nested-selectors/index.js +1 -2
- 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/use-compiled/index.js +4 -3
- 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-imported-style-values/index.js +0 -4
- package/dist/es2019/rules/no-unsafe-values/index.js +0 -2
- package/dist/es2019/rules/use-compiled/index.js +4 -3
- 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-imported-style-values/index.js +0 -4
- 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/use-compiled/index.js +4 -3
- package/dist/types/rules/no-unsafe-values/utils.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-unsafe-values/utils.d.ts +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-ui-styling-standard
|
|
2
2
|
|
|
3
|
+
## 1.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#192710](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/192710)
|
|
8
|
+
[`b3b30f3bc4453`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b3b30f3bc4453) -
|
|
9
|
+
Internal changes to how border radius and border width values are applied. No visual change.
|
|
10
|
+
|
|
3
11
|
## 1.4.2
|
|
4
12
|
|
|
5
13
|
### 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: {
|
|
@@ -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;
|
|
@@ -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
|
};
|
|
@@ -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":
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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
|
});
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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
|
};
|
|
@@ -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":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-ui-styling-standard",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"author": "Atlassian Pty Ltd",
|
|
5
5
|
"description": "The eslint plugin to enforce and educate on Atlassian's UI Styling Standard",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"./package.json": "./package.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@atlaskit/eslint-plugin-design-system": "^13.
|
|
43
|
+
"@atlaskit/eslint-plugin-design-system": "^13.19.0",
|
|
44
44
|
"@atlaskit/eslint-utils": "^2.0.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@typescript-eslint/utils": "^7.1.0",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"postcss-selector-parser": "^6.0.16"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@af/formatting": "
|
|
58
|
-
"@atlaskit/ds-lib": "^
|
|
59
|
-
"@atlassian/codegen": "
|
|
60
|
-
"@atlassian/ts-loader": "
|
|
57
|
+
"@af/formatting": "workspace:^",
|
|
58
|
+
"@atlaskit/ds-lib": "^5.0.0",
|
|
59
|
+
"@atlassian/codegen": "^0.1.0",
|
|
60
|
+
"@atlassian/ts-loader": "^0.1.0",
|
|
61
61
|
"@eslint/eslintrc": "^3.0.2",
|
|
62
62
|
"@types/eslint": "^8.56.6",
|
|
63
63
|
"@types/eslint__eslintrc": "^2.1.2",
|