Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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:
diagnostics.length > 0
? sourcegraph.CheckResult.Failure
: sourcegraph.CheckResult.Success,
message:
diagnostics.length > 0
? 'ESLint problems found'
: 'Code is compliant with ESLint',
},
sections: {
settings: {
kind: sourcegraph.MarkupKind.Markdown,
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,
result:
diagnostics.length > 0
? sourcegraph.CheckResult.Failure
: sourcegraph.CheckResult.Success,
message:
diagnostics.length > 0 ? 'Duplicated code found' : 'No duplicated code found',
},
sections: {
settings: {
kind: sourcegraph.MarkupKind.Markdown,
value: `
- Use \`jscpd@2.0.15\`