compiled icon indicating copy to clipboard operation
compiled copied to clipboard

[ESLINT] @compiled/no-exported-css should not throw if exported component makes reference to css({})

Open pancaspe87 opened this issue 2 years ago • 0 comments

Looking at the source code of this ESLint rule compiled/validate-definition.ts at master · atlassian-labs/compiled , it iterates through all of the references to css({}).

Example:

const foo = csscolor: 'red';; // @compiled/no-exported-css throws because bar references foo and bar is exported export const bar = ${foo}

Same thing in our case here

const foo = csscolor: 'red';; // @compiled/no-exported-css throws as well export export const bar = styled.div${foo}

Adjust the linting rule to allows the 2nd scenario because exporting a component is legit.

pancaspe87 avatar Nov 29 '22 05:11 pancaspe87