Skip to content

Commit b8aa47f

Browse files
authored
[Patch] Handle edge cases (#4)
* Improve unused style detection and add comprehensive tests - Refactors the extension to enhance detection of unused styles, including improved handling of destructuring, spread, and direct usage cases. - Adds debounce for diagnostics, robust text edit logic, and better error handling. - Updates VSCode settings for Biome code actions. Introduces a comprehensive test suite covering style detection, usage analysis, and integration with autoCleanOnSave, ensuring reliability and correctness of the extension's core features. * Support autoCleanOnSave in directory hierarchy - Added logic to search for the 'react-native-stylesheet-cleaner.autoCleanOnSave' setting in .vscode/settings.json files up the directory tree, enabling support for multi-project workspaces. - Also updated package.json to set a configuration title and scope for the setting. * Update extension.ts * Update extension.test.ts
1 parent 5e1a634 commit b8aa47f

File tree

5 files changed

+1028
-190
lines changed

5 files changed

+1028
-190
lines changed

.claude/settings.local.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(pnpm run compile:*)",
5+
"Bash(pnpm run test:*)",
6+
"Bash(pnpm test:*)"
7+
]
8+
}
9+
}

.vscode/settings.json

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
{
2-
"files.exclude": {
3-
"out": false,
4-
"dist": false
5-
},
6-
"search.exclude": {
7-
"out": true,
8-
"dist": true
9-
},
10-
"typescript.tsc.autoDetect": "off",
11-
"editor.tabSize": 2,
12-
"editor.detectIndentation": false,
13-
"editor.rulers": [120],
14-
"editor.defaultFormatter": "biomejs.biome",
15-
"editor.codeActionsOnSave": {
16-
"source.organizeImports.biome": "explicit",
17-
"source.removeUnusedImports": "always",
18-
"quickfix.biome": "explicit"
19-
}
20-
}
2+
"files.exclude": {
3+
"out": false,
4+
"dist": false
5+
},
6+
"search.exclude": {
7+
"out": true,
8+
"dist": true
9+
},
10+
"typescript.tsc.autoDetect": "off",
11+
"editor.tabSize": 2,
12+
"editor.detectIndentation": false,
13+
"editor.rulers": [120],
14+
"editor.defaultFormatter": "biomejs.biome",
15+
"editor.codeActionsOnSave": {
16+
"source.organizeImports.biome": "explicit",
17+
"source.removeUnusedImports": "always",
18+
"source.fixAll.biome": "explicit",
19+
"source.biome": "explicit"
20+
}
21+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@
4444
"main": "./dist/extension.js",
4545
"contributes": {
4646
"configuration": {
47-
"type": "object",
47+
"title": "React Native StyleSheet Cleaner",
4848
"properties": {
4949
"react-native-stylesheet-cleaner.autoCleanOnSave": {
5050
"type": "boolean",
5151
"default": false,
52+
"scope": "resource",
5253
"description": "Automatically clean unused styles on file save."
5354
}
5455
}

0 commit comments

Comments
 (0)