Skip to content

Commit 022e6ad

Browse files
committed
refactor(linter/plugins): add comments on Context#extend
1 parent 74033bd commit 022e6ad

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

apps/oxlint/src-js/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ const FILE_CONTEXT: FileContext = freeze({
181181
* and the specified properties as its own properties.
182182
*/
183183
extend(this: FileContext, extension: Record<string | number | symbol, unknown>): FileContext {
184+
// Note: We can allow calling `extend` in `createOnce`, as it involves no file-specific state
184185
return freeze(ObjectAssign(ObjectCreate(this), extension));
185186
},
186187

apps/oxlint/src-js/plugins/context.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ const FILE_CONTEXT = freeze({
227227
* and the specified properties as its own properties.
228228
*/
229229
extend(this: FileContext, extension: Record<string | number | symbol, unknown>): FileContext {
230+
// Note: We can allow calling `extend` in `createOnce`, as it involves no file-specific state
230231
return freeze(ObjectAssign(ObjectCreate(this), extension));
231232
},
232233

0 commit comments

Comments
 (0)