Skip to content

Commit e1df717

Browse files
committed
Make sure all samples are extending the eslint base configs
1 parent 76c7894 commit e1df717

File tree

14 files changed

+52
-24
lines changed

14 files changed

+52
-24
lines changed

authenticationprovider-sample/src/extension.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function activate(context: vscode.ExtensionContext) {
3030
const req = await fetch('https://app.vssps.visualstudio.com/_apis/profile/profiles/me?api-version=6.0', {
3131
headers: {
3232
authorization: `Basic ${Buffer.from(`:${session.accessToken}`).toString('base64')}`,
33+
// eslint-disable-next-line @typescript-eslint/naming-convention
3334
'content-type': 'application/json',
3435
},
3536
});
@@ -48,6 +49,3 @@ export function activate(context: vscode.ExtensionContext) {
4849

4950
context.subscriptions.push(disposable);
5051
}
51-
52-
// this method is called when your extension is deactivated
53-
export function deactivate() { }

helloworld-web-sample/.eslintrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"plugins": [
99
"@typescript-eslint"
1010
],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended"
14+
],
1115
"rules": {
1216
"@typescript-eslint/naming-convention": "warn",
1317
"@typescript-eslint/semi": "warn",

helloworld-web-sample/src/web/extension.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Import the module and reference it with the alias vscode in your code below
33
import * as vscode from 'vscode';
44

5-
// this method is called when your extension is activated
5+
// This method is called when your extension is activated
66
// your extension is activated the very first time the command is executed
77
export function activate(context: vscode.ExtensionContext) {
88

@@ -13,7 +13,7 @@ export function activate(context: vscode.ExtensionContext) {
1313
// The command has been defined in the package.json file
1414
// Now provide the implementation of the command with registerCommand
1515
// The commandId parameter must match the command field in package.json
16-
let disposable = vscode.commands.registerCommand('helloworld-web-sample.helloWorld', () => {
16+
const disposable = vscode.commands.registerCommand('helloworld-web-sample.helloWorld', () => {
1717
// The code you place here will be executed every time your command is executed
1818

1919
// Display a message box to the user
@@ -23,5 +23,7 @@ export function activate(context: vscode.ExtensionContext) {
2323
context.subscriptions.push(disposable);
2424
}
2525

26-
// this method is called when your extension is deactivated
27-
export function deactivate() { }
26+
// This method is called when your extension is deactivated
27+
export function deactivate() {
28+
// Noop
29+
}

l10n-sample/src/extension.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// The module 'vscode' contains the VS Code extensibility API
22
// Import the module and reference it with the alias vscode in your code below
3-
import path = require('path');
3+
import * as path from 'path';
44
import * as vscode from 'vscode';
55
import { sayByeCommand } from './command/sayBye';
66

@@ -35,6 +35,3 @@ export function activate(context: vscode.ExtensionContext) {
3535

3636
context.subscriptions.push(helloCmd, byeCmd);
3737
}
38-
39-
// this method is called when your extension is deactivated
40-
export function deactivate() { }

notebook-extend-markdown-renderer-sample/.eslintrc.json

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"webpack.config.js"
1313
],
1414
"rules": {
15+
"@typescript-eslint/semi": "warn",
16+
"semi": "off",
1517
"@typescript-eslint/no-var-requires": 0
1618
}
1719
}

notebook-extend-markdown-renderer-sample/src/emoji.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export async function activate(ctx: RendererContext<void>) {
1818
const emoji = require('markdown-it-emoji');
1919
markdownItRenderer.extendMarkdownIt((md: MarkdownIt) => {
2020
return md.use(emoji, {});
21-
})
21+
});
2222
}

notebook-renderer-react-sample/.eslintrc.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@
88
"plugins": [
99
"@typescript-eslint"
1010
],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended"
14+
],
1115
"rules": {
1216
"@typescript-eslint/naming-convention": "warn",
1317
"@typescript-eslint/semi": "warn",
1418
"curly": "warn",
1519
"eqeqeq": "warn",
1620
"no-throw-literal": "warn",
17-
"semi": "off"
21+
"semi": [
22+
"error",
23+
"always"
24+
]
1825
},
1926
"ignorePatterns": [
2027
"**/*.d.ts"
2128
]
22-
}
29+
}

notebook-renderer-react-sample/src/client/index.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ export const activate: ActivationFunction = context => {
2323
root.id = 'root';
2424
shadow.append(root);
2525
}
26-
const root = shadow.querySelector<HTMLElement>('#root')!;
26+
27+
const root = shadow.querySelector<HTMLElement>('#root');
28+
if (!root) {
29+
throw new Error('Could not find root element');
30+
}
31+
2732
errorOverlay.wrap(root, () => {
2833
root.innerHTML = '';
2934
const node = document.createElement('div');
@@ -32,7 +37,8 @@ export const activate: ActivationFunction = context => {
3237
ReactDOM.render(<IssuesList info={{ container: node, mime: outputItem.mime, value: outputItem.json(), context }} />, root);
3338
});
3439
},
35-
disposeOutputItem(outputId) {
40+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
41+
disposeOutputItem(_outputId) {
3642
// Do any teardown here. outputId is the cell output being deleted, or
3743
// undefined if we're clearing all outputs.
3844
}

notebook-renderer-sample/.eslintrc.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"plugins": [
99
"@typescript-eslint"
1010
],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended"
14+
],
1115
"rules": {
1216
"@typescript-eslint/naming-convention": "warn",
1317
"@typescript-eslint/semi": "warn",
@@ -19,4 +23,4 @@
1923
"ignorePatterns": [
2024
"**/*.d.ts"
2125
]
22-
}
26+
}

notifications-sample/.eslintrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"plugins": [
99
"@typescript-eslint"
1010
],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended"
14+
],
1115
"rules": {
1216
"@typescript-eslint/naming-convention": "warn",
1317
"@typescript-eslint/semi": "warn",

uri-handler-sample/.eslintrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"plugins": [
99
"@typescript-eslint"
1010
],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended"
14+
],
1115
"rules": {
1216
"@typescript-eslint/naming-convention": "warn",
1317
"@typescript-eslint/semi": "warn",

uri-handler-sample/src/extension.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MyUriHandler implements vscode.UriHandler {
1515

1616
export function activate(context: vscode.ExtensionContext) {
1717

18-
let disposable = vscode.commands.registerCommand('uri-handler-sample.start', async () => {
18+
const disposable = vscode.commands.registerCommand('uri-handler-sample.start', async () => {
1919
// Create our new UriHandler
2020
const uriHandler = new MyUriHandler();
2121

@@ -31,5 +31,3 @@ export function activate(context: vscode.ExtensionContext) {
3131

3232
context.subscriptions.push(disposable);
3333
}
34-
35-
export function deactivate() { }

welcome-view-content-sample/.eslintrc.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"plugins": [
99
"@typescript-eslint"
1010
],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended"
14+
],
1115
"rules": {
1216
"@typescript-eslint/naming-convention": "warn",
1317
"@typescript-eslint/semi": "warn",
@@ -16,4 +20,4 @@
1620
"no-throw-literal": "warn",
1721
"semi": "off"
1822
}
19-
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as vscode from 'vscode';
22

33
export function activate(context: vscode.ExtensionContext) {
4-
let disposable = vscode.commands.registerCommand(
4+
const disposable = vscode.commands.registerCommand(
55
'welcome-view-content-sample.hello',
66
async () => {
77
vscode.window.showInformationMessage('Hello world!');
@@ -10,5 +10,3 @@ export function activate(context: vscode.ExtensionContext) {
1010

1111
context.subscriptions.push(disposable);
1212
}
13-
14-
export function deactivate() { }

0 commit comments

Comments
 (0)