facebook / facebook/stylex

[eslint-plugin] 'Computed key cannot be resolved' when overwriting var

Open
#337 15 comments 1 reaction 0 assignees View on GitHub
bug good first issue
Dominant language
JavaScript
Stars
10.3k
Forks
481
Avg merge
3d 8h
Merged PRs (30d)
13

Description

**The problem**

```
Computed key cannot be resolved.eslint(@stylexjs/valid-styles)
```

**How to reproduce**

```tsx
// bug.stylex.ts

import * as stylex from '@stylexjs/stylex';

const vars = {
color: 'red',
};

export const componentVars = stylex.defineVars(vars);
```

```tsx
// bug.ts

import * as stylex from '@stylexjs/stylex';

import { componentVars } from './bug.stylex';

export const styles = stylex.create({
host: {
[componentVars.color]: 'blue',
// ^^^^^^^^^^^^^^^^^^^
},
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.