diff --git a/.eslintrc.base.json b/.eslintrc.base.json new file mode 100644 index 00000000..9ceb6af2 --- /dev/null +++ b/.eslintrc.base.json @@ -0,0 +1,18 @@ +{ + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "env": { + "node": true + }, + "rules": { + "semi": "error", + "no-extra-semi": "warn", + "curly": "warn", + "quotes": ["error", "single", { "allowTemplateLiterals": true } ], + "eqeqeq": "error", + "indent": ["warn", "tab", { "SwitchCase": 1 } ] + } +} \ No newline at end of file diff --git a/client/.eslintrc.json b/client/.eslintrc.json index 57771324..48bbd1cc 100644 --- a/client/.eslintrc.json +++ b/client/.eslintrc.json @@ -1,14 +1,5 @@ { - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, + "extends": "../.eslintrc.base.json", "rules": { - "semi": "error", - "no-extra-semi": "warn", - "curly": "warn", - "eqeqeq": "error", - "indent": ["warn", "tab", { "SwitchCase": 1 } ] } } \ No newline at end of file diff --git a/client/src/extension.ts b/client/src/extension.ts index 2afb8595..6ee12d46 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -362,7 +362,7 @@ export function realActivate(context: ExtensionContext): void { let runtime = Workspace.getConfiguration('eslint').get('runtime', null); let serverOptions: ServerOptions = { run: { module: serverModule, transport: TransportKind.ipc, runtime, options: { cwd: process.cwd() } }, - debug: { module: serverModule, transport: TransportKind.ipc, runtime, options: { execArgv: ["--nolazy", "--inspect=6011"], cwd: process.cwd() } } + debug: { module: serverModule, transport: TransportKind.ipc, runtime, options: { execArgv: ['--nolazy', '--inspect=6011'], cwd: process.cwd() } } }; let defaultErrorHandler: ErrorHandler; diff --git a/client/src/tasks.ts b/client/src/tasks.ts index b76bfde1..d087f210 100644 --- a/client/src/tasks.ts +++ b/client/src/tasks.ts @@ -39,7 +39,7 @@ class FolderTaskProvider { const command = await findEslint(rootPath); const kind: EslintTaskDefinition = { - type: "eslint" + type: 'eslint' }; const options: vscode.ShellExecutionOptions = { cwd: this.workspaceFolder.uri.fsPath }; diff --git a/server/.eslintrc.json b/server/.eslintrc.json index d23480e3..d11ef783 100644 --- a/server/.eslintrc.json +++ b/server/.eslintrc.json @@ -1,15 +1,6 @@ { - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, + "extends": "../.eslintrc.base.json", "rules": { - "semi": "error", - "no-extra-semi": "warn", - "curly": "warn", - "no-console": "error", - "eqeqeq": "error", - "indent": ["warn", "tab", { "SwitchCase": 1 } ] + "no-console": "error" } } \ No newline at end of file diff --git a/server/src/eslintServer.ts b/server/src/eslintServer.ts index e68d865a..d8c72281 100644 --- a/server/src/eslintServer.ts +++ b/server/src/eslintServer.ts @@ -1059,7 +1059,7 @@ messageQueue.registerNotification(DidChangeWatchedFilesNotification.type, (param if (library) { let cli = new library.CLIEngine({}); try { - cli.executeOnText("", path.join(dirname, "___test___.js")); + cli.executeOnText('', path.join(dirname, '___test___.js')); configErrorReported.delete(fsPath); } catch (error) { }