eslint-plugin-primer-react 0.6.1 → 0.7.1-rc.04b2811
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 +14 -0
- package/README.md +2 -1
- package/docs/rules/no-system-props.md +16 -0
- package/package-lock.json +5631 -0
- package/package.json +1 -1
- package/src/rules/__tests__/no-deprecated-colors.test.js +2 -0
- package/src/rules/__tests__/no-system-props.test.js +24 -1
- package/src/rules/no-deprecated-colors.js +9 -2
- package/src/rules/no-system-props.js +26 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# eslint-plugin-primer-react
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#22](https://github.com/primer/eslint-plugin-primer-react/pull/22) [`87d0fd6`](https://github.com/primer/eslint-plugin-primer-react/commit/87d0fd6af8a18a2a570c3770571b16fe3b5c3a30) Thanks [@dmarcey](https://github.com/dmarcey)! - Ignore non-literal, non-string arguments to `themeGet` in `no-deprecated-colors` rule
|
|
8
|
+
|
|
9
|
+
## 0.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#18](https://github.com/primer/eslint-plugin-primer-react/pull/18) [`f0c7a3d`](https://github.com/primer/eslint-plugin-primer-react/commit/f0c7a3d1ab1d60df2c95b86c80d930d6ef15bde1) Thanks [@jfuchs](https://github.com/jfuchs)! - Introduced an option on no-system-props to include utility components (includeUtilityComponents).
|
|
14
|
+
|
|
15
|
+
* [#20](https://github.com/primer/eslint-plugin-primer-react/pull/20) [`b0824f6`](https://github.com/primer/eslint-plugin-primer-react/commit/b0824f6c7c69cdf7d70d831626be37f606d70f73) Thanks [@jfuchs](https://github.com/jfuchs)! - Updates no-system-props rule to always exclude the 'variant' prop no matter which component.
|
|
16
|
+
|
|
3
17
|
## 0.6.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ ESLint rules for Primer React
|
|
|
12
12
|
npm install --save-dev eslint-plugin-primer-react
|
|
13
13
|
|
|
14
14
|
# or
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
yarn add --dev eslint-plugin-primer-react
|
|
17
17
|
```
|
|
18
18
|
|
|
@@ -30,3 +30,4 @@ ESLint rules for Primer React
|
|
|
30
30
|
## Rules
|
|
31
31
|
|
|
32
32
|
- [no-deprecated-colors](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/no-deprecated-colors.md)
|
|
33
|
+
- [no-system-props](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/no-system-props.md)
|
|
@@ -38,3 +38,19 @@ import {Avatar} from 'some-other-library'
|
|
|
38
38
|
// System props passed to non-Primer components are allowed
|
|
39
39
|
<Avatar mr={2} />
|
|
40
40
|
```
|
|
41
|
+
|
|
42
|
+
## Options
|
|
43
|
+
|
|
44
|
+
- `includeUtilityComponents` (default: `false`)
|
|
45
|
+
|
|
46
|
+
By default, `Box` and `Text` are excluded because styled system props are not deprecated in our utility components. If you prefer to avoid styled system props there as well for consistency, you can set `includeUtilityComponents` to `true`.
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
/* eslint primer-react/no-system-props: ["warn", {"includeUtilityComponents": true}] */
|
|
50
|
+
import {Box} from '@primer/components'
|
|
51
|
+
|
|
52
|
+
function App() {
|
|
53
|
+
// Enabling `includeUtilityComponents` will find system prop usage on utility components like this:
|
|
54
|
+
return <Box width={200} />
|
|
55
|
+
}
|
|
56
|
+
```
|