You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Picks up the new autofixable sort-source-methods rule from
socket-wheelhouse and the identifier-based _inject-import.js fix
(resolves task #65 / #64). Iterated `oxlint --fix` to convergence;
function declarations re-ordered into private→export alphanumeric
order across the repo. Function declarations are hoisted so the
rewrite is safe at runtime; leading JSDoc / line-comments and
trailing c8-ignore-stop markers travel with each function.
Also re-syncs the canonical scripts/check-paths.mts and
scripts/ai-lint-fix.mts from socket-wheelhouse. The wheelhouse copy
already accounts for state-machine null sentinels (blockKey,
blockKind, inString) and the SKIP_AI_FIX bracket-env access.
// Reject if there's a blank line between this function and the
120
+
// comment — that means it's a free-standing comment.
121
+
if(/\n\s*\n/.test(between)){
122
+
break
123
+
}
124
+
latest=c.range[1]
125
+
}
126
+
returnlatest
127
+
}
128
+
47
129
/** @type {import('eslint').Rule.RuleModule} */
48
130
construle={
49
131
meta: {
@@ -54,6 +136,7 @@ const rule = {
54
136
category: 'Stylistic Issues',
55
137
recommended: true,
56
138
},
139
+
fixable: 'code',
57
140
messages: {
58
141
groupOutOfOrder:
59
142
'Top-level function `{{name}}` ({{visibility}}) appears after a function from the next visibility group. Order: private functions first (alphanumeric), then exported functions (alphanumeric).',
@@ -64,43 +147,65 @@ const rule = {
64
147
},
65
148
66
149
create(context){
150
+
constsourceCode=context.getSourceCode
151
+
? context.getSourceCode()
152
+
: context.sourceCode
153
+
67
154
return{
68
155
Program(programNode){
156
+
// First pass: collect entries + detect violations.
157
+
constentries=[]
69
158
letlastVisibilityRank=-1
70
159
letlastNameInGroup=null
71
160
letcurrentVisibility=null
161
+
constviolations=[]
72
162
73
-
for(constnodeofprogramNode.body){
163
+
// First find the next program-body node after each function, so
164
+
// trailingCommentEnd can stop before reaching it.
0 commit comments