Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function registerCheckProvider(diagnostics: Observable): Unsubscribable {
const subscriptions = new Subscription()
subscriptions.add(
sourcegraph.checks.registerCheckProvider('codeDuplication', () => ({
information: diagnostics.pipe(
map(diagnostics => {
const info: sourcegraph.CheckInformation = {
description: {
kind: sourcegraph.MarkupKind.Markdown,
value:
'Checks for code duplication using [**jscpd**](https://github.com/kucherenko/jscpd), a copy-paste detector with support for 150+ languages.',
},
state:
diagnostics === LOADING
? {
completion: sourcegraph.CheckCompletion.InProgress,
message: 'Running jscpd...',
}
: {
completion: sourcegraph.CheckCompletion.Completed,
function registerCheckProvider(diagnostics: Observable): Unsubscribable {
const subscriptions = new Subscription()
subscriptions.add(
sourcegraph.checks.registerCheckProvider('eslint', () => ({
information: diagnostics.pipe(
map(diagnostics => {
const info: sourcegraph.CheckInformation = {
description: {
kind: sourcegraph.MarkupKind.Markdown,
value: 'Checks code using ESLint, an open-source JavaScript linting utility.',
},
state:
diagnostics === LOADING
? {
completion: sourcegraph.CheckCompletion.InProgress,
message: 'Running ESLint...',
}
: {
completion: sourcegraph.CheckCompletion.Completed,
result: