-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"eslint-disable": { | ||
"prefix": "eslint-disable", | ||
"body": [ | ||
"/* eslint-disable ${1|INSERT_RULES|} */", | ||
"$0/* eslint-enable ${1} */" | ||
], | ||
"description": "ESLint disable wrapper" | ||
}, | ||
"eslint-disable-next-line": { | ||
"prefix": "eslint-disable-next-line", | ||
"body": ["// eslint-disable-next-line ${1|INSERT_RULES|}"], | ||
"description": "ESLint disable next line" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,21 @@ | ||
// The module 'vscode' contains the VS Code extensibility API | ||
// Import the module and reference it with the alias vscode in your code below | ||
import * as vscode from 'vscode' | ||
import vscode from 'vscode' | ||
|
||
|
||
// this method is called when your extension is activated | ||
// your extension is activated the very first time the command is executed | ||
export function activate(context: vscode.ExtensionContext) { | ||
|
||
// Use the console to output diagnostic information (console.log) and errors (console.error) | ||
// This line of code will only be executed once when your extension is activated | ||
console.log('Congratulations, your extension "eslint-disable" is now active!') | ||
|
||
// The command has been defined in the package.json file | ||
// Now provide the implementation of the command with registerCommand | ||
// The commandId parameter must match the command field in package.json | ||
const disposable = vscode.commands.registerCommand('eslint-disable.helloWorld', () => { | ||
// The code you place here will be executed every time your command is executed | ||
// Display a message box to the user | ||
void vscode.window.showInformationMessage('Hello World from eslint-disable!') | ||
}) | ||
|
||
context.subscriptions.push(disposable) | ||
context.subscriptions.push(helloWorld()) | ||
} | ||
|
||
// this method is called when your extension is deactivated | ||
export function deactivate() { | ||
// ... | ||
} | ||
|
||
/** | ||
* 1. 读 eslint config 配置,获取所有rules config | ||
*/ | ||
const helloWorld = () => | ||
vscode.commands.registerCommand('eslint-disable.helloWorld', () => | ||
vscode.window.showInformationMessage('Hello World from eslint-disable!!!')) | ||
|