diff --git a/src/portal/.eslintrc.json b/src/portal/.eslintrc.json index adc663b3044..21f0f481a0f 100644 --- a/src/portal/.eslintrc.json +++ b/src/portal/.eslintrc.json @@ -42,6 +42,15 @@ "rules": { "prettier/prettier": ["error", { "parser": "angular" }] } + }, + { + "files": ["src/**/*.ts"], + "plugins": [ + "header" + ], + "rules": { + "header/header": [2, "./copyright.tmpl.js"] + } } ] } diff --git a/src/portal/copyright.tmpl.js b/src/portal/copyright.tmpl.js new file mode 100644 index 00000000000..059161f81c2 --- /dev/null +++ b/src/portal/copyright.tmpl.js @@ -0,0 +1,13 @@ +// Copyright Project Harbor Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. diff --git a/src/portal/package-lock.json b/src/portal/package-lock.json index 47e3dcff615..424e733e23a 100644 --- a/src/portal/package-lock.json +++ b/src/portal/package-lock.json @@ -52,6 +52,7 @@ "cypress": "13.1.0", "eslint": "^8.57.1", "eslint-config-prettier": "^8.10.0", + "eslint-plugin-header": "^3.1.1", "eslint-plugin-prettier": "^4.2.1", "express": "^4.21.0", "https-proxy-agent": "^5.0.1", @@ -8544,6 +8545,15 @@ "eslint": ">=7.0.0" } }, + "node_modules/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, + "peerDependencies": { + "eslint": ">=7.7.0" + } + }, "node_modules/eslint-plugin-prettier": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", diff --git a/src/portal/package.json b/src/portal/package.json index 18917a182b5..90b0072a355 100644 --- a/src/portal/package.json +++ b/src/portal/package.json @@ -70,6 +70,7 @@ "cypress": "13.1.0", "eslint": "^8.57.1", "eslint-config-prettier": "^8.10.0", + "eslint-plugin-header": "^3.1.1", "eslint-plugin-prettier": "^4.2.1", "express": "^4.21.0", "https-proxy-agent": "^5.0.1",