Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions apps/oxlint/src-js/plugins/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ import { registeredPluginUrls, registeredRules } from "./load.js";
const workspaceRoots = new Set<string>();

/**
* Create a new workspace.
* Creates a new workspace and initializes plugin and rule storage for it.
*
* Registers the workspace root directory and sets up empty collections for
* plugin URLs and rules. Throws an error in DEBUG mode if the workspace
* already exists.
*
* @param rootDir - The root directory of the workspace to create.
*/
export const createWorkspace = async (rootDir: string): Promise<undefined> => {
if (DEBUG) {
Expand All @@ -30,7 +36,13 @@ export const createWorkspace = async (rootDir: string): Promise<undefined> => {
};

/**
* Destroy a workspace.
* Destroys an existing workspace and frees all associated resources.
*
* Removes the workspace root directory from the internal sets and maps,
* effectively clearing all plugin URLs and rules registered for this workspace.
* Throws an error in DEBUG mode if the workspace does not exist.
*
* @param rootDir - The root directory of the workspace to destroy.
*/
export const destroyWorkspace = (rootDir: string): undefined => {
if (DEBUG) {
Expand Down
Loading