Skip to content

Commit 01c94c7

Browse files
committed
fix: lint
1 parent 69aa7f4 commit 01c94c7

File tree

12 files changed

+5292
-1887
lines changed

12 files changed

+5292
-1887
lines changed

documentation/docs/examples/custom-effects.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Example() {
1919
if (parallax.ref.current) {
2020
// set progress to CSS variable
2121
parallax.ref.current.style.setProperty(
22-
"--progress",
22+
'--progress',
2323
progress.toString()
2424
);
2525
}
@@ -47,5 +47,4 @@ Try it out for yourself in this CodeSandbox example: [Custom Effects Example](ht
4747

4848
Using this technique, we can animate any CSS property based on the scroll position of an element. Here's another example of animating the letter spacing and text shadow of a text element:
4949

50-
<CustomEffect/>
51-
50+
<CustomEffect />

documentation/docs/usage/next-13.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Usage with Next.js
32

43
This guide will show you how to set up `react-scroll-parallax` using the [Next 13](https://nextjs.org/blog/next-13) App router.

documentation/pnpm-lock.yaml

Lines changed: 5263 additions & 1858 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

documentation/sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
1515
const sidebars = {
1616
// By default, Docusaurus generates a sidebar from the docs folder structure
17-
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
17+
tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],
1818

1919
// But you can create a sidebar manually
2020
/*
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.text-stroke {
2-
font-family: sans-serif;
3-
font-size: 15vmin;
4-
height: 100px;
2+
font-family: sans-serif;
3+
font-size: 15vmin;
4+
height: 100px;
55

6-
-webkit-text-stroke-color: white;
7-
-webkit-text-stroke-width: 1px;
6+
-webkit-text-stroke-color: white;
7+
-webkit-text-stroke-width: 1px;
88

9-
/* color:paleturquoise; */
10-
@apply text-blue-400;
11-
letter-spacing: calc(2vw * var(--progress) - 1vw);
12-
white-space: nowrap;
13-
text-shadow: 0 calc(4vw * var(--progress) - 2vw) 0 rgba(156, 163, 175, 0.2);
14-
}
9+
/* color:paleturquoise; */
10+
@apply text-blue-400;
11+
letter-spacing: calc(2vw * var(--progress) - 1vw);
12+
white-space: nowrap;
13+
text-shadow: 0 calc(4vw * var(--progress) - 2vw) 0 rgba(156, 163, 175, 0.2);
14+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
"tabWidth": 2,
9494
"semi": true,
9595
"singleQuote": true,
96-
"trailingComma": "es5"
96+
"trailingComma": "es5",
97+
"arrowParens": "always"
9798
},
9899
"module": "dist/react-scroll-parallax.esm.js",
99100
"size-limit": [

src/components/ParallaxBanner/ParallaxBanner.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ const containerStyle: CSSProperties = {
1818
export const ParallaxBanner = (
1919
props: PropsWithChildren<ParallaxBannerProps>
2020
) => {
21-
const [targetElement, setTargetElement] =
22-
useState<HTMLDivElement | null>(null);
21+
const [targetElement, setTargetElement] = useState<HTMLDivElement | null>(
22+
null
23+
);
2324
const containerRef = useRef<HTMLDivElement>(null);
2425
useEffect(() => {
2526
setTargetElement(containerRef.current);

src/components/ParallaxProvider/ParallaxProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function ParallaxProvider(
2323
if (props.scrollContainer && controller.current) {
2424
controller.current.updateScrollContainer(props.scrollContainer);
2525
}
26-
}, [props.scrollContainer, controller.current]);
26+
}, [props.scrollContainer]);
2727

2828
// disable/enable parallax
2929
useEffect(() => {
@@ -33,12 +33,12 @@ export function ParallaxProvider(
3333
if (!props.isDisabled && controller.current) {
3434
controller.current.enableParallaxController();
3535
}
36-
}, [props.isDisabled, controller.current]);
36+
}, [props.isDisabled]);
3737

3838
// remove the controller when unmounting
3939
useEffect(() => {
4040
return () => {
41-
controller?.current && controller?.current.destroy();
41+
controller?.current?.destroy();
4242
};
4343
}, []);
4444

src/components/ParallaxProvider/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('A <ParallaxProvider>', () => {
112112
screen.unmount();
113113

114114
expect(
115-
(parallaxController as unknown as ParallaxController)?.destroy
115+
((parallaxController as unknown) as ParallaxController)?.destroy
116116
).toBeCalled();
117117
});
118118

src/helpers/getIsolatedParallaxProps.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { ParallaxElementConfig } from 'parallax-controller';
22
import { removeUndefinedObjectKeys } from '../utils/removeUndefinedObjectKeys';
33

4-
export function getIsolatedParallaxProps(props: any): {
4+
export function getIsolatedParallaxProps(
5+
props: any
6+
): {
57
parallaxProps: ParallaxElementConfig;
68
rest: Record<string, any>;
79
} {

0 commit comments

Comments
 (0)