pickier-vscode 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscodeignore +14 -0
- package/README.md +102 -0
- package/build.ts +14 -0
- package/docs/USAGE.md +213 -0
- package/examples/01-hover-help-text.ts +58 -0
- package/examples/02-codelens-annotations.ts +50 -0
- package/examples/03-code-actions.ts +70 -0
- package/examples/04-problems-panel.ts +67 -0
- package/examples/05-import-issues.ts +35 -0
- package/examples/06-all-severities.ts +60 -0
- package/examples/07-auto-fixable-vs-manual.ts +69 -0
- package/examples/08-disable-comments.ts +73 -0
- package/examples/09-clean-file.ts +65 -0
- package/examples/10-comprehensive-test.ts +153 -0
- package/examples/README.md +336 -0
- package/examples/advanced-config.ts +116 -0
- package/examples/basic-config.ts +38 -0
- package/examples/team-config.ts +179 -0
- package/examples/vscode-settings.json +88 -0
- package/package.json +231 -0
- package/src/code-actions.ts +310 -0
- package/src/codelens.ts +156 -0
- package/src/commands.ts +120 -0
- package/src/config.ts +128 -0
- package/src/diagnostics.ts +256 -0
- package/src/extension.ts +473 -0
- package/src/formatter.ts +75 -0
- package/src/hover.ts +108 -0
- package/src/index.ts +8 -0
- package/src/status-bar.ts +125 -0
- package/test/code-actions.test.ts +298 -0
- package/test/commands.test.ts +131 -0
- package/test/config.test.ts +223 -0
- package/test/diagnostics.test.ts +102 -0
- package/test/extension.test.ts +111 -0
- package/test/fixtures/edge-case-boundary.ts +101 -0
- package/test/fixtures/edge-case-comments.ts +50 -0
- package/test/fixtures/edge-case-multiline-constructs.ts +108 -0
- package/test/fixtures/edge-case-nested-structures.ts +78 -0
- package/test/fixtures/edge-case-real-world.ts +103 -0
- package/test/fixtures/edge-case-strings-templates.ts +56 -0
- package/test/fixtures/edge-case-unicode-special.ts +64 -0
- package/test/fixtures/fixable.ts +4 -0
- package/test/fixtures/format-indent.ts +22 -0
- package/test/fixtures/format-quotes.ts +12 -0
- package/test/fixtures/format-semi.ts +43 -0
- package/test/fixtures/format-whitespace.ts +19 -0
- package/test/fixtures/lint-cond-assign.ts +34 -0
- package/test/fixtures/lint-debugger-console.ts +34 -0
- package/test/fixtures/lint-errors.ts +10 -0
- package/test/fixtures/no-errors.ts +4 -0
- package/test/fixtures/pickier-import-dedupe.ts +14 -0
- package/test/fixtures/pickier-import-paths.ts +20 -0
- package/test/fixtures/pickier-no-unused-vars.ts +44 -0
- package/test/fixtures/pickier-prefer-const.ts +29 -0
- package/test/fixtures/pickier-sort-exports.ts +28 -0
- package/test/fixtures/pickier-sort-heritage-clauses.ts +40 -0
- package/test/fixtures/pickier-sort-imports.ts +22 -0
- package/test/fixtures/pickier-sort-objects.ts +37 -0
- package/test/fixtures/pickier-top-level-function.ts +37 -0
- package/test/fixtures/regexp-rules.ts +32 -0
- package/test/fixtures/style-consistent-chaining.ts +37 -0
- package/test/fixtures/style-consistent-list-newline.ts +49 -0
- package/test/fixtures/style-curly.ts +36 -0
- package/test/fixtures/style-if-newline.ts +34 -0
- package/test/fixtures/style-statements-per-line.ts +22 -0
- package/test/fixtures/ts-no-require.ts +21 -0
- package/test/fixtures/ts-no-top-level-await.ts +28 -0
- package/test/fixtures/ts-no-ts-export-equal.ts +19 -0
- package/test/fixtures/unordered-imports.ts +6 -0
- package/test/fixtures.test.ts +750 -0
- package/test/formatter.test.ts +79 -0
- package/test/index.test.ts +45 -0
- package/test/status-bar.test.ts +57 -0
- package/test/utils/pickier-mock.ts +14 -0
- package/test/utils/vscode-mock.ts +279 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example 7: Auto-fixable vs Manual Fixes
|
|
3
|
+
*
|
|
4
|
+
* HOW TO TEST:
|
|
5
|
+
* 1. CodeLens shows how many issues are auto-fixable
|
|
6
|
+
* 2. Hover shows ✨ icon for auto-fixable issues
|
|
7
|
+
* 3. Code actions show "Fix" option only for auto-fixable
|
|
8
|
+
* 4. Click "Fix all" to fix only auto-fixable issues
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ============================================
|
|
12
|
+
// AUTO-FIXABLE ISSUES (✨)
|
|
13
|
+
// ============================================
|
|
14
|
+
|
|
15
|
+
// Auto-fix 1: debugger removal
|
|
16
|
+
function autoFix1() {
|
|
17
|
+
debugger // ✨ Can be auto-removed
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Auto-fix 2: prefer-const
|
|
21
|
+
function autoFix2() {
|
|
22
|
+
let x = 10 // ✨ Can change to const
|
|
23
|
+
return x
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Auto-fix 3: string concatenation → template literal
|
|
27
|
+
function autoFix3() {
|
|
28
|
+
const name = 'World'
|
|
29
|
+
const msg = 'Hello ' + name // ✨ Can convert to template
|
|
30
|
+
return msg
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Auto-fix 4: quote style
|
|
34
|
+
function autoFix4() {
|
|
35
|
+
const text = "double quotes" // ✨ Can change to single
|
|
36
|
+
return text
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ============================================
|
|
40
|
+
// MANUAL FIXES REQUIRED (no auto-fix)
|
|
41
|
+
// ============================================
|
|
42
|
+
|
|
43
|
+
// Manual 1: unused variable
|
|
44
|
+
// Cannot auto-fix - need to decide: use it, remove it, or prefix with _
|
|
45
|
+
function manualFix1() {
|
|
46
|
+
const unused = 'value'
|
|
47
|
+
return 42
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Manual 2: unused parameters
|
|
51
|
+
// Cannot auto-fix - need developer decision
|
|
52
|
+
function manualFix2(param1: string, unusedParam: number) {
|
|
53
|
+
return param1
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Manual 3: console.log (could auto-remove, but needs decision)
|
|
57
|
+
function manualFix3() {
|
|
58
|
+
console.log('Is this debug or intentional?')
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* ✅ EXPECTED RESULTS:
|
|
63
|
+
* - CodeLens: "⚠️ Pickier: X errors, Y warnings (4 auto-fixable)"
|
|
64
|
+
* - Hover on auto-fixable shows: "✨ Auto-fix available"
|
|
65
|
+
* - Hover on manual shows help but no ✨ icon
|
|
66
|
+
* - Code actions on auto-fixable show "Fix: [description]"
|
|
67
|
+
* - Code actions on manual show "Disable" but not "Fix"
|
|
68
|
+
* - "Fix all" fixes only the 4 auto-fixable issues
|
|
69
|
+
*/
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example 8: Disable Comments
|
|
3
|
+
*
|
|
4
|
+
* HOW TO TEST:
|
|
5
|
+
* 1. Use code actions to add disable comments
|
|
6
|
+
* 2. See how different disable options work
|
|
7
|
+
* 3. Test "Disable for this line" action
|
|
8
|
+
* 4. Test "Disable for entire file" action
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ============================================
|
|
12
|
+
// EXAMPLE: Disable for specific line
|
|
13
|
+
// ============================================
|
|
14
|
+
|
|
15
|
+
// To test:
|
|
16
|
+
// 1. Put cursor on 'debugger' below
|
|
17
|
+
// 2. Press Cmd+.
|
|
18
|
+
// 3. Select "Disable no-debugger for this line"
|
|
19
|
+
// 4. Comment will be added above
|
|
20
|
+
|
|
21
|
+
function test1() {
|
|
22
|
+
debugger // Try disabling this
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// After applying "Disable for this line", it becomes:
|
|
26
|
+
function test1Fixed() {
|
|
27
|
+
// eslint-disable-next-line no-debugger
|
|
28
|
+
debugger
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ============================================
|
|
32
|
+
// EXAMPLE: Disable for entire file
|
|
33
|
+
// ============================================
|
|
34
|
+
|
|
35
|
+
// To test:
|
|
36
|
+
// 1. Put cursor on any console.log below
|
|
37
|
+
// 2. Press Cmd+.
|
|
38
|
+
// 3. Select "Disable no-console for entire file"
|
|
39
|
+
// 4. Comment will be added at TOP of file
|
|
40
|
+
|
|
41
|
+
function test2() {
|
|
42
|
+
console.log('test 1')
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function test3() {
|
|
46
|
+
console.log('test 2')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// After applying "Disable for entire file", the TOP of this file gets:
|
|
50
|
+
/* eslint-disable no-console */
|
|
51
|
+
|
|
52
|
+
// ============================================
|
|
53
|
+
// EXAMPLE: Disable multiple rules
|
|
54
|
+
// ============================================
|
|
55
|
+
|
|
56
|
+
function test4() {
|
|
57
|
+
debugger // Disable no-debugger
|
|
58
|
+
const unused = 'value' // Disable no-unused-vars
|
|
59
|
+
console.log('debug') // Disable no-console
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// You can disable multiple rules:
|
|
63
|
+
// eslint-disable-next-line no-debugger, no-console
|
|
64
|
+
// Or use separate comments for each
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* ✅ EXPECTED RESULTS:
|
|
68
|
+
* - "Disable for this line" adds comment above the issue
|
|
69
|
+
* - "Disable for entire file" adds comment at top
|
|
70
|
+
* - After disabling, the diagnostic disappears
|
|
71
|
+
* - CodeLens updates to show fewer issues
|
|
72
|
+
* - Can re-enable by removing the comment
|
|
73
|
+
*/
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example 9: Clean File (No Issues)
|
|
3
|
+
*
|
|
4
|
+
* HOW TO TEST:
|
|
5
|
+
* 1. Open this file
|
|
6
|
+
* 2. See CodeLens showing: "✓ Pickier: No issues found"
|
|
7
|
+
* 3. No squiggly underlines
|
|
8
|
+
* 4. Problems panel shows no issues for this file
|
|
9
|
+
* 5. This demonstrates what a "perfect" file looks like
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// ✅ Proper const usage (not let)
|
|
13
|
+
const PI = 3.14159
|
|
14
|
+
|
|
15
|
+
// ✅ All variables are used
|
|
16
|
+
function calculateArea(radius: number): number {
|
|
17
|
+
const area = PI * radius * radius
|
|
18
|
+
return area
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// ✅ Using template literals (not concatenation)
|
|
22
|
+
function greet(name: string): string {
|
|
23
|
+
return `Hello, ${name}!`
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ✅ No debugger statements
|
|
27
|
+
function debug(value: unknown): void {
|
|
28
|
+
// Use proper logging instead of console.log
|
|
29
|
+
if (process.env.NODE_ENV === 'development') {
|
|
30
|
+
// Conditional logging is okay
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ✅ No unused variables
|
|
35
|
+
function compute(x: number, y: number): number {
|
|
36
|
+
const sum = x + y
|
|
37
|
+
const product = x * y
|
|
38
|
+
return sum + product // Both variables are used
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ✅ Proper single quotes
|
|
42
|
+
const message = 'This uses single quotes consistently'
|
|
43
|
+
|
|
44
|
+
// ✅ All parameters are used
|
|
45
|
+
function fullName(first: string, last: string): string {
|
|
46
|
+
return `${first} ${last}`
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* ✅ EXPECTED RESULTS:
|
|
51
|
+
* - CodeLens: "$(check) Pickier: No issues found"
|
|
52
|
+
* - No squiggly underlines anywhere
|
|
53
|
+
* - No items in Problems panel for this file
|
|
54
|
+
* - Hover on any code shows no diagnostics
|
|
55
|
+
* - This is the target state for all files!
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
calculateArea,
|
|
60
|
+
greet,
|
|
61
|
+
debug,
|
|
62
|
+
compute,
|
|
63
|
+
message,
|
|
64
|
+
fullName,
|
|
65
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example 10: Comprehensive Feature Test
|
|
3
|
+
*
|
|
4
|
+
* This file combines EVERYTHING to test all features at once:
|
|
5
|
+
* - Rich hover with help text
|
|
6
|
+
* - CodeLens with stats and actions
|
|
7
|
+
* - Multiple code action types
|
|
8
|
+
* - Problems panel integration
|
|
9
|
+
* - Auto-fixable vs manual issues
|
|
10
|
+
* - Different severity levels
|
|
11
|
+
*
|
|
12
|
+
* HOW TO TEST:
|
|
13
|
+
* 1. Open this file
|
|
14
|
+
* 2. See CodeLens at top with full stats
|
|
15
|
+
* 3. Hover over each issue - see rich help text
|
|
16
|
+
* 4. Try code actions (Cmd+.) on different issues
|
|
17
|
+
* 5. Check Problems panel for all issues
|
|
18
|
+
* 6. Click "Fix all" in CodeLens
|
|
19
|
+
* 7. See how file transforms
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// ============================================
|
|
23
|
+
// SECTION 1: Built-in Rules
|
|
24
|
+
// ============================================
|
|
25
|
+
|
|
26
|
+
// Issue 1: debugger (ERROR, auto-fixable)
|
|
27
|
+
// Hover: See help about removing debugger
|
|
28
|
+
// Code action: Fix, Disable line, Disable file, View docs
|
|
29
|
+
function section1a() {
|
|
30
|
+
debugger
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Issue 2: console.log (WARNING, not auto-fixed by default)
|
|
34
|
+
// Hover: See help about using proper logging
|
|
35
|
+
function section1b() {
|
|
36
|
+
console.log('debug message')
|
|
37
|
+
console.warn('warning message')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Issue 3: template curly in string (ERROR, auto-fixable)
|
|
41
|
+
// Hover: See help about using backticks
|
|
42
|
+
function section1c() {
|
|
43
|
+
const value = 42
|
|
44
|
+
const msg = "Value is ${value}"
|
|
45
|
+
return msg
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ============================================
|
|
49
|
+
// SECTION 2: Pickier Plugin Rules
|
|
50
|
+
// ============================================
|
|
51
|
+
|
|
52
|
+
// Issue 4: no-unused-vars (ERROR, NOT auto-fixable)
|
|
53
|
+
// Hover: See help about using, removing, or prefixing with _
|
|
54
|
+
function section2a() {
|
|
55
|
+
const unused1 = 'not used'
|
|
56
|
+
const unused2 = 42
|
|
57
|
+
return 0
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Issue 5: prefer-const (ERROR, auto-fixable)
|
|
61
|
+
// Hover: See help about using const
|
|
62
|
+
// Code action: Changes let to const
|
|
63
|
+
function section2b() {
|
|
64
|
+
let neverReassigned = 100
|
|
65
|
+
let alsoNeverChanged = 200
|
|
66
|
+
return neverReassigned + alsoNeverChanged
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Issue 6: prefer-template (WARNING, auto-fixable)
|
|
70
|
+
// Hover: See help about template literals
|
|
71
|
+
// Code action: Converts to `Hello ${name}!`
|
|
72
|
+
function section2c() {
|
|
73
|
+
const name = 'World'
|
|
74
|
+
const greeting = 'Hello ' + name + '!'
|
|
75
|
+
return greeting
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ============================================
|
|
79
|
+
// SECTION 3: Style Rules
|
|
80
|
+
// ============================================
|
|
81
|
+
|
|
82
|
+
// Issue 7: quote style (WARNING, auto-fixable)
|
|
83
|
+
// Hover: See help about using single quotes
|
|
84
|
+
function section3a() {
|
|
85
|
+
const text1 = "should be single quotes"
|
|
86
|
+
const text2 = "also double"
|
|
87
|
+
return text1 + text2
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Issue 8: indentation (if misconfigured)
|
|
91
|
+
// This example assumes proper indentation, but test by adding spaces
|
|
92
|
+
|
|
93
|
+
// ============================================
|
|
94
|
+
// SECTION 4: Complex Scenarios
|
|
95
|
+
// ============================================
|
|
96
|
+
|
|
97
|
+
// Issue 9: Multiple issues in one function
|
|
98
|
+
function section4a() {
|
|
99
|
+
debugger // ERROR: debugger
|
|
100
|
+
const unused = 'value' // ERROR: unused var
|
|
101
|
+
let x = 10 // ERROR: prefer-const
|
|
102
|
+
console.log(x) // WARNING: console
|
|
103
|
+
const msg = "Hello " + "World" // WARNING: quotes + prefer-template
|
|
104
|
+
return msg
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Issue 10: Nested issues
|
|
108
|
+
function section4b() {
|
|
109
|
+
if (true) {
|
|
110
|
+
debugger
|
|
111
|
+
const temp = 'unused'
|
|
112
|
+
let y = 20
|
|
113
|
+
return y
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* ✅ COMPREHENSIVE TEST RESULTS:
|
|
119
|
+
*
|
|
120
|
+
* 1. CodeLens at top shows:
|
|
121
|
+
* "⚠️ Pickier: ~15 errors, ~8 warnings (~12 auto-fixable)"
|
|
122
|
+
* "🔧 Fix all ~12 auto-fixable issues"
|
|
123
|
+
*
|
|
124
|
+
* 2. Hovering over each issue shows:
|
|
125
|
+
* - Rule ID with severity icon
|
|
126
|
+
* - Descriptive message
|
|
127
|
+
* - Detailed help text
|
|
128
|
+
* - Auto-fix indicator (✨) if fixable
|
|
129
|
+
* - Links to docs and disable options
|
|
130
|
+
*
|
|
131
|
+
* 3. Code actions (Cmd+.) show:
|
|
132
|
+
* - Fix option (for auto-fixable issues)
|
|
133
|
+
* - Disable for this line
|
|
134
|
+
* - Disable for entire file
|
|
135
|
+
* - View documentation
|
|
136
|
+
*
|
|
137
|
+
* 4. Problems panel shows:
|
|
138
|
+
* - All issues grouped by severity
|
|
139
|
+
* - Click each issue to see help text
|
|
140
|
+
* - Can trigger fixes from panel
|
|
141
|
+
*
|
|
142
|
+
* 5. After clicking "Fix all":
|
|
143
|
+
* - All debugger statements removed
|
|
144
|
+
* - All let → const conversions
|
|
145
|
+
* - All string concatenation → template literals
|
|
146
|
+
* - All double quotes → single quotes
|
|
147
|
+
* - Remaining: unused variables (manual fix needed)
|
|
148
|
+
*
|
|
149
|
+
* 6. Final state:
|
|
150
|
+
* - CodeLens: "⚠️ Pickier: ~3 errors, ~1 warning"
|
|
151
|
+
* - Only non-auto-fixable issues remain
|
|
152
|
+
* - Much cleaner code!
|
|
153
|
+
*/
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# Pickier VS Code Extension - Example Files
|
|
2
|
+
|
|
3
|
+
This folder contains comprehensive example files to test all features of the Pickier VS Code extension.
|
|
4
|
+
|
|
5
|
+
## How to Test
|
|
6
|
+
|
|
7
|
+
### Step 1: Launch Extension Development Host
|
|
8
|
+
|
|
9
|
+
1. Open this workspace in VS Code
|
|
10
|
+
2. Go to Run and Debug (Cmd+Shift+D)
|
|
11
|
+
3. Select "Run Extension" from the dropdown
|
|
12
|
+
4. Click the green play button (or press F5)
|
|
13
|
+
5. A new VS Code window will open with "[Extension Development Host]" in the title
|
|
14
|
+
|
|
15
|
+
### Step 2: Open Example Files
|
|
16
|
+
|
|
17
|
+
In the Extension Development Host window:
|
|
18
|
+
|
|
19
|
+
1. Open the examples folder: `/packages/vscode/examples/`
|
|
20
|
+
2. Open any example file (`.ts` files numbered 01-10)
|
|
21
|
+
3. Each file is self-contained and demonstrates specific features
|
|
22
|
+
|
|
23
|
+
### Step 3: Test Features
|
|
24
|
+
|
|
25
|
+
Each example file contains detailed instructions at the top. Follow the "HOW TO TEST" section in each file.
|
|
26
|
+
|
|
27
|
+
## Example Files Overview
|
|
28
|
+
|
|
29
|
+
### 01-hover-help-text.ts
|
|
30
|
+
**Tests:** Rich hover tooltips with help text
|
|
31
|
+
|
|
32
|
+
**Features:**
|
|
33
|
+
- Hover over any underlined issue
|
|
34
|
+
- See rule ID with severity icon
|
|
35
|
+
- Read descriptive help text
|
|
36
|
+
- See auto-fix indicator (✨) when available
|
|
37
|
+
- Links to disable options
|
|
38
|
+
|
|
39
|
+
**What to look for:**
|
|
40
|
+
- Rich markdown-formatted hover tooltips
|
|
41
|
+
- Blue help text explaining how to fix
|
|
42
|
+
- Different icons for errors (🔴) vs warnings (🟡)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### 02-codelens-annotations.ts
|
|
47
|
+
**Tests:** CodeLens annotations and stats
|
|
48
|
+
|
|
49
|
+
**Features:**
|
|
50
|
+
- File-level issue summary at top of file
|
|
51
|
+
- "Fix all" button for auto-fixable issues
|
|
52
|
+
- "Organize Imports" button
|
|
53
|
+
- Real-time updates as you fix issues
|
|
54
|
+
|
|
55
|
+
**What to look for:**
|
|
56
|
+
- CodeLens appears above first line of code
|
|
57
|
+
- Shows count: "⚠️ Pickier: X errors, Y warnings (Z auto-fixable)"
|
|
58
|
+
- Clickable buttons that trigger actions
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### 03-code-actions.ts
|
|
63
|
+
**Tests:** All 4 types of code actions
|
|
64
|
+
|
|
65
|
+
**Features:**
|
|
66
|
+
- Fix action (for auto-fixable issues)
|
|
67
|
+
- Disable for this line
|
|
68
|
+
- Disable for entire file
|
|
69
|
+
- View documentation
|
|
70
|
+
|
|
71
|
+
**What to look for:**
|
|
72
|
+
- Put cursor on any issue
|
|
73
|
+
- Press Cmd+. (or right-click → Quick Fix)
|
|
74
|
+
- See all available actions for that issue type
|
|
75
|
+
- Actions apply correctly
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### 04-problems-panel.ts
|
|
80
|
+
**Tests:** Problems panel integration
|
|
81
|
+
|
|
82
|
+
**Features:**
|
|
83
|
+
- All issues appear in Problems panel
|
|
84
|
+
- Grouped by severity (Errors / Warnings)
|
|
85
|
+
- Click issue to navigate to code
|
|
86
|
+
- See full help text in problem details
|
|
87
|
+
|
|
88
|
+
**What to look for:**
|
|
89
|
+
- Open Problems panel (Cmd+Shift+M)
|
|
90
|
+
- See all 6+ issues listed
|
|
91
|
+
- Click on issue to jump to location
|
|
92
|
+
- Expand issue to see help text
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### 05-import-issues.ts
|
|
97
|
+
**Tests:** Import organization features
|
|
98
|
+
|
|
99
|
+
**Features:**
|
|
100
|
+
- Detect unordered imports
|
|
101
|
+
- Detect duplicate imports
|
|
102
|
+
- "Organize Imports" CodeLens action
|
|
103
|
+
- Auto-fix import sorting
|
|
104
|
+
|
|
105
|
+
**What to look for:**
|
|
106
|
+
- CodeLens shows "📦 Organize Imports"
|
|
107
|
+
- Issues reported for unordered/duplicate imports
|
|
108
|
+
- Click "Organize Imports" to fix all import issues
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### 06-all-severities.ts
|
|
113
|
+
**Tests:** Different severity levels
|
|
114
|
+
|
|
115
|
+
**Features:**
|
|
116
|
+
- Error severity (red squiggly lines)
|
|
117
|
+
- Warning severity (yellow squiggly lines)
|
|
118
|
+
- Different icons in hover tooltips
|
|
119
|
+
- Problems panel groups by severity
|
|
120
|
+
|
|
121
|
+
**What to look for:**
|
|
122
|
+
- Red underlines for errors (debugger, unused vars, prefer-const)
|
|
123
|
+
- Yellow underlines for warnings (console.log, quotes, prefer-template)
|
|
124
|
+
- CodeLens shows both: "3 errors, 3 warnings"
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### 07-auto-fixable-vs-manual.ts
|
|
129
|
+
**Tests:** Auto-fix detection and behavior
|
|
130
|
+
|
|
131
|
+
**Features:**
|
|
132
|
+
- Auto-fixable issues show ✨ icon
|
|
133
|
+
- Manual issues don't show ✨
|
|
134
|
+
- "Fix all" only fixes auto-fixable issues
|
|
135
|
+
- Help text explains manual fix steps
|
|
136
|
+
|
|
137
|
+
**What to look for:**
|
|
138
|
+
- Hover on auto-fixable: see "✨ Auto-fix available"
|
|
139
|
+
- Hover on manual: no ✨ icon, detailed manual instructions
|
|
140
|
+
- Click "Fix all" in CodeLens: only auto-fixable issues are fixed
|
|
141
|
+
- Manual issues remain with helpful guidance
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### 08-disable-comments.ts
|
|
146
|
+
**Tests:** Disable comment actions
|
|
147
|
+
|
|
148
|
+
**Features:**
|
|
149
|
+
- "Disable for this line" adds `// eslint-disable-next-line`
|
|
150
|
+
- "Disable for entire file" adds `/* eslint-disable */` at top
|
|
151
|
+
- Disabled issues disappear from diagnostics
|
|
152
|
+
|
|
153
|
+
**What to look for:**
|
|
154
|
+
- Use code action to disable a rule
|
|
155
|
+
- See disable comment added to file
|
|
156
|
+
- Issue disappears from Problems panel
|
|
157
|
+
- CodeLens updates to show fewer issues
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
### 09-clean-file.ts
|
|
162
|
+
**Tests:** "No issues" state
|
|
163
|
+
|
|
164
|
+
**Features:**
|
|
165
|
+
- CodeLens shows "✓ Pickier: No issues found"
|
|
166
|
+
- No squiggly underlines anywhere
|
|
167
|
+
- Empty Problems panel
|
|
168
|
+
- Demonstrates what a "perfect" file looks like
|
|
169
|
+
|
|
170
|
+
**What to look for:**
|
|
171
|
+
- Green checkmark (✓) in CodeLens
|
|
172
|
+
- "No issues found" message
|
|
173
|
+
- Clean, issue-free code
|
|
174
|
+
- This is the target state!
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### 10-comprehensive-test.ts
|
|
179
|
+
**Tests:** All features combined
|
|
180
|
+
|
|
181
|
+
**Features:**
|
|
182
|
+
- Multiple issue types in one file
|
|
183
|
+
- Mix of errors and warnings
|
|
184
|
+
- Mix of auto-fixable and manual issues
|
|
185
|
+
- Nested issues
|
|
186
|
+
- Complex scenarios
|
|
187
|
+
|
|
188
|
+
**What to look for:**
|
|
189
|
+
- CodeLens: "⚠️ Pickier: ~15 errors, ~8 warnings (~12 auto-fixable)"
|
|
190
|
+
- Test all features: hover, code actions, problems panel
|
|
191
|
+
- Click "Fix all" and watch file transform
|
|
192
|
+
- See remaining manual issues with help text
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Testing Workflow
|
|
197
|
+
|
|
198
|
+
### Recommended Testing Order:
|
|
199
|
+
|
|
200
|
+
1. **Start with 09-clean-file.ts**
|
|
201
|
+
- See what "perfect" looks like
|
|
202
|
+
- Understand the baseline
|
|
203
|
+
|
|
204
|
+
2. **Test 01-hover-help-text.ts**
|
|
205
|
+
- Get familiar with hover tooltips
|
|
206
|
+
- See how help text appears
|
|
207
|
+
|
|
208
|
+
3. **Test 02-codelens-annotations.ts**
|
|
209
|
+
- Understand CodeLens display
|
|
210
|
+
- Try "Fix all" button
|
|
211
|
+
|
|
212
|
+
4. **Test 03-code-actions.ts**
|
|
213
|
+
- Learn all 4 action types
|
|
214
|
+
- Practice using Cmd+.
|
|
215
|
+
|
|
216
|
+
5. **Test remaining files (04-08)**
|
|
217
|
+
- Explore specific features
|
|
218
|
+
- Test edge cases
|
|
219
|
+
|
|
220
|
+
6. **Finish with 10-comprehensive-test.ts**
|
|
221
|
+
- Complete integration test
|
|
222
|
+
- See all features working together
|
|
223
|
+
|
|
224
|
+
### Common Testing Actions:
|
|
225
|
+
|
|
226
|
+
- **Trigger hover:** Move mouse over underlined code
|
|
227
|
+
- **Trigger code actions:** Put cursor on issue, press Cmd+. (or Ctrl+. on Windows/Linux)
|
|
228
|
+
- **View problems:** Press Cmd+Shift+M to open Problems panel
|
|
229
|
+
- **Test CodeLens:** Look at top of file, click buttons
|
|
230
|
+
- **Test fixes:** Click "Fix all" or use individual fix actions
|
|
231
|
+
|
|
232
|
+
## Expected Features
|
|
233
|
+
|
|
234
|
+
When testing, you should see these features working:
|
|
235
|
+
|
|
236
|
+
### ✅ Rich Hover Tooltips
|
|
237
|
+
- Shows rule ID with icon
|
|
238
|
+
- Displays descriptive message
|
|
239
|
+
- Includes help text (blue)
|
|
240
|
+
- Shows auto-fix indicator (✨)
|
|
241
|
+
- Links to disable options
|
|
242
|
+
|
|
243
|
+
### ✅ CodeLens Annotations
|
|
244
|
+
- File-level stats at top
|
|
245
|
+
- Issue count by severity
|
|
246
|
+
- Auto-fixable count
|
|
247
|
+
- Clickable "Fix all" button
|
|
248
|
+
- "Organize Imports" button
|
|
249
|
+
|
|
250
|
+
### ✅ Enhanced Code Actions
|
|
251
|
+
- Fix (for auto-fixable issues)
|
|
252
|
+
- Disable for this line
|
|
253
|
+
- Disable for entire file
|
|
254
|
+
- View documentation
|
|
255
|
+
|
|
256
|
+
### ✅ Problems Panel Integration
|
|
257
|
+
- All issues listed
|
|
258
|
+
- Grouped by severity
|
|
259
|
+
- Click to navigate
|
|
260
|
+
- Full help text in details
|
|
261
|
+
|
|
262
|
+
### ✅ Smart Diagnostics
|
|
263
|
+
- Red underlines for errors
|
|
264
|
+
- Yellow underlines for warnings
|
|
265
|
+
- Related information for help text
|
|
266
|
+
- Real-time updates
|
|
267
|
+
|
|
268
|
+
## Configuration Examples
|
|
269
|
+
|
|
270
|
+
This folder also contains configuration examples:
|
|
271
|
+
|
|
272
|
+
- **basic-config.ts** - Minimal setup for getting started
|
|
273
|
+
- **advanced-config.ts** - Comprehensive setup with advanced features
|
|
274
|
+
- **team-config.ts** - Strict configuration for team environments
|
|
275
|
+
- **vscode-settings.json** - Example VS Code workspace settings
|
|
276
|
+
|
|
277
|
+
See the individual files for details on each configuration option.
|
|
278
|
+
|
|
279
|
+
## Troubleshooting
|
|
280
|
+
|
|
281
|
+
### Extension not loading?
|
|
282
|
+
- Make sure you're in the Extension Development Host window
|
|
283
|
+
- Check the Debug Console for errors
|
|
284
|
+
- Try restarting the extension (Cmd+Shift+P → "Developer: Reload Window")
|
|
285
|
+
|
|
286
|
+
### No issues showing?
|
|
287
|
+
- Make sure Pickier is enabled in settings
|
|
288
|
+
- Check that the file is saved
|
|
289
|
+
- Verify the file is TypeScript/JavaScript
|
|
290
|
+
|
|
291
|
+
### CodeLens not appearing?
|
|
292
|
+
- Check setting: `pickier.codeLens.enable` should be `true`
|
|
293
|
+
- Try reloading the window
|
|
294
|
+
- Ensure file has issues or is clean (CodeLens shows in both cases)
|
|
295
|
+
|
|
296
|
+
### Hover not working?
|
|
297
|
+
- Hover directly over the underlined code
|
|
298
|
+
- Wait a moment for tooltip to appear
|
|
299
|
+
- Check that there are diagnostics for that line
|
|
300
|
+
|
|
301
|
+
## Configuration
|
|
302
|
+
|
|
303
|
+
You can customize extension behavior in VS Code settings:
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"pickier.enable": true,
|
|
308
|
+
"pickier.run": "onSave",
|
|
309
|
+
"pickier.codeLens.enable": true,
|
|
310
|
+
"pickier.packageManager": "auto"
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
See `package.json` in the extension root for all available settings.
|
|
315
|
+
|
|
316
|
+
## Feedback
|
|
317
|
+
|
|
318
|
+
After testing, consider:
|
|
319
|
+
- Which features are most useful?
|
|
320
|
+
- Are there any missing features?
|
|
321
|
+
- Is the help text clear and actionable?
|
|
322
|
+
- Are the code actions discoverable?
|
|
323
|
+
- Is the CodeLens helpful or distracting?
|
|
324
|
+
|
|
325
|
+
## Next Steps
|
|
326
|
+
|
|
327
|
+
After testing these examples:
|
|
328
|
+
|
|
329
|
+
1. Try the extension on your real codebase
|
|
330
|
+
2. Customize Pickier config (`pickier.config.ts`) for your needs
|
|
331
|
+
3. Report any issues or suggestions
|
|
332
|
+
4. Enjoy fast, helpful linting!
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
**Note:** These example files intentionally contain issues to demonstrate extension features. Don't be alarmed by the red and yellow squiggly lines - they're there for testing!
|