Skip to content

Commit abcf84c

Browse files
committed
Update lint-staged config to run prettier on more file types.
Also fix Prettier issues
1 parent 1d35c25 commit abcf84c

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The **`<Observer />`** accepts the following props:
5858
| **root** | HTMLElement | | false | The HTMLElement that is used as the viewport for checking visibility of the target. Defaults to the browser viewport if not specified or if null. |
5959
| **rootId** | String | | false | Unique identifier for the root element - This is used to identify the IntersectionObserver instance, so it can be reused. If you defined a root element, without adding an id, it will create a new instance for all components. |
6060
| **rootMargin** | String | '0px' | false | Margin around the root. Can have values similar to the CSS margin property, e.g. "10px 20px 30px 40px" (top, right, bottom, left). |
61-
| **tag** | String | 'div' | false | Element tag to use for the wrapping element when rendering using 'children'. Defaults to 'div' |
61+
| **tag** | String | 'div' | false | Element tag to use for the wrapping element when rendering using 'children'. Defaults to 'div' |
6262
| **threshold** | Number | 0 | false | Number between 0 and 1 indicating the the percentage that should be visible before triggering. Can also be an array of numbers, to create multiple trigger points. |
6363
| **triggerOnce** | Bool | false | false | Only trigger this method once |
6464
| **onChange** | Func | | false | Call this function whenever the in view state changes |
@@ -121,7 +121,6 @@ const Component = () => (
121121
export default Component
122122
```
123123

124-
125124
### Polyfill for intersection-observer
126125

127126
The component requires the [intersection-observer
@@ -172,4 +171,4 @@ function supportsIntersectionObserver() {
172171
'intersectionRatio' in IntersectionObserverEntry.prototype
173172
)
174173
}
175-
```
174+
```

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ declare module 'react-intersection-observer' {
6666
> {}
6767
}
6868

69-
export default Component
69+
export default Component

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,21 @@
2525
"dev": "concurrently -k -r 'jest --watch' 'npm run storybook'",
2626
"lint": "eslint {src,stories,tests}/. ",
2727
"precommit": "flow && lint-staged",
28-
"postcommit": "git reset",
28+
"postcommit": "git update-index --again",
2929
"prepare": "npm run build",
3030
"pretty": "prettier '**/*.{js,md,json}' --write",
3131
"storybook": "start-storybook -p 9000",
3232
"test": "eslint {src,stories,tests}/. && jest"
3333
},
3434
"lint-staged": {
35-
"*.js": [
36-
"prettier --write --no-semi --single-quote --trailing-comma all",
37-
"eslint",
35+
"*.{js,json,css,md,ts}": [
36+
"prettier --write",
3837
"git add"
38+
],
39+
"src/**/*.js": [
40+
"eslint",
41+
"jest --findRelatedTests",
42+
"flow force-recheck --focus"
3943
]
4044
},
4145
"eslintConfig": {

0 commit comments

Comments
 (0)