Skip to content

Commit

Permalink
chore(eslint): lint for copyrights on files (microsoft#2858)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelEinbinder authored Jul 7, 2020
1 parent de7969f commit 6ed8b5f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
plugins: ['@typescript-eslint', 'notice'],
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 9,
Expand Down Expand Up @@ -108,6 +108,12 @@ module.exports = {
"beforeColon": false
}],

// copyright
"notice/notice": [2, {
"mustMatch": "Copyright",
"templateFile": "./utils/copyright.js",
}],

// type-aware rules
"@typescript-eslint/no-unnecessary-type-assertion": 2,
}
Expand Down
23 changes: 23 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"cross-env": "^5.0.5",
"electron": "^9.0.0-beta.24",
"eslint": "^6.6.0",
"eslint-plugin-notice": "^0.9.10",
"esprima": "^4.0.0",
"formidable": "^1.2.1",
"ncp": "^2.0.0",
Expand Down
15 changes: 15 additions & 0 deletions utils/copyright.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Microsoft Corporation.
*
* 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.
*/

0 comments on commit 6ed8b5f

Please sign in to comment.