Skip to content

Commit

Permalink
chore: run lint (#2651)
Browse files Browse the repository at this point in the history
## What's the purpose of this pull request?

- Run `lint:fix` for the whole project
- Enable lint on CI
- Fix fixable rules
- Disable unfixable rules
  • Loading branch information
matheusps authored Jan 29, 2025
1 parent 6b9aae9 commit eb795f6
Show file tree
Hide file tree
Showing 259 changed files with 1,779 additions and 1,401 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ jobs:
- name: Size
run: yarn size

# Temporary disable
# - name: Lint
# run: yarn lint
- name: Lint
run: yarn lint

- name: Test
run: yarn test
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ jobs:
- name: Size
run: yarn size

# Temporary disable
# - name: Lint
# run: yarn lint
- name: Lint
run: yarn lint

- name: Test
run: yarn test
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/CardList/CardItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CSSProperties, PropsWithChildren, ReactNode } from 'react'
import type { CSSProperties, PropsWithChildren, ReactNode } from 'react'

export type CardItemProps = {
title: string
Expand Down
57 changes: 44 additions & 13 deletions apps/site/components/CardList/card-list.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@
}

@media screen and (min-width: 1024px) {
.cardList [data-doc-card-grid-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cardList [data-doc-card-grid-columns="4"] [data-doc-card-item-component] { height: 150px; }
.cardList [data-doc-card-grid-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cardList [data-doc-card-grid-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cardList [data-doc-card-grid-columns="4"] {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cardList [data-doc-card-grid-columns="4"] [data-doc-card-item-component] {
height: 150px;
}
.cardList [data-doc-card-grid-columns="3"] {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cardList [data-doc-card-grid-columns="2"] {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}

.cardList [data-doc-card-item] {
Expand Down Expand Up @@ -59,17 +67,32 @@
pointer-events: none;
}

.cardList [data-doc-card-item-component] [data-fs-out-of-stock] { width: 100%; }
.cardList [data-doc-card-item-component] [data-fs-out-of-stock] {
width: 100%;
}
.cardList [data-doc-card-item-component] > [data-fs-product-card] {
zoom: 70%;
width: 30%;
}

.cardList [data-doc-card-item-component] [data-fs-sku-selector] { flex-direction: column; }
.cardList [data-doc-card-item-component] [data-fs-sku-selector] [data-fs-sku-selector-title] { width: auto; }
.cardList [data-doc-card-item-component] [data-fs-sku-selector] {
flex-direction: column;
}
.cardList
[data-doc-card-item-component]
[data-fs-sku-selector]
[data-fs-sku-selector-title] {
width: auto;
}

.cardList [data-doc-card-item-component] [data-fs-navbar-links-wrapper] [data-fs-button],
.cardList [data-doc-card-item-component] [data-fs-navbar-links-wrapper] [data-fs-navbar-links-list-item] {
.cardList
[data-doc-card-item-component]
[data-fs-navbar-links-wrapper]
[data-fs-button],
.cardList
[data-doc-card-item-component]
[data-fs-navbar-links-wrapper]
[data-fs-navbar-links-list-item] {
white-space: nowrap;
}

Expand All @@ -79,11 +102,17 @@
zoom: 40%;
}

.cardList [data-doc-card-item-component] > * { max-width: 100%; }
.cardList [data-doc-card-item-component] > * {
max-width: 100%;
}

.cardList [data-doc-card-item-component-zoom="true"] > * { width: 100%; }
.cardList [data-doc-card-item-component-zoom="true"] > * {
width: 100%;
}

.cardList [data-doc-card-item-component-full-width="true"] > * { width: 100%; }
.cardList [data-doc-card-item-component-full-width="true"] > * {
width: 100%;
}

.cardList [data-doc-card-item]:hover {
top: -2px;
Expand All @@ -102,4 +131,6 @@
background-color: #f1f2f386;
}

.cardList [data-doc-card-item-content] p { line-height: 1.35; }
.cardList [data-doc-card-item-content] p {
line-height: 1.35;
}
2 changes: 1 addition & 1 deletion apps/site/components/Carousel/CarouselSimpleUsage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropsWithChildren } from 'react'
import React, { type PropsWithChildren } from 'react'
import { Carousel } from '@faststore/ui'
import styles from './carousel-item.module.css'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsWithChildren } from 'react'
import type { PropsWithChildren } from 'react'

const ExtendableQueryTable = ({ children }: PropsWithChildren) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/ExtendableQueryTable/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as ExtendableQueryTable } from "./ExtendableQueryTable"
export { default as ExtendableQueryTable } from './ExtendableQueryTable'
4 changes: 2 additions & 2 deletions apps/site/components/Filter/FilterDesktopUsage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
FilterFacets,
} from '@faststore/ui'
import { useFormattedPrice } from '../utilities/usePriceFormatter'
import { FilterFacet } from './FilterUsage'
import { useFilter } from './useFilter'
import type { FilterFacet } from './FilterUsage'
import type { useFilter } from './useFilter'

interface Props {
/**
Expand Down
9 changes: 8 additions & 1 deletion apps/site/components/Filter/FilterSliderUsage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { useSearch } from '@faststore/sdk'
import { Filter as UIFilter, FilterFacetBoolean as UIFilterFacetBoolean, FilterFacetBooleanItem as UIFilterFacetBooleanItem, FilterFacetRange as UIFilterFacetRange, FilterFacets as UIFilterFacets, FilterSlider as UIFilterSlider } from '@faststore/ui'
import {
Filter as UIFilter,
FilterFacetBoolean as UIFilterFacetBoolean,
FilterFacetBooleanItem as UIFilterFacetBooleanItem,
FilterFacetRange as UIFilterFacetRange,
FilterFacets as UIFilterFacets,
FilterSlider as UIFilterSlider,
} from '@faststore/ui'
import { useFormattedPrice } from '../utilities/usePriceFormatter'
import type { FilterFacet } from './FilterUsage'

Expand Down
19 changes: 11 additions & 8 deletions apps/site/components/Filter/useFilter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IStoreSelectedFacet } from '@faststore/api'
import { setFacet, toggleFacet, useSearch } from '@faststore/sdk'
import { useEffect, useMemo, useReducer } from 'react'
import { FilterFacet } from './FilterUsage'
import type { FilterFacet } from './FilterUsage'

interface State {
expanded: Set<number>
Expand Down Expand Up @@ -88,15 +88,18 @@ export const useFilter = (allFacets: FilterFacet[]) => {

const selectedMap = useMemo(
() =>
selected.reduce((acc, facet) => {
if (!acc.has(facet.key)) {
acc.set(facet.key, new Map())
}
selected.reduce(
(acc, facet) => {
if (!acc.has(facet.key)) {
acc.set(facet.key, new Map())
}

acc.get(facet.key)?.set(facet.value, facet)
acc.get(facet.key)?.set(facet.value, facet)

return acc
}, new Map() as Map<string, Map<string, IStoreSelectedFacet>>),
return acc
},
new Map() as Map<string, Map<string, IStoreSelectedFacet>>
),
[selected]
)

Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/Icon/IconList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropsWithChildren } from 'react'
import React, { type PropsWithChildren } from 'react'
import styles from './icon.module.css'

const IconList = ({ children }: PropsWithChildren) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/OverviewSection/OverviewSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { CSSProperties } from 'react'
import React, { type CSSProperties } from 'react'
import styles from './overview-section.module.css'

type Direction = 'column' | 'row'
Expand Down
21 changes: 15 additions & 6 deletions apps/site/components/OverviewSection/overview-section.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
.overviewSectionItem > div > div {
display: flex;
justify-content: center;
}
}

.overviewSection[data-doc-overview-dark="true"] {
background-color: #171a1c;
background-image: radial-gradient(rgba(225, 225, 225, 0.094) 1px, transparent 0);
background-image: radial-gradient(
rgba(225, 225, 225, 0.094) 1px,
transparent 0
);
}

.overviewSection[data-doc-overview-direction="row"] {
Expand All @@ -42,14 +45,20 @@
column-gap: 60px;
}

.overviewSection [data-fs-product-shelf-items] { width: 100%; }
.overviewSection [data-fs-product-shelf-items] {
width: 100%;
}

@media screen and (min-width: 1280px) {
.overviewSection [data-fs-carousel-track-container] { padding: 0 70px; }
.overviewSection [data-fs-carousel-controls] { width: 100%; }
.overviewSection [data-fs-carousel-track-container] {
padding: 0 70px;
}
.overviewSection [data-fs-carousel-controls] {
width: 100%;
}
}

.overviewSection>[data-doc-overview-group] [data-doc-overview-group-title] {
.overviewSection > [data-doc-overview-group] [data-doc-overview-group-title] {
width: 10%;
line-height: 16px;
}
44 changes: 31 additions & 13 deletions apps/site/components/PropsSection/props-section.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,68 @@
}

@media screen and (min-width: 1024px) {
.propsSection table { table-layout: fixed; }
.propsSection table {
table-layout: fixed;
}
}

.propsSection th {
color: var(--fs-color-text);
padding: var(--fs-spacing-1) var(--fs-spacing-2);
font-size: var(--fs-text-size-body);
background-color: hsl(var(--nextra-primary-hue)100% 39%/.05);
background-color: hsl(var(--nextra-primary-hue) 100% 39% / 0.05);
}

.propsSection th:first-child { border-radius: 4px 0 0 4px; }
.propsSection th:last-child { border-radius: 0 4px 4px 0; }
.propsSection th:first-child {
border-radius: 4px 0 0 4px;
}
.propsSection th:last-child {
border-radius: 0 4px 4px 0;
}

.propsSection tr:first-child td { padding-top: var(--fs-spacing-4); }
.propsSection tr:last-child td { border-bottom: none; }
.propsSection tr:first-child td {
padding-top: var(--fs-spacing-4);
}
.propsSection tr:last-child td {
border-bottom: none;
}

.propsSection th,
.propsSection td {
text-align: left;
overflow: hidden;
}

.propsSection [data-nx-props-section-name] { overflow-x: auto; }
.propsSection [data-nx-props-section-name] {
overflow-x: auto;
}

.propsSection [data-nx-props-section-type] code {
max-height: 8rem;
overflow-y: auto;
}

@media screen and (min-width: 1024px) {
.propsSection [data-nx-props-section-name] { width: 25%; }
.propsSection [data-nx-props-section-type] { width: 20%; }
.propsSection [data-nx-props-section-description] { width: 35%; }
.propsSection [data-nx-props-section-default] { width: 20%; }
.propsSection [data-nx-props-section-name] {
width: 25%;
}
.propsSection [data-nx-props-section-type] {
width: 20%;
}
.propsSection [data-nx-props-section-description] {
width: 35%;
}
.propsSection [data-nx-props-section-default] {
width: 20%;
}
}


.propsSection td[data-nx-props-section-name] span {
color: #006be6;
margin-left: var(--fs-spacing-0);
cursor: help;
}


.propsSection td[data-nx-props-section-type] span {
display: flex;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/Rating/RatingActionable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon, Rating, RatingProps } from '@faststore/ui'
import { Icon, Rating, type RatingProps } from '@faststore/ui'
import { useState } from 'react'

export type RatingActionableProps = {
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/SectionItem/SectionItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CSSProperties, PropsWithChildren, ReactNode } from 'react'
import type { CSSProperties, PropsWithChildren, ReactNode } from 'react'
import styles from './section-item.module.css'

import { Icon, LinkButton } from '@faststore/ui'
Expand Down
Loading

0 comments on commit eb795f6

Please sign in to comment.