add common header definition rule (#230)

Co-authored-by: Felix Schober <feschobe@microsoft.com>
This commit is contained in:
Felix Schober 2022-07-08 09:59:52 +01:00 коммит произвёл GitHub
Родитель e4162479d8
Коммит 1c9cba113b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
38 изменённых файлов: 161 добавлений и 80 удалений

Просмотреть файл

@ -1,3 +1,8 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
module.exports = {
root: true,
env: {
@ -5,19 +10,35 @@ module.exports = {
amd: true,
mocha: true,
},
parser: '@typescript-eslint/parser',
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2019
ecmaVersion: 2019,
},
plugins: [
'@typescript-eslint',
],
plugins: ["@typescript-eslint", "header"],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
'@typescript-eslint/no-unused-vars': [ 'error', { "argsIgnorePattern": "^_$" } ],
}
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_$" },
],
"header/header": [
2,
"block",
"\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n ",
2,
],
},
overrides: [
{
// Autogenerated file
files: ["**/Parser/*.js"],
rules: {
"header/header": "off"
}
}
]
};

Просмотреть файл

@ -1,7 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-undef */
"use strict";
const util = require('util');
const nls = require('vscode-nls-dev');

6
package-lock.json сгенерированный
Просмотреть файл

@ -2534,6 +2534,12 @@
}
}
},
"eslint-plugin-header": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz",
"integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==",
"dev": true
},
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",

Просмотреть файл

@ -482,6 +482,7 @@
"@vscode/test-web": "^0.0.24",
"chai": "^4.3.6",
"eslint": "^8.11.0",
"eslint-plugin-header": "^3.1.1",
"fancy-log": "^1.3.3",
"fs-extra": "^9.0.1",
"gulp": "^4.0.2",

Просмотреть файл

@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import * as vscode from "vscode";
import * as path from "path";

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
export const EXTENSION_ID = 'microsoft-IsvExpTools.powerplatform-vscode';

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import * as vscode from "vscode";
import TelemetryReporter from "@vscode/extension-telemetry";

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
// https://code.visualstudio.com/api/extension-capabilities/common-capabilities#output-channel

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
export type PacOutput = {
Status: string;

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import * as os from "os";
import * as path from "path";

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
/**
* Interface available for sending telemetry for this extension.

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { ITelemetry } from './ITelemetry';

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import * as process from "process";
import * as os from "os";

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { ExtensionContext } from "vscode";

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import * as fs from 'fs-extra';
import { getAppDataPath } from './appdata';

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { expect } from "chai";
import { BlockingQueue } from "../../../common/utilities/BlockingQueue";

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import * as fs from 'fs-extra';
import * as path from 'path';

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { expect } from "chai";
import { IPacInterop, IPacWrapperContext, PacArguments, PacWrapper } from "../../pac/PacWrapper";

Просмотреть файл

@ -1,7 +1,8 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import {
WorkspaceFolder
} from 'vscode-languageserver/node';

Просмотреть файл

@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
/**
* This type is used in the contract of telemetry/event notifications sent from language servers to the language clients.

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
// Queue that returns Promises on dequeue, either already resolved if the item
// has already been enqueued, or still waiting if the item has not yet arrived.

Просмотреть файл

@ -1,7 +1,8 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import {
createConnection,
TextDocuments,

Просмотреть файл

@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import {
TextDocument,

Просмотреть файл

@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import {
WorkspaceFolder

Просмотреть файл

@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import { Connection, TelemetryEventNotification} from 'vscode-languageserver/node';
import { ITelemetryData } from '../../common/TelemetryData';

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-var */

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
/* eslint-disable @typescript-eslint/no-var-requires */

Просмотреть файл

@ -1,7 +1,8 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import {
createConnection,
TextDocuments,

Просмотреть файл

@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as vscode from 'vscode';

Просмотреть файл

@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
export const PORTAL_LANGUAGES = 'adx_portallanguages';
export const WEBSITE_LANGUAGES = 'adx_websitelanguages';

Просмотреть файл

@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
'use strict';

Просмотреть файл

@ -1,3 +1,8 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
export const portal_schema_data = {
"entities": {
"dataSourceProperties": {

Просмотреть файл

@ -1,7 +1,8 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import { portal_schema_data } from "./portalSchema";

Просмотреть файл

@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import * as vscode from "vscode";
import TelemetryReporter from "@vscode/extension-telemetry";

Просмотреть файл

@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
*/
import { expect } from "chai";