@dialpad/eslint-plugin-dialtone 1.9.0 → 1.10.0

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.
@@ -4,9 +4,9 @@
4
4
  */
5
5
  'use strict';
6
6
 
7
- //------------------------------------------------------------------------------
7
+ // ------------------------------------------------------------------------------
8
8
  // Rule Definition
9
- //------------------------------------------------------------------------------
9
+ // ------------------------------------------------------------------------------
10
10
 
11
11
  const description = 'Usage of base color utility classes are deprecated and will be removed in the future.';
12
12
 
@@ -21,10 +21,10 @@ module.exports = {
21
21
  fixable: null, // Or `code` or `whitespace`
22
22
  schema: [], // Add a schema if the rule has options
23
23
  messages: {
24
- recommendBackgroundSemanticColor: `${ description } Checkout the available replacements here: https://dialtone.dialpad.com/utilities/backgrounds/color.html`,
25
- recommendForegroundSemanticColor: `${ description } Checkout the available replacements here: https://dialtone.dialpad.com/utilities/typography/font-color.html`,
26
- recommendBorderSemanticColor: `${ description } Checkout the available replacements here: https://dialtone.dialpad.com/utilities/borders/color.html`,
27
- recommendDivideSemanticColor: `${ description } Checkout the available replacements here: https://dialtone.dialpad.com/utilities/borders/divide-color.html`,
24
+ recommendBackgroundSemanticColor: `${description} Checkout the available replacements here: https://dialtone.dialpad.com/utilities/backgrounds/color.html`,
25
+ recommendForegroundSemanticColor: `${description} Checkout the available replacements here: https://dialtone.dialpad.com/utilities/typography/font-color.html`,
26
+ recommendBorderSemanticColor: `${description} Checkout the available replacements here: https://dialtone.dialpad.com/utilities/borders/color.html`,
27
+ recommendDivideSemanticColor: `${description} Checkout the available replacements here: https://dialtone.dialpad.com/utilities/borders/divide-color.html`,
28
28
  }, // Add messageId and message
29
29
  },
30
30
 
@@ -36,13 +36,13 @@ module.exports = {
36
36
  if (node.key.name === 'class') {
37
37
  const classes = node.value.value;
38
38
  if (classes.match(/d-bgc-\w+-\d{2,4}/)) {
39
- context.report({ node: node, messageId: 'recommendBackgroundSemanticColor' });
39
+ context.report({ node, messageId: 'recommendBackgroundSemanticColor' });
40
40
  } else if (classes.match(/d-fc-\w+-\d{2,4}/)) {
41
- context.report({ node: node, messageId: 'recommendForegroundSemanticColor' });
41
+ context.report({ node, messageId: 'recommendForegroundSemanticColor' });
42
42
  } else if (classes.match(/d-bc-\w+-\d{2,4}/)) {
43
- context.report({ node: node, messageId: 'recommendBorderSemanticColor' });
43
+ context.report({ node, messageId: 'recommendBorderSemanticColor' });
44
44
  } else if (classes.match(/d-divide-\w+-\d{2,4}/)) {
45
- context.report({ node: node, messageId: 'recommendDivideSemanticColor' });
45
+ context.report({ node, messageId: 'recommendDivideSemanticColor' });
46
46
  }
47
47
  }
48
48
  },
@@ -4,9 +4,9 @@
4
4
  */
5
5
  'use strict';
6
6
 
7
- //------------------------------------------------------------------------------
7
+ // ------------------------------------------------------------------------------
8
8
  // Rule Definition
9
- //------------------------------------------------------------------------------
9
+ // ------------------------------------------------------------------------------
10
10
 
11
11
  module.exports = {
12
12
  meta: {
@@ -25,7 +25,7 @@ module.exports = {
25
25
  },
26
26
  },
27
27
 
28
- create(context) {
28
+ create (context) {
29
29
  const deprecatedDirectives = [
30
30
  {
31
31
  directiveName: 'tooltip',
@@ -36,11 +36,11 @@ module.exports = {
36
36
 
37
37
  const sourceCode = context.sourceCode ?? context.getSourceCode();
38
38
  return sourceCode.parserServices.defineTemplateBodyVisitor({
39
- VAttribute(node) {
39
+ VAttribute (node) {
40
40
  deprecatedDirectives.forEach((item) => {
41
41
  if (node.directive && node.key.name.name === item.directiveName) {
42
42
  context.report({
43
- node: node,
43
+ node,
44
44
  messageId: 'deprecatedDirective',
45
45
  data: {
46
46
  directiveName: item.directiveName,
@@ -2,17 +2,17 @@
2
2
  * @fileoverview Utilities to set Font family, Font weight, Font size, and Line height separately are discouraged in favor of composed typography utilities
3
3
  * @author Nina Repetto
4
4
  */
5
- "use strict";
5
+ 'use strict';
6
6
 
7
- //------------------------------------------------------------------------------
7
+ // ------------------------------------------------------------------------------
8
8
  // Rule Definition
9
- //------------------------------------------------------------------------------
9
+ // ------------------------------------------------------------------------------
10
10
 
11
11
  module.exports = {
12
12
  meta: {
13
13
  type: 'suggestion', // `problem`, `suggestion`, or `layout`
14
14
  docs: {
15
- description: "Utilities to set Font family, Font weight, Font size, and Line height separately are discouraged in favor of composed typography utilities",
15
+ description: 'Utilities to set Font family, Font weight, Font size, and Line height separately are discouraged in favor of composed typography utilities',
16
16
  recommended: false,
17
17
  url: 'https://github.com/dialpad/dialtone/blob/staging/packages/eslint-plugin-dialtone/docs/rules/recommend-typography-style.md', // URL to the documentation page for this rule
18
18
  },
@@ -26,11 +26,11 @@ module.exports = {
26
26
  }, // Add messageId and message
27
27
  },
28
28
 
29
- create(context) {
29
+ create (context) {
30
30
  const sourceCode = context.sourceCode ?? context.getSourceCode();
31
31
  return sourceCode.parserServices.defineTemplateBodyVisitor({
32
32
  // Visitor functions for Vue templates
33
- VAttribute(node) {
33
+ VAttribute (node) {
34
34
  if (node.key.name === 'class') {
35
35
  const classes = node.value.value.split(' ');
36
36
  const typographyClasses = [
@@ -47,16 +47,16 @@ module.exports = {
47
47
  'd-ff-unset',
48
48
  ];
49
49
  const typographyClassesFound = classes.filter((className) =>
50
- typographyClasses.some((typographyClass) => className.includes(typographyClass))
50
+ typographyClasses.some((typographyClass) => className.includes(typographyClass)),
51
51
  );
52
52
  if (typographyClassesFound.length > 0) {
53
53
  context.report({
54
- node: node,
54
+ node,
55
55
  messageId: 'recommendTypographyStyle',
56
56
  });
57
57
  }
58
58
  }
59
- }
59
+ },
60
60
  });
61
- }
61
+ },
62
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialpad/eslint-plugin-dialtone",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "dialtone eslint plugin",
5
5
  "keywords": [
6
6
  "Dialpad",