Skip to content

Commit e975551

Browse files
renovate[bot]renovate-botfelixfbecker
authored
chore(deps): update dependency @sourcegraph/eslint-config to ^0.19.15 (#68)
Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Felix Becker <[email protected]>
1 parent 8b05c03 commit e975551

12 files changed

+449
-268
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
},
66
"rules": {
77
"@typescript-eslint/explicit-function-return-type": "off",
8+
"@typescript-eslint/explicit-module-boundary-types": "off",
89
"@typescript-eslint/no-unused-vars": "off",
910
"@typescript-eslint/require-await": "off"
1011
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
package.json
22
package-lock.json
33
dist/
4+
.nyc_output/

.vscode/tasks.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,12 @@
1212
"runOn": "folderOpen",
1313
},
1414
},
15+
{
16+
"type": "npm",
17+
"script": "eslint",
18+
"problemMatcher": ["$eslint-stylish"],
19+
"label": "npm: eslint",
20+
"detail": "eslint './src/*.ts?(x)'",
21+
},
1522
],
1623
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"devDependencies": {
5050
"@commitlint/cli": "^9.0.1",
5151
"@commitlint/config-conventional": "^9.0.1",
52-
"@sourcegraph/eslint-config": "^0.16.3",
52+
"@sourcegraph/eslint-config": "^0.19.15",
5353
"@sourcegraph/prettierrc": "^3.0.3",
5454
"@sourcegraph/tsconfig": "^4.0.1",
5555
"@types/mocha": "7.0.2",

src/api.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ describe('createStubSourcegraphAPI()', () => {
4242
it('should allow registering a hover provider', () => {
4343
const stub = createStubSourcegraphAPI()
4444
stub.languages.registerHoverProvider(['*.ts'], {
45-
provideHover: (doc, pos) => ({
46-
contents: { kind: stub.MarkupKind.Markdown, value: `${doc.uri}:${pos.line}:${pos.character}` },
45+
provideHover: (textDocument, position) => ({
46+
contents: {
47+
kind: stub.MarkupKind.Markdown,
48+
value: `${textDocument.uri}:${position.line}:${position.character}`,
49+
},
4750
range: new stub.Range(new stub.Position(1, 2), new stub.Position(3, 4)),
4851
}),
4952
})

src/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { BehaviorSubject, Subject, Subscription } from 'rxjs'
1111
import { mapTo } from 'rxjs/operators'
1212
import * as sinon from 'sinon'
1313
import * as sourcegraph from 'sourcegraph'
14-
import { notImplemented, subTypeOf } from './util'
14+
import { notImplemented, subtypeOf } from './util'
1515

1616
let decorationTypeCounter = 0
1717

@@ -23,7 +23,7 @@ export const createStubSourcegraphAPI = () => {
2323
const configSubject = new BehaviorSubject<any>({})
2424
const rootChanges = new Subject<void>()
2525
const openedTextDocuments = new Subject<sourcegraph.TextDocument>()
26-
const stubs = subTypeOf<typeof import('sourcegraph')>()({
26+
const stubs = subtypeOf<typeof import('sourcegraph')>()({
2727
// Classes
2828
URI: URL,
2929
Position,
@@ -87,7 +87,7 @@ export const createStubSourcegraphAPI = () => {
8787

8888
registerViewProvider: sinon.spy((id: string, provider: sourcegraph.ViewProvider) => new Subscription()),
8989

90-
createDecorationType: () => ({ key: 'decorationType' + decorationTypeCounter++ }),
90+
createDecorationType: () => ({ key: `decorationType${decorationTypeCounter++}` }),
9191
createPanelView: notImplemented as (id: string) => sourcegraph.PanelView,
9292
},
9393
configuration: Object.assign(configSubject.pipe(mapTo(undefined)), {

src/codeEditor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { BehaviorSubject } from 'rxjs'
22
import * as sinon from 'sinon'
33
import * as sourcegraph from 'sourcegraph'
4-
import { subTypeOf } from './util'
4+
import { subtypeOf } from './util'
55

66
export const createStubCodeEditor = ({
77
document,
88
selections = [],
99
}: Pick<sourcegraph.CodeEditor, 'document'> & Partial<Pick<sourcegraph.CodeEditor, 'selections'>>) => {
10-
const codeEditor = subTypeOf<sourcegraph.CodeEditor>()({
10+
const codeEditor = subtypeOf<sourcegraph.CodeEditor>()({
1111
type: 'CodeEditor' as const,
1212
document,
1313
get selections(): sourcegraph.Selection[] {

src/context.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { createStubExtensionContext } from './context'
33

44
describe('createStubExtensionContext()', () => {
55
it('should create an extension context', () => {
6-
const ctx = createStubExtensionContext()
7-
const fn = sinon.spy()
8-
ctx.subscriptions.add(fn)
9-
sinon.assert.notCalled(fn)
10-
sinon.assert.calledOnce(ctx.subscriptions.add)
11-
ctx.subscriptions.unsubscribe()
12-
sinon.assert.calledOnce(fn)
6+
const context = createStubExtensionContext()
7+
const cleanup = sinon.spy(() => {})
8+
context.subscriptions.add(cleanup)
9+
sinon.assert.notCalled(cleanup)
10+
sinon.assert.calledOnce(context.subscriptions.add)
11+
context.subscriptions.unsubscribe()
12+
sinon.assert.calledOnce(cleanup)
1313
})
1414
})

src/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { Subscription } from 'rxjs'
22
import * as sinon from 'sinon'
33
import { ExtensionContext } from 'sourcegraph'
4-
import { subTypeOf } from './util'
4+
import { subtypeOf } from './util'
55

66
export const createStubExtensionContext = () => {
77
const subscriptions = sinon.stub(new Subscription())
88
subscriptions.add.callThrough()
99
subscriptions.remove.callThrough()
1010
subscriptions.unsubscribe.callThrough()
11-
const context = subTypeOf<ExtensionContext>()({
11+
const context = subtypeOf<ExtensionContext>()({
1212
subscriptions,
1313
})
1414
return context

src/textDocument.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as sinon from 'sinon'
22
import * as sourcegraph from 'sourcegraph'
3-
import { notImplemented, subTypeOf } from './util'
3+
import { notImplemented, subtypeOf } from './util'
44

55
/**
66
* Creates a stub TextDocument.
77
*
88
*/
99
export const createStubTextDocument = (init: Pick<sourcegraph.TextDocument, 'languageId' | 'text' | 'uri'>) => {
10-
const textDocument = subTypeOf<sourcegraph.TextDocument>()({
10+
const textDocument = subtypeOf<sourcegraph.TextDocument>()({
1111
...init,
1212
// TODO share the implementation of these methods with the real implementations
1313
getWordRangeAtPosition: sinon.spy<(position: sourcegraph.Position) => sourcegraph.Range | undefined>(

src/util.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
* @template U The type to check for (explicitly specify this)
55
* @template T The actual type (inferred, don't specify this)
66
*/
7-
export const subTypeOf = <U>() => <T extends U>(value: T): T => value
7+
// eslint-disable-next-line unicorn/consistent-function-scoping
8+
export const subtypeOf = <U>() => <T extends U>(value: T): T => value
89

910
export function notImplemented(): never {
1011
throw new Error('Stub functionality not implemented')

0 commit comments

Comments
 (0)