eslint-plugin-primer-react 6.0.1-rc.684a5eb → 6.0.2-rc.cf3a787

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
+ ## 6.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#218](https://github.com/primer/eslint-plugin-primer-react/pull/218) [`e55d3d3`](https://github.com/primer/eslint-plugin-primer-react/commit/e55d3d3d271058d76da94cc3152987ea6541e2a6) Thanks [@iansan5653](https://github.com/iansan5653)! - Fix incorrect rule violations on components imported from @primer/react-brand
8
+
3
9
  ## 6.0.1
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": "5.4.0",
3
+ "version": "6.0.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "eslint-plugin-primer-react",
9
- "version": "5.4.0",
9
+ "version": "6.0.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@styled-system/props": "^5.1.5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-primer-react",
3
- "version": "6.0.1-rc.684a5eb",
3
+ "version": "6.0.2-rc.cf3a787",
4
4
  "description": "ESLint rules for Primer React",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -7,7 +7,7 @@ const rule = require('../no-unnecessary-components')
7
7
  const {components} = require('../no-unnecessary-components')
8
8
 
9
9
  const prcImport = 'import React from "react"; import {Box, Text} from "@primer/react";'
10
- const brandImport = 'import React from "react"; import {Box, Text} from "@primer/brand";'
10
+ const brandImport = 'import React from "react"; import {Box, Text} from "@primer/react-brand";'
11
11
 
12
12
  /** @param {string} content */
13
13
  const jsx = content => `export const Component = () => <>${content}</>`
@@ -1,6 +1,10 @@
1
1
  const {isImportedFrom} = require('./is-imported-from')
2
2
 
3
- /** @returns {boolean} */
3
+ /**
4
+ * Check if `name` is a JSX component that is imported from `@primer/react` or
5
+ * a subpath `@primer/react/*`.
6
+ * @returns {boolean}
7
+ */
4
8
  function isPrimerComponent(name, scope) {
5
9
  let identifier
6
10
 
@@ -14,7 +18,6 @@ function isPrimerComponent(name, scope) {
14
18
  default:
15
19
  return false
16
20
  }
17
-
18
- return isImportedFrom(/^@primer\/react/, identifier, scope)
21
+ return isImportedFrom(/^@primer\/react(?:$|\/)/, identifier, scope)
19
22
  }
20
23
  exports.isPrimerComponent = isPrimerComponent