fix(eslint-plugin): check only the values the build reads as styles - #697
Merged
Merged
Conversation
The array, typography and media rules reported and autofixed any value under a Devup UI element or call, including data in pass-through props (data-*, aria-*, handlers, HTML attributes, props, styleVars) and arguments of other functions. They now share one classifier mirroring the extractor, which also keeps the element context across nested elements. css-utils-literal-only reads a css() or keyframes() result held in a const of any scope as static. Refs #684. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Contributor
Changepacks@devup-ui/eslint-plugin@1.0.21 → 1.0.22 - packages/eslint-plugin/package.jsonPatch
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
전수조사 #682의 작업 묶음 J(#684) 중 필수 항목 TOOL-01, TOOL-02, KNOWN-14를 해결합니다.
문제
<Box data-values={[5, 5]} />가[5, null]로 바뀜,data-config={{ typography: '$x' }}의$가 지워짐.ThemeScript,getTheme같은 스타일과 무관한 export도 문맥으로 취급했습니다.const fade = keyframes(...)를 css-utils-literal-only가 보고했습니다. 빌드는 이 값을 정적으로 컴파일하므로 오탐입니다.변경
utils/style-position.ts: 다섯 규칙이 같이 쓰는 판별기를 추가했습니다.Box,Flex등 스타일 컴포넌트와css/globalCss/keyframes입니다. namespace import(Devup.Box,Devup.css)도 포함합니다.on*,data-*,aria-*, HTML·React 속성)은 Rustis_special_property목록과 같고, 둘이 어긋나면 테스트가 실패합니다.props/styleVars/styleOrder/as와imports/fontFaces/params아래도 제외합니다.css(base, { ... })도 검사합니다.css()/keyframes()결과를 담은const는 scope와 무관하게 정적 값으로 봅니다.검증
bun test packages/eslint-plugin: 390개 통과, 모든 파일 커버리지 100%<Box p={[1, 1]} data-values={[5, 5]} items={[1, null, null]} />에서p와items만 보고됩니다.items는 빌드도 스타일로 읽기 때문입니다.