From 4b17d4df6f098ad5144c5c6509bcca1bc02fd4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 17 May 2021 14:41:25 +0200 Subject: [PATCH] Move copyright header handling explicitly into the repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .eslintrc.js | 30 +++++++++++++++++++++++++++++- package.json | 2 +- scripts/copyright-header.txt | 15 +++++++++++++++ yarn.lock | 7 ------- 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 scripts/copyright-header.txt diff --git a/.eslintrc.js b/.eslintrc.js index 3681612b35..4dfcf5317f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,32 @@ +/* + * Copyright 2021 Spotify AB + * + * 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. + */ + +var path = require('path'); + module.exports = { root: true, - extends: ['@spotify/eslint-config-oss'], + plugins: ['notice'], + rules: { + 'notice/notice': [ + 'error', + { + // eslint-disable-next-line no-restricted-syntax + templateFile: path.resolve(__dirname, './scripts/copyright-header.txt'), + onNonMatchingHeader: 'replace', + }, + ], + }, }; diff --git a/package.json b/package.json index ff24cafbd0..1ffeb490a3 100644 --- a/package.json +++ b/package.json @@ -56,10 +56,10 @@ "devDependencies": { "@changesets/cli": "^2.14.0", "@octokit/openapi-types": "^2.2.0", - "@spotify/eslint-config-oss": "^1.0.1", "@spotify/prettier-config": "^9.0.0", "command-exists": "^1.2.9", "concurrently": "^6.0.0", + "eslint-plugin-notice": "^0.9.10", "fs-extra": "^9.0.0", "husky": "^6.0.0", "lerna": "^4.0.0", diff --git a/scripts/copyright-header.txt b/scripts/copyright-header.txt new file mode 100644 index 0000000000..4376d55847 --- /dev/null +++ b/scripts/copyright-header.txt @@ -0,0 +1,15 @@ +/* + * Copyright <%= YEAR %> Spotify AB + * + * 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/yarn.lock b/yarn.lock index 8b4b31c972..d8ff6990dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4488,13 +4488,6 @@ resolved "https://registry.npmjs.org/@spotify/eslint-config-base/-/eslint-config-base-9.0.2.tgz#a4830f610f40de935de795d3def486c3e5064ee4" integrity sha512-HS+eLpVMbUUBXZ9ZlPcd6yCje/OVNhdcGDeU+DoK+C9AFfzbRtuZ1EJ8ewzj58ENrhlfJPuxCS68bypA/esyjw== -"@spotify/eslint-config-oss@^1.0.1": - version "1.0.2" - resolved "https://registry.npmjs.org/@spotify/eslint-config-oss/-/eslint-config-oss-1.0.2.tgz#b0e56e549c78dcdd79063ce48521f10c3420f701" - integrity sha512-3Tn6R98f5BWeb8anOhxYdvZywasp1RaJb+y65W7Db5+xiQVmCnSFvIM3jwysQpu1xRdlUJSCqeDHR7S4Nz3thw== - dependencies: - eslint-plugin-notice "^0.9.10" - "@spotify/eslint-config-react@^9.0.0": version "9.0.0" resolved "https://registry.npmjs.org/@spotify/eslint-config-react/-/eslint-config-react-9.0.0.tgz#9c032e257090a5b3f5b08b28c1311485bf0fbae3"