Max Ferreira
Max Ferreira

Reputation: 719

Find usages const styled project

How to search const that are not being used in my project from a styled-componet file?

export const Page(not usage) = styled(Container)`
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    padding-left: 16;
    padding-right: 16;
    background: ${colors.theme};
`;

Can be in visual studio code or intellij _______________________________________________________

UPDATED

My style.js

// Not being exported vscode will detect
const Component = styled.View`
    flex: 1;
    flex-direction: column;
`;

export default {
    Component,
}

My page.js

import Style from './Style';

<Style.Component> </Style.Component>

Upvotes: 0

Views: 42

Answers (2)

lena
lena

Reputation: 93828

IDEA reports const as unused unless it's imported in the other module:

enter image description here

Upvotes: 1

hong developer
hong developer

Reputation: 13926

This is just my suggestion. If you manage your style file separately and you call it up and use it,

Recall the style as a whole This softens the style not used in Visual Studio Code.

Example styles

Upvotes: 1

Related Questions