facebook / stylex

StyleX is the styling system for ambitious user interfaces.
https://stylexjs.com
MIT License
8.21k stars 304 forks source link

fix: Allow all strings/numbers along with specific values #540

Closed nmn closed 2 months ago

nmn commented 2 months ago

The ESLint Plugin lets you define custom limits for various properties. So far this can be:

However, using ['string', 'number'] would not work as expected, and instead treat 'string' and 'number' as constants.

Sometimes, it might be useful to accept any number along with specific strings or globs. This PR allows for such a pattern and will interpret 'string' to mean the type string, and 'number' to mean the type number, even when used within an array.

github-actions[bot] commented 2 months ago

compressed-size: runtime library

Size change: 0.00 kB Total size: 2.52 kB

View unchanged | Filename: gzip (minify) | kB size | kB change | % change | | :--- | :--- | :--- | :--- | | `./packages/stylex/lib/stylex.js` | **1.04** (3.22) | **0.00** (0.00) | **0.0%** (0.0%) | | `./packages/stylex/lib/StyleXSheet.js` | **1.48** (3.75) | **0.00** (0.00) | **0.0%** (0.0%) |
github-actions[bot] commented 2 months ago

compressed-size: e2e bundles

Size change: 0.00 kB Total size: 1132.93 kB

View unchanged | Filename: gzip (minify) | kB size | kB change | % change | | :--- | :--- | :--- | :--- | | `./apps/rollup-example/.build/bundle.js` | **1006.63** (10188.26) | **0.00** (0.00) | **0.0%** (0.0%) | | `./apps/rollup-example/.build/stylex.css` | **126.30** (796.17) | **0.00** (0.00) | **0.0%** (0.0%) |
necolas commented 2 months ago

Can this be unit tested in a follow up?