eslint-plugin-primer-react 4.0.3 → 4.0.4-rc.5058fcb

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.
Files changed (46) hide show
  1. package/.changeset/README.md +3 -3
  2. package/.eslintrc.js +39 -0
  3. package/.github/dependabot.yml +11 -5
  4. package/.github/workflows/add-to-inbox.yml +33 -0
  5. package/.github/workflows/ci.yml +34 -18
  6. package/.github/workflows/release.yml +2 -2
  7. package/.github/workflows/release_canary.yml +8 -5
  8. package/.github/workflows/release_candidate.yml +4 -4
  9. package/.markdownlint-cli2.cjs +26 -0
  10. package/.nvmrc +1 -0
  11. package/.prettierignore +3 -0
  12. package/CHANGELOG.md +7 -1
  13. package/README.md +4 -2
  14. package/docs/rules/a11y-explicit-heading.md +17 -7
  15. package/docs/rules/a11y-tooltip-interactive-trigger.md +6 -2
  16. package/docs/rules/direct-slot-children.md +49 -46
  17. package/docs/rules/new-color-css-vars-have-fallback.md +25 -0
  18. package/docs/rules/new-css-color-vars.md +19 -14
  19. package/docs/rules/no-deprecated-colors.md +91 -82
  20. package/docs/rules/no-system-props.md +12 -5
  21. package/package-lock.json +15583 -0
  22. package/package.json +22 -14
  23. package/src/configs/components.js +19 -19
  24. package/src/configs/recommended.js +9 -8
  25. package/src/index.js +4 -3
  26. package/src/rules/__tests__/a11y-explicit-heading.test.js +22 -25
  27. package/src/rules/__tests__/a11y-tooltip-interactive-trigger.test.js +43 -43
  28. package/src/rules/__tests__/direct-slot-children.test.js +36 -36
  29. package/src/rules/__tests__/new-color-css-vars.test.js +612 -44
  30. package/src/rules/__tests__/new-css-vars-have-fallback.test.js +31 -0
  31. package/src/rules/__tests__/no-deprecated-colors.test.js +66 -66
  32. package/src/rules/__tests__/no-system-props.test.js +51 -51
  33. package/src/rules/a11y-explicit-heading.js +16 -13
  34. package/src/rules/a11y-tooltip-interactive-trigger.js +21 -22
  35. package/src/rules/direct-slot-children.js +11 -11
  36. package/src/rules/new-color-css-vars-have-fallback.js +87 -0
  37. package/src/rules/new-color-css-vars.js +97 -83
  38. package/src/rules/no-deprecated-colors.js +15 -15
  39. package/src/rules/no-system-props.js +21 -21
  40. package/src/url.js +1 -1
  41. package/src/utils/__tests__/flatten-components.test.js +13 -13
  42. package/src/utils/css-variable-map.json +538 -184
  43. package/src/utils/flatten-components.js +11 -11
  44. package/src/utils/is-imported-from.js +1 -1
  45. package/src/utils/new-color-css-vars-map.json +326 -0
  46. /package/.github/{workflows/CODEOWNERS → CODEOWNERS} +0 -0
@@ -1,6 +1,6 @@
1
1
  const {flattenComponents} = require('../flatten-components')
2
2
 
3
- const mockComponents = function(passedObj) {
3
+ const mockComponents = passedObj => {
4
4
  return {
5
5
  Button: 'button',
6
6
  Link: 'a',
@@ -8,14 +8,14 @@ const mockComponents = function(passedObj) {
8
8
  Radio: 'input',
9
9
  TextInput: {
10
10
  Action: 'button',
11
- self: 'input'
11
+ self: 'input',
12
12
  },
13
- ...passedObj
13
+ ...passedObj,
14
14
  }
15
15
  }
16
16
 
17
- describe('getElementType', function() {
18
- it('flattens passed object 1-level deep', function() {
17
+ describe('getElementType', function () {
18
+ it('flattens passed object 1-level deep', function () {
19
19
  const result = flattenComponents(mockComponents())
20
20
 
21
21
  const expectedResult = {
@@ -24,23 +24,23 @@ describe('getElementType', function() {
24
24
  Spinner: 'svg',
25
25
  Radio: 'input',
26
26
  TextInput: 'input',
27
- 'TextInput.Action': 'button'
27
+ 'TextInput.Action': 'button',
28
28
  }
29
29
 
30
30
  expect(result).toEqual(expectedResult)
31
31
  })
32
32
 
33
- it('ignores objects nested deeper than 1-level', function() {
33
+ it('ignores objects nested deeper than 1-level', function () {
34
34
  const result = flattenComponents(
35
35
  mockComponents({
36
36
  Select: {
37
37
  Items: {
38
- self: 'div'
38
+ self: 'div',
39
39
  },
40
40
  Option: 'option',
41
- self: 'select'
42
- }
43
- })
41
+ self: 'select',
42
+ },
43
+ }),
44
44
  )
45
45
 
46
46
  const expectedResult = {
@@ -51,10 +51,10 @@ describe('getElementType', function() {
51
51
  TextInput: 'input',
52
52
  'TextInput.Action': 'button',
53
53
  'Select.Items': {
54
- self: 'div'
54
+ self: 'div',
55
55
  },
56
56
  Select: 'select',
57
- 'Select.Option': 'option'
57
+ 'Select.Option': 'option',
58
58
  }
59
59
 
60
60
  expect(result).toEqual(expectedResult)