eslint-plugin-primer-react 4.1.2-rc.cfb8ae8 → 4.1.3-rc.90c8886

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
  # eslint-plugin-primer-react
2
2
 
3
+ ## 4.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#152](https://github.com/primer/eslint-plugin-primer-react/pull/152) [`7baeb96`](https://github.com/primer/eslint-plugin-primer-react/commit/7baeb9684cc5f84847f004fee282a3362517d7d0) Thanks [@siddharthkp](https://github.com/siddharthkp)! - no-system-props: Add option to ignore specific component names
8
+
3
9
  ## 4.1.2
4
10
 
5
11
  ### Patch Changes
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "eslint-plugin-primer-react",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "eslint-plugin-primer-react",
9
- "version": "4.1.0",
9
+ "version": "4.1.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@styled-system/props": "^5.1.5",
@@ -1900,9 +1900,9 @@
1900
1900
  }
1901
1901
  },
1902
1902
  "node_modules/@primer/primitives": {
1903
- "version": "7.15.8",
1904
- "resolved": "https://registry.npmjs.org/@primer/primitives/-/primitives-7.15.8.tgz",
1905
- "integrity": "sha512-AVJeqvRdNWl6EWP8HaHMHi/nPOepZ/cAPb2ECVYhs2L/X+qmXRePeWv6sAMSFBySPA+1srLAbRBRP8/9nrunWw==",
1903
+ "version": "7.15.9",
1904
+ "resolved": "https://registry.npmjs.org/@primer/primitives/-/primitives-7.15.9.tgz",
1905
+ "integrity": "sha512-1dDNxokYV8sP2QDHMaAaEnRTxhYNBznf4QDTe4Gx9VzOXLexRvqrhvRitDbefbyfvO0yPr5TKI2nGCoz5T5zrQ==",
1906
1906
  "dev": true
1907
1907
  },
1908
1908
  "node_modules/@sinclair/typebox": {
@@ -10021,9 +10021,9 @@
10021
10021
  "dev": true
10022
10022
  },
10023
10023
  "@primer/primitives": {
10024
- "version": "7.15.8",
10025
- "resolved": "https://registry.npmjs.org/@primer/primitives/-/primitives-7.15.8.tgz",
10026
- "integrity": "sha512-AVJeqvRdNWl6EWP8HaHMHi/nPOepZ/cAPb2ECVYhs2L/X+qmXRePeWv6sAMSFBySPA+1srLAbRBRP8/9nrunWw==",
10024
+ "version": "7.15.9",
10025
+ "resolved": "https://registry.npmjs.org/@primer/primitives/-/primitives-7.15.9.tgz",
10026
+ "integrity": "sha512-1dDNxokYV8sP2QDHMaAaEnRTxhYNBznf4QDTe4Gx9VzOXLexRvqrhvRitDbefbyfvO0yPr5TKI2nGCoz5T5zrQ==",
10027
10027
  "dev": true
10028
10028
  },
10029
10029
  "@sinclair/typebox": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-primer-react",
3
- "version": "4.1.2-rc.cfb8ae8",
3
+ "version": "4.1.3-rc.90c8886",
4
4
  "description": "ESLint rules for Primer React",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -23,6 +23,11 @@ ruleTester.run('no-system-props', rule, {
23
23
  `import {Button} from '@primer/react'; <Button size="large" />`,
24
24
  `import {ActionMenu} from '@primer/react'; <ActionMenu.Overlay width="large" />`,
25
25
  {code: `<img width="200px" />`, options: [{skipImportCheck: true}]},
26
+ {code: `<Placeholder width="200px" />`, options: [{skipImportCheck: true, ignoreNames: ['Placeholder']}]},
27
+ {
28
+ code: `<Placeholder.Header width="200px" />`,
29
+ options: [{skipImportCheck: true, ignoreNames: ['Placeholder.Header']}],
30
+ },
26
31
  ],
27
32
  invalid: [
28
33
  {
@@ -32,6 +32,7 @@ const excludedComponentProps = new Map([
32
32
  ['SplitPageLayout.Pane', new Set(['padding', 'position', 'width'])],
33
33
  ['SplitPageLayout.Content', new Set(['padding', 'width'])],
34
34
  ['StyledOcticon', new Set(['size'])],
35
+ ['Octicon', new Set(['size', 'color'])],
35
36
  ['PointerBox', new Set(['bg'])],
36
37
  ['TextInput', new Set(['size'])],
37
38
  ['TextInputWithTokens', new Set(['size', 'maxHeight'])],
@@ -55,12 +56,9 @@ module.exports = {
55
56
  schema: [
56
57
  {
57
58
  properties: {
58
- skipImportCheck: {
59
- type: 'boolean',
60
- },
61
- includeUtilityComponents: {
62
- type: 'boolean',
63
- },
59
+ skipImportCheck: {type: 'boolean'},
60
+ includeUtilityComponents: {type: 'boolean'},
61
+ ignoreNames: {type: 'array'},
64
62
  },
65
63
  },
66
64
  ],
@@ -72,8 +70,8 @@ module.exports = {
72
70
  // If `skipImportCheck` is true, this rule will check for deprecated styled system props
73
71
  // used in any components (not just ones that are imported from `@primer/react`).
74
72
  const skipImportCheck = context.options[0] ? context.options[0].skipImportCheck : false
75
-
76
73
  const includeUtilityComponents = context.options[0] ? context.options[0].includeUtilityComponents : false
74
+ const ignoreNames = context.options[0] ? context.options[0].ignoreNames || [] : []
77
75
 
78
76
  const excludedComponents = new Set([
79
77
  ...alwaysExcludedComponents,
@@ -92,6 +90,7 @@ module.exports = {
92
90
  }
93
91
 
94
92
  const componentName = getJSXOpeningElementName(jsxNode)
93
+ if (ignoreNames.length && ignoreNames.includes(componentName)) return
95
94
 
96
95
  if (excludedComponents.has(componentName)) return
97
96