@atlaskit/eslint-plugin-design-system 9.2.2 → 9.2.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/eslint-plugin-design-system
2
2
 
3
+ ## 9.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#86352](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86352) [`c32535ff8734`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c32535ff8734) - Fixed an issue where the `ensure-design-token-usage` rule (and by extension `ensure-design-token-usage/preview` rule) would report on color properties even if `"color"` was not provided in the domains config.
8
+
3
9
  ## 9.2.2
4
10
 
5
11
  ### Patch Changes
@@ -48,7 +48,10 @@ var createWithConfig = exports.createWithConfig = function createWithConfig(init
48
48
  // For expressions within template literals (e.g. `color: ${red}`) - color only
49
49
  'TemplateLiteral > Identifier': function TemplateLiteralIdentifier(node) {
50
50
  return (0, _errorBoundary.errorBoundary)(function () {
51
- return (0, _color.lintTemplateIdentifierForColor)(node, context, config);
51
+ if (config.domains.includes('color')) {
52
+ return (0, _color.lintTemplateIdentifierForColor)(node, context, config);
53
+ }
54
+ return;
52
55
  }, {
53
56
  config: config
54
57
  });
@@ -281,7 +284,10 @@ var createWithConfig = exports.createWithConfig = function createWithConfig(init
281
284
  // For inline JSX styles - literals (e.g. <Test color="red"/>) - color only
282
285
  'JSXAttribute > Literal': function JSXAttributeLiteral(node) {
283
286
  return (0, _errorBoundary.errorBoundary)(function () {
284
- return (0, _color.lintJSXLiteralForColor)(node, context, config);
287
+ if (config.domains.includes('color')) {
288
+ return (0, _color.lintJSXLiteralForColor)(node, context, config);
289
+ }
290
+ return;
285
291
  }, {
286
292
  config: config
287
293
  });
@@ -289,7 +295,10 @@ var createWithConfig = exports.createWithConfig = function createWithConfig(init
289
295
  // For inline JSX styles - members (e.g. <Test color={color.red}/>) - color only
290
296
  'JSXExpressionContainer > MemberExpression': function JSXExpressionContainerMemberExpression(node) {
291
297
  return (0, _errorBoundary.errorBoundary)(function () {
292
- return (0, _color.lintJSXMemberForColor)(node, context, config);
298
+ if (config.domains.includes('color')) {
299
+ return (0, _color.lintJSXMemberForColor)(node, context, config);
300
+ }
301
+ return;
293
302
  }, {
294
303
  config: config
295
304
  });
@@ -297,7 +306,10 @@ var createWithConfig = exports.createWithConfig = function createWithConfig(init
297
306
  // For inline JSX styles - identifiers (e.g. <Test color={red}/>) - color only
298
307
  'JSXExpressionContainer > Identifier': function JSXExpressionContainerIdentifier(node) {
299
308
  return (0, _errorBoundary.errorBoundary)(function () {
300
- return (0, _color.lintJSXIdentifierForColor)(node, context, config);
309
+ if (config.domains.includes('color')) {
310
+ return (0, _color.lintJSXIdentifierForColor)(node, context, config);
311
+ }
312
+ return;
301
313
  }, {
302
314
  config: config
303
315
  });
@@ -36,7 +36,10 @@ const createWithConfig = initialConfig => context => {
36
36
  }),
37
37
  // For expressions within template literals (e.g. `color: ${red}`) - color only
38
38
  'TemplateLiteral > Identifier': node => errorBoundary(() => {
39
- return lintTemplateIdentifierForColor(node, context, config);
39
+ if (config.domains.includes('color')) {
40
+ return lintTemplateIdentifierForColor(node, context, config);
41
+ }
42
+ return;
40
43
  }, {
41
44
  config
42
45
  }),
@@ -241,19 +244,28 @@ const createWithConfig = initialConfig => context => {
241
244
  }),
242
245
  // For inline JSX styles - literals (e.g. <Test color="red"/>) - color only
243
246
  'JSXAttribute > Literal': node => errorBoundary(() => {
244
- return lintJSXLiteralForColor(node, context, config);
247
+ if (config.domains.includes('color')) {
248
+ return lintJSXLiteralForColor(node, context, config);
249
+ }
250
+ return;
245
251
  }, {
246
252
  config
247
253
  }),
248
254
  // For inline JSX styles - members (e.g. <Test color={color.red}/>) - color only
249
255
  'JSXExpressionContainer > MemberExpression': node => errorBoundary(() => {
250
- return lintJSXMemberForColor(node, context, config);
256
+ if (config.domains.includes('color')) {
257
+ return lintJSXMemberForColor(node, context, config);
258
+ }
259
+ return;
251
260
  }, {
252
261
  config
253
262
  }),
254
263
  // For inline JSX styles - identifiers (e.g. <Test color={red}/>) - color only
255
264
  'JSXExpressionContainer > Identifier': node => errorBoundary(() => {
256
- return lintJSXIdentifierForColor(node, context, config);
265
+ if (config.domains.includes('color')) {
266
+ return lintJSXIdentifierForColor(node, context, config);
267
+ }
268
+ return;
257
269
  }, {
258
270
  config
259
271
  })
@@ -41,7 +41,10 @@ var createWithConfig = function createWithConfig(initialConfig) {
41
41
  // For expressions within template literals (e.g. `color: ${red}`) - color only
42
42
  'TemplateLiteral > Identifier': function TemplateLiteralIdentifier(node) {
43
43
  return errorBoundary(function () {
44
- return lintTemplateIdentifierForColor(node, context, config);
44
+ if (config.domains.includes('color')) {
45
+ return lintTemplateIdentifierForColor(node, context, config);
46
+ }
47
+ return;
45
48
  }, {
46
49
  config: config
47
50
  });
@@ -274,7 +277,10 @@ var createWithConfig = function createWithConfig(initialConfig) {
274
277
  // For inline JSX styles - literals (e.g. <Test color="red"/>) - color only
275
278
  'JSXAttribute > Literal': function JSXAttributeLiteral(node) {
276
279
  return errorBoundary(function () {
277
- return lintJSXLiteralForColor(node, context, config);
280
+ if (config.domains.includes('color')) {
281
+ return lintJSXLiteralForColor(node, context, config);
282
+ }
283
+ return;
278
284
  }, {
279
285
  config: config
280
286
  });
@@ -282,7 +288,10 @@ var createWithConfig = function createWithConfig(initialConfig) {
282
288
  // For inline JSX styles - members (e.g. <Test color={color.red}/>) - color only
283
289
  'JSXExpressionContainer > MemberExpression': function JSXExpressionContainerMemberExpression(node) {
284
290
  return errorBoundary(function () {
285
- return lintJSXMemberForColor(node, context, config);
291
+ if (config.domains.includes('color')) {
292
+ return lintJSXMemberForColor(node, context, config);
293
+ }
294
+ return;
286
295
  }, {
287
296
  config: config
288
297
  });
@@ -290,7 +299,10 @@ var createWithConfig = function createWithConfig(initialConfig) {
290
299
  // For inline JSX styles - identifiers (e.g. <Test color={red}/>) - color only
291
300
  'JSXExpressionContainer > Identifier': function JSXExpressionContainerIdentifier(node) {
292
301
  return errorBoundary(function () {
293
- return lintJSXIdentifierForColor(node, context, config);
302
+ if (config.domains.includes('color')) {
303
+ return lintJSXIdentifierForColor(node, context, config);
304
+ }
305
+ return;
294
306
  }, {
295
307
  config: config
296
308
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-design-system",
3
3
  "description": "The essential plugin for use with the Atlassian Design System.",
4
- "version": "9.2.2",
4
+ "version": "9.2.3",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {