stylex
stylex copied to clipboard
@stylexjs/eslint-plugin: Error When Using `keyframes` Named Import
The problem
When using the named import of keyframes
as follows:
import { create, props, keyframes } from '@stylexjs/stylex';
const beat = keyframes({
'0%': {
transform: 'scale(1)',
},
// ...
});
const styles = create({
image: {
animationName: beat,
// ...
}
});
// ...
beat
is highlighted with the error: (ESLint) @stylexjs/valid-styles animationName value must be one of...
However, when using the namespace import:
import * as stylex from '@stylexjs/stylex';
const beat = stylex.keyframes({
'0%': {
transform: 'scale(1)',
},
// ...
});
const styles = create({
image: {
animationName: beat,
// ...
}
});
// ...
ESLint doesn't report an error.
StyleX works as expected in both cases.
Expected behavior ESLint should not report an error in both cases.
Environment (include versions). Did this work in previous versions? @stylexjs/stylex v0.4.1 @stylexjs/eslint-plugin v0.4.1