Skip to content

Commit

Permalink
chore: adjust react compiler linter and cron schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Nov 8, 2024
1 parent 376ca06 commit 53acf20
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module.exports = {
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': 'error', // Checks effect dependencies
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-compiler/react-compiler': 'warn', // Set to error once existing warnings are fixed
'react-compiler/react-compiler': ['warn', {__unstable_donotuse_reportAllBailouts: true}], // Set to error once existing warnings are fixed
'react/no-unescaped-entities': 'off',
'no-restricted-imports': [
'error',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- run: pnpm install
- name: Register Problem Matcher for ESLint that handles -f compact and shows warnings and errors inline on PRs
run: echo "::add-matcher::.github/eslint-compact.json"
- run: "pnpm lint -f compact --rule 'no-warning-comments: [off]' --max-warnings 10"
- run: "pnpm lint -f compact --rule 'no-warning-comments: [off]' --max-warnings 33"

test:
needs: [build]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/react-compiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Maintain React Compiler

on:
schedule:
- cron: '0 0 * * 1-5' # Runs at midnight UTC every weekday (Monday to Friday)
- cron: "10 12 * * 1" # Runs at 12:10 PM UTC every Monday, which is 3 hours after the React Compiler release: https://github.com/facebook/react/blob/989af12f72080c17db03ead91d99b6394a215564/.github/workflows/compiler_prereleases_weekly.yml#L5-L6
workflow_dispatch:

concurrency:
Expand Down
4 changes: 2 additions & 2 deletions src/core/hooks/useElementRect/__workshop__/example.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {Box, Card, Code, Container, Stack, Text, useElementRect} from '@sanity/ui'
import {useMemo, useState} from 'react'
import {useState} from 'react'
import {Grid} from '../../../primitives'

export default function ExampleStory() {
const [element, setElement] = useState<HTMLElement | null>(null)
const rect = useElementRect(element)
const size = useMemo(() => ({width: rect?.width || 0, height: rect?.height || 0}), [rect])
const size = {width: rect?.width || 0, height: rect?.height || 0}

return (
<Box padding={[3, 4, 5]}>
Expand Down
19 changes: 8 additions & 11 deletions src/core/theme/__workshop__/debug/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ThemeColorState_v2,
} from '@sanity/ui/theme'
import {useBoolean, useSelect} from '@sanity/ui-workshop'
import {CSSProperties, useMemo} from 'react'
import {CSSProperties} from 'react'
import {Badge, Box, Flex, KBD, Stack, Text} from '../../../primitives'
import {useRootTheme} from '../../useRootTheme'

Expand Down Expand Up @@ -50,16 +50,13 @@ export default function DebugStory() {
const button = useBoolean('Button', false, 'Props') || false
const selectable = useBoolean('Selectable', false, 'Props') || false

const features: Features = useMemo(
() => ({
base,
button,
schemes: scheme == 'all' ? ['light', 'dark'] : [scheme],
selectable,
tones: tone == 'all' ? ['transparent', 'default'] : [tone],
}),
[base, button, scheme, selectable, tone],
)
const features: Features = {
base,
button,
schemes: scheme == 'all' ? ['light', 'dark'] : [scheme],
selectable,
tones: tone == 'all' ? ['transparent', 'default'] : [tone],
}

return (
<Flex>
Expand Down

0 comments on commit 53acf20

Please sign in to comment.