Skip to content

Commit 0b9a428

Browse files
Add copyright to JS samples (#255)
* Add lint * Remove duplicate * Fix path * Add headers * format * remove unneeded
1 parent 78cb9a8 commit 0b9a428

File tree

15 files changed

+752
-3
lines changed

15 files changed

+752
-3
lines changed

builds/azure-pipelines/template-steps-build-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ steps:
5959
projects: '${{ parameters.solution }}'
6060
arguments: '--configuration ${{ parameters.configuration }} -p:GeneratePackageOnBuild=false -p:Version=${{ parameters.binariesVersion }}'
6161

62+
- script: |
63+
npm install
64+
npm run lint
65+
workingDirectory: $(Build.SourcesDirectory)/samples/samples-js
66+
displayName: Lint samples-js
67+
6268
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@4
6369
inputs:
6470
InputType: 'CommandLine'

samples/samples-js/.eslintrc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"root": true,
3+
"parserOptions": {
4+
"ecmaVersion": "latest"
5+
},
6+
"plugins": [
7+
"header"
8+
],
9+
"rules": {
10+
"header/header": [
11+
2,
12+
"line",
13+
[
14+
" Copyright (c) Microsoft Corporation. All rights reserved.",
15+
" Licensed under the MIT License. See License.txt in the project root for license information."
16+
]
17+
]
18+
}
19+
}

samples/samples-js/AddProduct/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
14
// Upsert the product, which will insert it into the Products table if the primary key (ProductId) for that item doesn't exist.
25
// If it does then update it to have the new name and cost.
36
module.exports = async function (context, req) {

samples/samples-js/AddProductParams/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
14
module.exports = async function (context, req) {
25
context.log('JavaScript HTTP trigger function processed a request.');
36

samples/samples-js/AddProductWithIdentityColumn/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
14
module.exports = async function (context, req) {
25
context.log('JavaScript HTTP trigger function processed a request.');
36

samples/samples-js/AddProductWithIdentityColumnIncluded/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
14
module.exports = async function (context, req) {
25
context.log('JavaScript HTTP trigger function processed a request.');
36

samples/samples-js/AddProductWithMultiplePrimaryColumnsAndIdentity/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
14
module.exports = async function (context, request) {
25
context.log('JavaScript HTTP trigger function processed a request.');
36

samples/samples-js/AddProductsArray/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
14
// Upsert the products, which will insert them into the Products table if the primary key (ProductId) for that item doesn't exist.
25
// If it does then update it to have the new name and cost.
36
module.exports = async function (context, req) {

samples/samples-js/GetProductNamesView/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
14
module.exports = async function (context, req, products) {
25
context.log('JavaScript HTTP trigger function processed a request.');
36
context.log(JSON.stringify(products));

samples/samples-js/GetProducts/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
14
module.exports = async function (context, req, products) {
25
context.log('JavaScript HTTP trigger function processed a request.');
36
context.log(JSON.stringify(products));

0 commit comments

Comments
 (0)