Skip to content

Commit 231cc28

Browse files
authored
Add MIT License Headers to Components/Web.JS/**/*.ts Files (#39164)
* Add license header to eslint config * Add headers to TS files
1 parent 6969db9 commit 231cc28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+308
-71
lines changed

src/Components/Web.JS/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"preclean": "yarn install --mutex network --frozen-lockfile",
1313
"clean": "node node_modules/rimraf/bin.js ./dist/Debug ./dist/Release",
1414
"prebuild": "yarn run clean && yarn install --mutex network --frozen-lockfile",
15+
"lint": "eslint -c ./src/.eslintrc.js --ext .ts ./src",
1516
"build": "yarn run build:debug && yarn run build:production",
1617
"build:debug": "cd src && node ../node_modules/webpack-cli/bin/cli.js --mode development --config ./webpack.config.js",
1718
"build:production": "cd src && node ../node_modules/webpack-cli/bin/cli.js --mode production --config ./webpack.config.js",
@@ -30,6 +31,7 @@
3031
"@typescript-eslint/parser": "^4.29.3",
3132
"babel-jest": "^27.1.0",
3233
"eslint": "^7.32.0",
34+
"eslint-plugin-header": "^3.1.1",
3335
"inspectpack": "^4.7.1",
3436
"jest": "^27.1.0",
3537
"rimraf": "^3.0.2",

src/Components/Web.JS/src/.eslintrc.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3-
plugins: ['@typescript-eslint'],
3+
plugins: ['@typescript-eslint', 'header'],
44
extends: [
55
'eslint:recommended',
66
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
@@ -62,8 +62,16 @@ module.exports = {
6262
"asyncArrow": "always"
6363
}],
6464
"space-in-parens": ["error", "never"],
65-
"space-infix-ops": ["error"]
66-
65+
"space-infix-ops": ["error"],
66+
"header/header": [
67+
2,
68+
"line",
69+
[
70+
" Licensed to the .NET Foundation under one or more agreements.",
71+
" The .NET Foundation licenses this file to you under the MIT license."
72+
],
73+
2
74+
]
6775
},
6876
globals: {
6977
DotNet: "readonly"

src/Components/Web.JS/src/BinaryDecoder.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
14
const uint64HighPartShift = Math.pow(2, 32);
25
const maxSafeNumberHighPart = Math.pow(2, 21) - 1; // The high-order int32 from Number.MAX_SAFE_INTEGER
36

src/Components/Web.JS/src/Boot.Server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
14
import { DotNet } from '@microsoft/dotnet-js-interop';
25
import { Blazor } from './GlobalExports';
36
import { HubConnectionBuilder, HubConnection, HttpTransportType } from '@microsoft/signalr';
@@ -111,7 +114,7 @@ async function initializeConnection(options: CircuitStartOptions, logger: Logger
111114
complete: () => controller.close(),
112115
error: (err) => controller.error(err),
113116
});
114-
}
117+
},
115118
});
116119

117120
DotNet.jsCallDispatcher.supplyDotNetStream(streamId, readableStream);

src/Components/Web.JS/src/Boot.WebAssembly.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
14
/* eslint-disable array-element-newline */
25
import { DotNet } from '@microsoft/dotnet-js-interop';
36
import { Blazor } from './GlobalExports';

src/Components/Web.JS/src/Boot.WebView.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
14
import { DotNet } from '@microsoft/dotnet-js-interop';
25
import { Blazor } from './GlobalExports';
36
import { shouldAutoStart } from './BootCommon';

src/Components/Web.JS/src/BootCommon.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
14
// Tells you if the script was added without <script src="..." autostart="false"></script>
25
export function shouldAutoStart(): boolean {
36
return !!(document &&

src/Components/Web.JS/src/BootErrors.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
14
let hasFailed = false;
25

36
export function showErrorNotification(): void {

src/Components/Web.JS/src/DomWrapper.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
14
import '@microsoft/dotnet-js-interop';
25

36
export const domFunctions = {

src/Components/Web.JS/src/Environment.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
14
// Expose an export called 'platform' of the interface type 'Platform',
25
// so that consumers can be agnostic about which implementation they use.
36
// Basic alternative to having an actual DI container.

0 commit comments

Comments
 (0)