Skip to content

Commit

Permalink
fix: docs eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emersonlaurentino committed Jun 17, 2022
1 parent f712a39 commit 76f5da7
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 48 deletions.
4 changes: 2 additions & 2 deletions apps/docs/src/components/DocStructure/DocStructure.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import Link from '@docusaurus/Link'
import useBaseUrl from '@docusaurus/useBaseUrl'
import baseUrl from '@docusaurus/useBaseUrl'

let docs = [
{
Expand Down Expand Up @@ -39,7 +39,7 @@ const DocStructure = () => {
{docs.map((item, i) => (
<Link key={i}
className="focus:no-underline hover:no-underline"
to={useBaseUrl(item.url)}
to={baseUrl(item.url)}
>
<h4 className="block font-black text-text hover:text-rebelPink">{item.title}</h4>
<p className="text-details">{item.description}</p>
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/src/components/DocUpdate/DocUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const DocUpdate = () => {
<div className="mb-2 leading-9">
{item.type === 'Fixed' && (
<svg className='inline-block align-middle mr-2' width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.13462 15.7692V15.7692C4.05585 15.7692 0.75 12.4634 0.75 8.38462V8.38462C0.75 4.30585 4.05585 1 8.13462 1V1C12.2134 1 15.5192 4.30585 15.5192 8.38462V8.38462C15.5192 12.4634 12.2134 15.7692 8.13462 15.7692Z" stroke="#142032" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M11.4166 6.74316L7.31408 10.8457L4.85254 8.38419" stroke="#142032" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M8.13462 15.7692V15.7692C4.05585 15.7692 0.75 12.4634 0.75 8.38462V8.38462C0.75 4.30585 4.05585 1 8.13462 1V1C12.2134 1 15.5192 4.30585 15.5192 8.38462V8.38462C15.5192 12.4634 12.2134 15.7692 8.13462 15.7692Z" stroke="#142032" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
<path d="M11.4166 6.74316L7.31408 10.8457L4.85254 8.38419" stroke="#142032" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
</svg>
)}
{item.type === 'Removed' && (
Expand All @@ -68,8 +68,8 @@ const DocUpdate = () => {
)}
{item.type === 'Improved' && (
<svg className='inline-block align-middle mr-2' width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.13462 15.7692V15.7692C4.05585 15.7692 0.75 12.4634 0.75 8.38462V8.38462C0.75 4.30585 4.05585 1 8.13462 1V1C12.2134 1 15.5192 4.30585 15.5192 8.38462V8.38462C15.5192 12.4634 12.2134 15.7692 8.13462 15.7692Z" stroke="#142032" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M11.4166 6.74316L7.31408 10.8457L4.85254 8.38419" stroke="#142032" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M8.13462 15.7692V15.7692C4.05585 15.7692 0.75 12.4634 0.75 8.38462V8.38462C0.75 4.30585 4.05585 1 8.13462 1V1C12.2134 1 15.5192 4.30585 15.5192 8.38462V8.38462C15.5192 12.4634 12.2134 15.7692 8.13462 15.7692Z" stroke="#142032" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
<path d="M11.4166 6.74316L7.31408 10.8457L4.85254 8.38419" stroke="#142032" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
</svg>
)}
{item.type === 'Added' && (
Expand Down Expand Up @@ -100,7 +100,7 @@ const DocUpdate = () => {
comp = (
<div className="mb-6">
<h3 className="inline-block mr-3 text-2xl font-extralight align-middle">Documentation Updates</h3>
<p>There weren't any documentation updates in the last month.</p>
<p>There {"weren't"} any documentation updates in the last month.</p>
</div>
)
}
Expand Down
3 changes: 1 addition & 2 deletions apps/docs/src/components/hooks/useInterval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useEffect, useRef } from 'react';

export function useInterval(callback, delay) {
const savedCallback = useRef();
const savedCallback = useRef<any>();

// Remember the latest function.
useEffect(() => {
Expand All @@ -12,7 +12,6 @@ export function useInterval(callback, delay) {

// Set up the interval.
useEffect(() => {
// @ts-ignore
const tick = () => savedCallback.current();

if (delay !== null) {
Expand Down
7 changes: 4 additions & 3 deletions apps/docs/src/components/hooks/useWindowSize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ export function useWindowSize(): WindowSizeInterface {
// Initialize state with undefined width/height so server and client renders match
// Learn more here: https://joshwcomeau.com/react/the-perils-of-rehydration/
const [windowSize, setWindowSize] = useState<WindowSizeInterface>({
windowWidth: undefined,
windowHeight: undefined,
scrollHeight: undefined,
windowWidth: 0,
windowHeight: 0,
scrollHeight: 0,
});

// Return if running on server
if (onServer()) {
return { windowWidth: 0, windowHeight: 0, scrollHeight: 0 };
}

// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
function handleResize() {
setWindowSize({
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/sections/FaqPage/FaqPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const FaqPage = () => {
return (
<div>
{data.map(({ question, answer }) => (
<FaqQuestion question={question} answer={answer}></FaqQuestion>
<FaqQuestion key={question} question={question} answer={answer}></FaqQuestion>
))}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const StarterComponentPage = ({ data = {} }) => {
</p>
<ul>
{data.features?.map((feature) => (
<li className=" ml-5 list-disc">{feature}</li>
<li key={feature} className=" ml-5 list-disc">{feature}</li>
))}
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/starters/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function Submissions() {
<div className="tracking-wider uppercase text-sm text-fontSecondary"><Link href="/starters">← Back</Link></div>
<p className="pt-20 uppercase text-sm text-seriousBlack font-bold">Starter Community</p>
<h1 className="text-5xl text-seriousBlack font-VTEXTrust py-5">Submit your starter</h1>
<p className='text-lg pt-3 text-[#4A596B]'>Submit your starter and get featured on the FastStore Community Starters Library! If your starter meets our basic standards, we'll add it as quickly as possible to the Library.</p>
<p className='text-lg pt-3 text-[#4A596B]'>Submit your starter and get featured on the FastStore Community Starters Library! If your starter meets our basic standards, {"we'll"} add it as quickly as possible to the Library.</p>
</div>
<img src ="https://vtexhelp.vtexassets.com/assets/docs/src/starter-submissions___d566d94c0e7e97fe4393a8eee8f3eec0.png"
className='block sm:w-1/3 sm:object-contain pt-12 sm:ml-10' />
Expand Down
82 changes: 49 additions & 33 deletions packages/api/src/__generated__/schema.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 76f5da7

Please sign in to comment.