jaredly / jaredly/stylecleanup

Empty styles object are not getting deleted

Open
#3 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
112
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Suppose the style:

`const styles = StyleSheet.create({
header: {
paddingTop: 15,
flexDirection: 'row',
height: 40,
backgroundColor: '#D8D8D8'
},
headerLabel: {
marginLeft: 16,
fontFamily: 'Roboto-Medium',
color: 'rgba(0, 0, 0, 0.4)',
fontSize: 14,
},
headerImage: {
color: 'rgba(0, 0, 0, 0.4)',
position: 'absolute',
right: 16,
}
});`

After fixing it with the tool(suppose all of the styles are not used) the code becomes:

`const styles = StyleSheet.create({
});`

which is meaningless.

Would be great to have this thing removed as well(in case no references to styles are made).

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported example where unused styles leave an empty StyleSheet.create object, then trace the cleanup tool's handling of the containing styles declaration. Done means the declaration is removed when no style references remain, rather than leaving an empty object; the payload names no source file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.