import { linter } from '../../../../../../@codemirror_lint@6.8.1/node_modules/@codemirror/lint/dist/index.js';
import '../index.js';
import { tsFacetWorker } from '../facet/tsFacetWorker.js';

/**
 * Binds the TypeScript `lint()` method with TypeScript's
 * semantic and syntactic diagnostics. You can use
 * the `getLints` method for a lower-level interface
 * to the same data.
 */
function tsLinterWorker({ diagnosticCodesToIgnore, } = {}) {
    return linter(async (view) => {
        const config = view.state.facet(tsFacetWorker);
        return config?.worker
            ? config.worker.getLints({
                path: config.path,
                diagnosticCodesToIgnore: diagnosticCodesToIgnore || [],
            })
            : [];
    });
}

export { tsLinterWorker };
