You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,26 @@
1
1
# @fullstory/eslint-plugin-annotate-react
2
2
3
-
An ESLint plugin for annotating React components.
3
+
An ESLint plugin for adding 'data-attribute' to React components. The purpose of this plugin is to automatically
4
+
make css selectors. Here is an example
5
+
6
+
```
7
+
const myDiv = () => (
8
+
<div/>
9
+
); `;
10
+
```
11
+
12
+
This plugin will autofix and add data-component to the div
13
+
14
+
```
15
+
const myDiv = () => (
16
+
<div data-component="temp"/>
17
+
); `;
18
+
```
19
+
20
+
This plugin is intended to not be too opinionated. In general the approach is to suggest to the developer to add 'data-attribute' when there is an obvious approach, but in questionable cases, the plugin will tend towards being quiet.
21
+
22
+
- When there is a [fragment](https://reactjs.org/docs/fragments.html) this plugin won't add data-attribute
23
+
- Where there are multiple return elements this plugin won't add data-attribute
4
24
5
25
## Installation
6
26
@@ -36,6 +56,14 @@ Then configure the rules you want to use under the rules section.
0 commit comments