@atlaskit/eslint-plugin-ui-styling-standard 2.1.4 → 2.1.6

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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/eslint-plugin-ui-styling-standard
2
2
 
3
+ ## 2.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`eac2b82a415cd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eac2b82a415cd) -
8
+ Allow statically written style keys annotated with TypeScript `satisfies` expressions.
9
+ `no-unsafe-values` no longer reports a computed key that unwraps to a string literal, and
10
+ `no-imported-style-values` no longer reports imported identifiers used in type positions.
11
+
12
+ ## 2.1.5
13
+
14
+ ### Patch Changes
15
+
16
+ - [`fdedfb06aa229`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fdedfb06aa229) -
17
+ Allow canonical typed media queries and typed container-query exceptions in styling lint rules.
18
+ - Updated dependencies
19
+
3
20
  ## 2.1.4
4
21
 
5
22
  ### Patch Changes
@@ -21,6 +21,60 @@ var schema = [{
21
21
  }
22
22
  }
23
23
  }];
24
+ var unwrapTypeScriptExpression = function unwrapTypeScriptExpression(node) {
25
+ var expression = node;
26
+ while (expression.type === 'TSAsExpression' || expression.type === 'TSTypeAssertion' || expression.type === 'TSNonNullExpression' || expression.type === 'TSSatisfiesExpression') {
27
+ expression = expression.expression;
28
+ }
29
+ return expression;
30
+ };
31
+ var isStaticContainerKey = function isStaticContainerKey(node) {
32
+ var _expression$expressio;
33
+ var expression = unwrapTypeScriptExpression(node);
34
+ if (expression.type === 'Literal') {
35
+ return typeof expression.value === 'string';
36
+ }
37
+ return expression.type === 'TemplateLiteral' && ((_expression$expressio = expression.expressions) === null || _expression$expressio === void 0 ? void 0 : _expression$expressio.length) === 0;
38
+ };
39
+ var isImportedContainerType = function isImportedContainerType(node, context) {
40
+ var expression = node;
41
+ var _loop = function _loop() {
42
+ var _typeAnnotation$typeN;
43
+ var _expression = expression,
44
+ typeAnnotation = _expression.typeAnnotation;
45
+ if ((typeAnnotation === null || typeAnnotation === void 0 ? void 0 : typeAnnotation.type) === 'TSTypeReference' && ((_typeAnnotation$typeN = typeAnnotation.typeName) === null || _typeAnnotation$typeN === void 0 ? void 0 : _typeAnnotation$typeN.type) === 'Identifier') {
46
+ var typeName = typeAnnotation.typeName.name;
47
+ var isImported = (0, _contextCompat.getSourceCode)(context).ast.body.some(function (statement) {
48
+ return statement.type === 'ImportDeclaration' && statement.source.value === '@atlaskit/css/at-rules/container' && statement.specifiers.some(function (specifier) {
49
+ return specifier.type === 'ImportDefaultSpecifier' && specifier.local.name === typeName;
50
+ });
51
+ });
52
+ if (isImported) {
53
+ return {
54
+ v: true
55
+ };
56
+ }
57
+ }
58
+ expression = expression.expression;
59
+ },
60
+ _ret;
61
+ while (expression.type === 'TSSatisfiesExpression') {
62
+ _ret = _loop();
63
+ if (_ret) return _ret.v;
64
+ }
65
+ return false;
66
+ };
67
+ var isContainerQuery = function isContainerQuery(node) {
68
+ var _expression$quasis;
69
+ var expression = unwrapTypeScriptExpression(node);
70
+ if (expression.type === 'Literal' && typeof expression.value === 'string') {
71
+ return expression.value.includes('@container');
72
+ }
73
+ return expression.type === 'TemplateLiteral' && Boolean((_expression$quasis = expression.quasis) === null || _expression$quasis === void 0 ? void 0 : _expression$quasis.some(function (quasi) {
74
+ var _quasi$value;
75
+ return (_quasi$value = quasi.value) === null || _quasi$value === void 0 || (_quasi$value = _quasi$value.raw) === null || _quasi$value === void 0 ? void 0 : _quasi$value.includes('@container');
76
+ }));
77
+ };
24
78
  var rule = (0, _createRule.createLintRule)({
25
79
  meta: {
26
80
  name: 'no-container-queries',
@@ -44,25 +98,20 @@ var rule = (0, _createRule.createLintRule)({
44
98
  if ((0, _isSupportedImport.isCss)(node.callee, references, importSources) || (0, _isSupportedImport.isStyled)(node.callee, references, importSources) || (0, _isSupportedImport.isKeyframes)(node.callee, references, importSources) || (0, _isSupportedImport.isCssMap)(node.callee, references, importSources) || (0, _isSupportedImport.isXcss)(node.callee, references, importSources)) {
45
99
  _estraverse.default.traverse(node, {
46
100
  enter: function enter(node) {
47
- var _node$key$value, _node$key$quasis$;
48
101
  if (node.type !== 'Property') {
49
102
  return;
50
103
  }
51
- if (node.key.type !== 'Literal' && node.key.type !== 'TemplateLiteral') {
104
+ var key = node.key;
105
+ if (!isContainerQuery(key)) {
52
106
  return;
53
107
  }
54
- if (node.key.type === 'Literal' && (_node$key$value = node.key.value) !== null && _node$key$value !== void 0 && _node$key$value.toString().match(/@container/)) {
55
- context.report({
56
- node: node.key,
57
- messageId: 'no-container-queries'
58
- });
59
- }
60
- if (node.key.type === 'TemplateLiteral' && (_node$key$quasis$ = node.key.quasis[0]) !== null && _node$key$quasis$ !== void 0 && _node$key$quasis$.value.raw.match(/@container/)) {
61
- context.report({
62
- node: node.key,
63
- messageId: 'no-container-queries'
64
- });
108
+ if (isImportedContainerType(key, context) && isStaticContainerKey(key.expression)) {
109
+ return;
65
110
  }
111
+ context.report({
112
+ node: node.key,
113
+ messageId: 'no-container-queries'
114
+ });
66
115
  },
67
116
  /**
68
117
  * This is needed to handle unknown node types. Otherwise an error is thrown.
@@ -80,6 +80,13 @@ var checkIdentifier = function checkIdentifier(identifier, context, functionAllo
80
80
  var _ref = identifier,
81
81
  parent = _ref.parent;
82
82
 
83
+ // Type references and `typeof` queries are erased at runtime and are not
84
+ // imported style values. Runtime expressions wrapped by `as` or `satisfies`
85
+ // must still be checked.
86
+ if (parent && (parent.type === 'TSTypeReference' || parent.type === 'TSTypeQuery')) {
87
+ return;
88
+ }
89
+
83
90
  // Even though `member` in `object.member` is syntactically an identifier,
84
91
  // it should be ignored as `.member` is syntax sugar for `['member']` here.
85
92
  // We should still lint `object[member]` (when `parent.computed` === true)
@@ -13,6 +13,13 @@ var _findVariable = require("@atlaskit/eslint-utils/find-variable");
13
13
  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; } } }; }
14
14
  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; } }
15
15
  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; }
16
+ var unwrapSatisfiesExpression = function unwrapSatisfiesExpression(node) {
17
+ var currentNode = node;
18
+ while (currentNode.type === 'TSSatisfiesExpression') {
19
+ currentNode = currentNode.expression;
20
+ }
21
+ return currentNode;
22
+ };
16
23
  function isReferenceToCssVar(variable) {
17
24
  var definitions = variable.defs;
18
25
  return definitions.every(function (definition) {
@@ -189,6 +196,16 @@ var Linter = exports.Linter = /*#__PURE__*/function () {
189
196
  }, {
190
197
  key: "lintKey",
191
198
  value: function lintKey(property) {
199
+ var key = property.key;
200
+
201
+ // A type-only `satisfies` annotation preserves a static key at runtime.
202
+ // It is safe for the same reason as a directly written string literal.
203
+ var unwrappedKey = unwrapSatisfiesExpression(key);
204
+ var isSatisfiesExpression = unwrappedKey !== key;
205
+ if (property.computed && isSatisfiesExpression && unwrappedKey.type === 'Literal' && typeof unwrappedKey.value === 'string') {
206
+ return;
207
+ }
208
+
192
209
  /**
193
210
  * If it's not computed then it must be a plain string.
194
211
  *
@@ -1,5 +1,5 @@
1
1
  import estraverse from 'estraverse';
2
- import { getScope } from '@atlaskit/eslint-utils/context-compat';
2
+ import { getScope, getSourceCode } from '@atlaskit/eslint-utils/context-compat';
3
3
  import { getImportSources, isCss, isCssMap, isKeyframes, isStyled, isXcss } from '@atlaskit/eslint-utils/is-supported-import';
4
4
  import { createLintRule } from '../utils/create-rule';
5
5
  const schema = [{
@@ -14,6 +14,50 @@ const schema = [{
14
14
  }
15
15
  }
16
16
  }];
17
+ const unwrapTypeScriptExpression = node => {
18
+ let expression = node;
19
+ while (expression.type === 'TSAsExpression' || expression.type === 'TSTypeAssertion' || expression.type === 'TSNonNullExpression' || expression.type === 'TSSatisfiesExpression') {
20
+ expression = expression.expression;
21
+ }
22
+ return expression;
23
+ };
24
+ const isStaticContainerKey = node => {
25
+ var _expression$expressio;
26
+ const expression = unwrapTypeScriptExpression(node);
27
+ if (expression.type === 'Literal') {
28
+ return typeof expression.value === 'string';
29
+ }
30
+ return expression.type === 'TemplateLiteral' && ((_expression$expressio = expression.expressions) === null || _expression$expressio === void 0 ? void 0 : _expression$expressio.length) === 0;
31
+ };
32
+ const isImportedContainerType = (node, context) => {
33
+ let expression = node;
34
+ while (expression.type === 'TSSatisfiesExpression') {
35
+ var _typeAnnotation$typeN;
36
+ const {
37
+ typeAnnotation
38
+ } = expression;
39
+ if ((typeAnnotation === null || typeAnnotation === void 0 ? void 0 : typeAnnotation.type) === 'TSTypeReference' && ((_typeAnnotation$typeN = typeAnnotation.typeName) === null || _typeAnnotation$typeN === void 0 ? void 0 : _typeAnnotation$typeN.type) === 'Identifier') {
40
+ const typeName = typeAnnotation.typeName.name;
41
+ const isImported = getSourceCode(context).ast.body.some(statement => statement.type === 'ImportDeclaration' && statement.source.value === '@atlaskit/css/at-rules/container' && statement.specifiers.some(specifier => specifier.type === 'ImportDefaultSpecifier' && specifier.local.name === typeName));
42
+ if (isImported) {
43
+ return true;
44
+ }
45
+ }
46
+ expression = expression.expression;
47
+ }
48
+ return false;
49
+ };
50
+ const isContainerQuery = node => {
51
+ var _expression$quasis;
52
+ const expression = unwrapTypeScriptExpression(node);
53
+ if (expression.type === 'Literal' && typeof expression.value === 'string') {
54
+ return expression.value.includes('@container');
55
+ }
56
+ return expression.type === 'TemplateLiteral' && Boolean((_expression$quasis = expression.quasis) === null || _expression$quasis === void 0 ? void 0 : _expression$quasis.some(quasi => {
57
+ var _quasi$value, _quasi$value$raw;
58
+ return (_quasi$value = quasi.value) === null || _quasi$value === void 0 ? void 0 : (_quasi$value$raw = _quasi$value.raw) === null || _quasi$value$raw === void 0 ? void 0 : _quasi$value$raw.includes('@container');
59
+ }));
60
+ };
17
61
  const rule = createLintRule({
18
62
  meta: {
19
63
  name: 'no-container-queries',
@@ -38,25 +82,20 @@ const rule = createLintRule({
38
82
  if (isCss(node.callee, references, importSources) || isStyled(node.callee, references, importSources) || isKeyframes(node.callee, references, importSources) || isCssMap(node.callee, references, importSources) || isXcss(node.callee, references, importSources)) {
39
83
  estraverse.traverse(node, {
40
84
  enter(node) {
41
- var _node$key$value, _node$key$quasis$;
42
85
  if (node.type !== 'Property') {
43
86
  return;
44
87
  }
45
- if (node.key.type !== 'Literal' && node.key.type !== 'TemplateLiteral') {
88
+ const key = node.key;
89
+ if (!isContainerQuery(key)) {
46
90
  return;
47
91
  }
48
- if (node.key.type === 'Literal' && (_node$key$value = node.key.value) !== null && _node$key$value !== void 0 && _node$key$value.toString().match(/@container/)) {
49
- context.report({
50
- node: node.key,
51
- messageId: 'no-container-queries'
52
- });
53
- }
54
- if (node.key.type === 'TemplateLiteral' && (_node$key$quasis$ = node.key.quasis[0]) !== null && _node$key$quasis$ !== void 0 && _node$key$quasis$.value.raw.match(/@container/)) {
55
- context.report({
56
- node: node.key,
57
- messageId: 'no-container-queries'
58
- });
92
+ if (isImportedContainerType(key, context) && isStaticContainerKey(key.expression)) {
93
+ return;
59
94
  }
95
+ context.report({
96
+ node: node.key,
97
+ messageId: 'no-container-queries'
98
+ });
60
99
  },
61
100
  /**
62
101
  * This is needed to handle unknown node types. Otherwise an error is thrown.
@@ -69,6 +69,13 @@ const checkIdentifier = (identifier, context, functionAllowList, keysAllowList)
69
69
  parent
70
70
  } = identifier;
71
71
 
72
+ // Type references and `typeof` queries are erased at runtime and are not
73
+ // imported style values. Runtime expressions wrapped by `as` or `satisfies`
74
+ // must still be checked.
75
+ if (parent && (parent.type === 'TSTypeReference' || parent.type === 'TSTypeQuery')) {
76
+ return;
77
+ }
78
+
72
79
  // Even though `member` in `object.member` is syntactically an identifier,
73
80
  // it should be ignored as `.member` is syntax sugar for `['member']` here.
74
81
  // We should still lint `object[member]` (when `parent.computed` === true)
@@ -1,6 +1,13 @@
1
1
  import { getAllowedDynamicKeys, getAllowedFunctionCalls, isAllowListedVariable } from '@atlaskit/eslint-utils/allowed-function-calls';
2
2
  import { findIdentifierNode } from '@atlaskit/eslint-utils/find-identifier-node';
3
3
  import { findVariable } from '@atlaskit/eslint-utils/find-variable';
4
+ const unwrapSatisfiesExpression = node => {
5
+ let currentNode = node;
6
+ while (currentNode.type === 'TSSatisfiesExpression') {
7
+ currentNode = currentNode.expression;
8
+ }
9
+ return currentNode;
10
+ };
4
11
  function isReferenceToCssVar(variable) {
5
12
  const definitions = variable.defs;
6
13
  return definitions.every(definition => {
@@ -156,6 +163,16 @@ export class Linter {
156
163
  });
157
164
  }
158
165
  lintKey(property) {
166
+ const key = property.key;
167
+
168
+ // A type-only `satisfies` annotation preserves a static key at runtime.
169
+ // It is safe for the same reason as a directly written string literal.
170
+ const unwrappedKey = unwrapSatisfiesExpression(key);
171
+ const isSatisfiesExpression = unwrappedKey !== key;
172
+ if (property.computed && isSatisfiesExpression && unwrappedKey.type === 'Literal' && typeof unwrappedKey.value === 'string') {
173
+ return;
174
+ }
175
+
159
176
  /**
160
177
  * If it's not computed then it must be a plain string.
161
178
  *
@@ -1,5 +1,5 @@
1
1
  import estraverse from 'estraverse';
2
- import { getScope } from '@atlaskit/eslint-utils/context-compat';
2
+ import { getScope, getSourceCode } from '@atlaskit/eslint-utils/context-compat';
3
3
  import { getImportSources, isCss, isCssMap, isKeyframes, isStyled, isXcss } from '@atlaskit/eslint-utils/is-supported-import';
4
4
  import { createLintRule } from '../utils/create-rule';
5
5
  var schema = [{
@@ -14,6 +14,60 @@ var schema = [{
14
14
  }
15
15
  }
16
16
  }];
17
+ var unwrapTypeScriptExpression = function unwrapTypeScriptExpression(node) {
18
+ var expression = node;
19
+ while (expression.type === 'TSAsExpression' || expression.type === 'TSTypeAssertion' || expression.type === 'TSNonNullExpression' || expression.type === 'TSSatisfiesExpression') {
20
+ expression = expression.expression;
21
+ }
22
+ return expression;
23
+ };
24
+ var isStaticContainerKey = function isStaticContainerKey(node) {
25
+ var _expression$expressio;
26
+ var expression = unwrapTypeScriptExpression(node);
27
+ if (expression.type === 'Literal') {
28
+ return typeof expression.value === 'string';
29
+ }
30
+ return expression.type === 'TemplateLiteral' && ((_expression$expressio = expression.expressions) === null || _expression$expressio === void 0 ? void 0 : _expression$expressio.length) === 0;
31
+ };
32
+ var isImportedContainerType = function isImportedContainerType(node, context) {
33
+ var expression = node;
34
+ var _loop = function _loop() {
35
+ var _typeAnnotation$typeN;
36
+ var _expression = expression,
37
+ typeAnnotation = _expression.typeAnnotation;
38
+ if ((typeAnnotation === null || typeAnnotation === void 0 ? void 0 : typeAnnotation.type) === 'TSTypeReference' && ((_typeAnnotation$typeN = typeAnnotation.typeName) === null || _typeAnnotation$typeN === void 0 ? void 0 : _typeAnnotation$typeN.type) === 'Identifier') {
39
+ var typeName = typeAnnotation.typeName.name;
40
+ var isImported = getSourceCode(context).ast.body.some(function (statement) {
41
+ return statement.type === 'ImportDeclaration' && statement.source.value === '@atlaskit/css/at-rules/container' && statement.specifiers.some(function (specifier) {
42
+ return specifier.type === 'ImportDefaultSpecifier' && specifier.local.name === typeName;
43
+ });
44
+ });
45
+ if (isImported) {
46
+ return {
47
+ v: true
48
+ };
49
+ }
50
+ }
51
+ expression = expression.expression;
52
+ },
53
+ _ret;
54
+ while (expression.type === 'TSSatisfiesExpression') {
55
+ _ret = _loop();
56
+ if (_ret) return _ret.v;
57
+ }
58
+ return false;
59
+ };
60
+ var isContainerQuery = function isContainerQuery(node) {
61
+ var _expression$quasis;
62
+ var expression = unwrapTypeScriptExpression(node);
63
+ if (expression.type === 'Literal' && typeof expression.value === 'string') {
64
+ return expression.value.includes('@container');
65
+ }
66
+ return expression.type === 'TemplateLiteral' && Boolean((_expression$quasis = expression.quasis) === null || _expression$quasis === void 0 ? void 0 : _expression$quasis.some(function (quasi) {
67
+ var _quasi$value;
68
+ return (_quasi$value = quasi.value) === null || _quasi$value === void 0 || (_quasi$value = _quasi$value.raw) === null || _quasi$value === void 0 ? void 0 : _quasi$value.includes('@container');
69
+ }));
70
+ };
17
71
  var rule = createLintRule({
18
72
  meta: {
19
73
  name: 'no-container-queries',
@@ -37,25 +91,20 @@ var rule = createLintRule({
37
91
  if (isCss(node.callee, references, importSources) || isStyled(node.callee, references, importSources) || isKeyframes(node.callee, references, importSources) || isCssMap(node.callee, references, importSources) || isXcss(node.callee, references, importSources)) {
38
92
  estraverse.traverse(node, {
39
93
  enter: function enter(node) {
40
- var _node$key$value, _node$key$quasis$;
41
94
  if (node.type !== 'Property') {
42
95
  return;
43
96
  }
44
- if (node.key.type !== 'Literal' && node.key.type !== 'TemplateLiteral') {
97
+ var key = node.key;
98
+ if (!isContainerQuery(key)) {
45
99
  return;
46
100
  }
47
- if (node.key.type === 'Literal' && (_node$key$value = node.key.value) !== null && _node$key$value !== void 0 && _node$key$value.toString().match(/@container/)) {
48
- context.report({
49
- node: node.key,
50
- messageId: 'no-container-queries'
51
- });
52
- }
53
- if (node.key.type === 'TemplateLiteral' && (_node$key$quasis$ = node.key.quasis[0]) !== null && _node$key$quasis$ !== void 0 && _node$key$quasis$.value.raw.match(/@container/)) {
54
- context.report({
55
- node: node.key,
56
- messageId: 'no-container-queries'
57
- });
101
+ if (isImportedContainerType(key, context) && isStaticContainerKey(key.expression)) {
102
+ return;
58
103
  }
104
+ context.report({
105
+ node: node.key,
106
+ messageId: 'no-container-queries'
107
+ });
59
108
  },
60
109
  /**
61
110
  * This is needed to handle unknown node types. Otherwise an error is thrown.
@@ -73,6 +73,13 @@ var checkIdentifier = function checkIdentifier(identifier, context, functionAllo
73
73
  var _ref = identifier,
74
74
  parent = _ref.parent;
75
75
 
76
+ // Type references and `typeof` queries are erased at runtime and are not
77
+ // imported style values. Runtime expressions wrapped by `as` or `satisfies`
78
+ // must still be checked.
79
+ if (parent && (parent.type === 'TSTypeReference' || parent.type === 'TSTypeQuery')) {
80
+ return;
81
+ }
82
+
76
83
  // Even though `member` in `object.member` is syntactically an identifier,
77
84
  // it should be ignored as `.member` is syntax sugar for `['member']` here.
78
85
  // We should still lint `object[member]` (when `parent.computed` === true)
@@ -6,6 +6,13 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
6
6
  import { getAllowedDynamicKeys, getAllowedFunctionCalls, isAllowListedVariable } from '@atlaskit/eslint-utils/allowed-function-calls';
7
7
  import { findIdentifierNode } from '@atlaskit/eslint-utils/find-identifier-node';
8
8
  import { findVariable } from '@atlaskit/eslint-utils/find-variable';
9
+ var unwrapSatisfiesExpression = function unwrapSatisfiesExpression(node) {
10
+ var currentNode = node;
11
+ while (currentNode.type === 'TSSatisfiesExpression') {
12
+ currentNode = currentNode.expression;
13
+ }
14
+ return currentNode;
15
+ };
9
16
  function isReferenceToCssVar(variable) {
10
17
  var definitions = variable.defs;
11
18
  return definitions.every(function (definition) {
@@ -182,6 +189,16 @@ export var Linter = /*#__PURE__*/function () {
182
189
  }, {
183
190
  key: "lintKey",
184
191
  value: function lintKey(property) {
192
+ var key = property.key;
193
+
194
+ // A type-only `satisfies` annotation preserves a static key at runtime.
195
+ // It is safe for the same reason as a directly written string literal.
196
+ var unwrappedKey = unwrapSatisfiesExpression(key);
197
+ var isSatisfiesExpression = unwrappedKey !== key;
198
+ if (property.computed && isSatisfiesExpression && unwrappedKey.type === 'Literal' && typeof unwrappedKey.value === 'string') {
199
+ return;
200
+ }
201
+
185
202
  /**
186
203
  * If it's not computed then it must be a plain string.
187
204
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-ui-styling-standard",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
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",
@@ -28,10 +28,10 @@
28
28
  ],
29
29
  "atlaskit:src": "src/index.tsx",
30
30
  "dependencies": {
31
- "@atlaskit/eslint-plugin-design-system": "^16.11.0",
31
+ "@atlaskit/eslint-plugin-design-system": "^16.12.0",
32
32
  "@atlaskit/eslint-utils": "^3.1.0",
33
33
  "@babel/runtime": "^7.0.0",
34
- "@typescript-eslint/utils": "^7.1.0",
34
+ "@typescript-eslint/utils": "^8.64.0",
35
35
  "ajv": "^6.12.6",
36
36
  "eslint-codemod-utils": "^1.8.6",
37
37
  "eslint-scope": "^8.0.0",
@@ -44,7 +44,7 @@
44
44
  "devDependencies": {
45
45
  "@af/formatting": "workspace:^",
46
46
  "@atlaskit/ds-lib": "^8.0.0",
47
- "@atlassian/codegen": "^0.2.0",
47
+ "@atlassian/codegen": "^0.3.0",
48
48
  "@atlassian/ts-loader": "^0.1.0",
49
49
  "@eslint/eslintrc": "^3.0.2",
50
50
  "@types/eslint": "^8.56.6",