Skip to content

Commit abd691f

Browse files
authored
Standardize license headers and fix ESLint config (#2430)
1 parent bb68f89 commit abd691f

5 files changed

Lines changed: 1191 additions & 1387 deletions

File tree

eslint.config.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import angularTemplate from '@angular-eslint/template-parser';
1919
import angularTemplatePlugin from '@angular-eslint/eslint-plugin-template';
2020
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
2121
import typescriptParser from '@typescript-eslint/parser';
22+
import headers from 'eslint-plugin-headers';
2223
import eslintConfigPrettier from 'eslint-config-prettier';
2324
import importPlugin from 'eslint-plugin-import';
2425
import nodePlugin from 'eslint-plugin-n';
@@ -51,10 +52,12 @@ export default [
5152
return newConfig;
5253
}),
5354
{
55+
files: ['**/*.ts', '**/*.js'],
5456
plugins: {
5557
'@typescript-eslint': typescriptEslintPlugin,
5658
n: nodePlugin,
5759
'unused-imports': unusedImports,
60+
headers,
5861
},
5962
languageOptions: {
6063
globals: {
@@ -104,6 +107,34 @@ export default [
104107
varsIgnorePattern: '^_',
105108
},
106109
],
110+
'headers/header-format': [
111+
'warn',
112+
{
113+
source: 'string',
114+
content: `Copyright (year) {company}.
115+
116+
Licensed under the Apache License, Version 2.0 (the 'License');
117+
you may not use this file except in compliance with the License.
118+
You may obtain a copy of the License at
119+
120+
https://www.apache.org/licenses/LICENSE-2.0
121+
122+
Unless required by applicable law or agreed to in writing, software
123+
distributed under the License is distributed on an 'AS IS' BASIS,
124+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125+
See the License for the specific language governing permissions and
126+
limitations under the License.`,
127+
variables: {
128+
company: 'The Ground Authors',
129+
},
130+
patterns: {
131+
year: {
132+
pattern: '\\d{4}',
133+
defaultValue: '2026',
134+
},
135+
},
136+
},
137+
],
107138
},
108139
},
109140
{

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"dependsOn": [
1414
{
1515
"target": "lint",
16-
"projects": "*"
16+
"projects": "*",
17+
"params": "forward"
1718
}
1819
]
1920
},
@@ -116,17 +117,18 @@
116117
},
117118
"homepage": "https://groundplatform.org",
118119
"devDependencies": {
119-
"@angular/cli": "catalog:dev",
120120
"@angular-eslint/builder": "catalog:dev",
121121
"@angular-eslint/eslint-plugin": "catalog:dev",
122122
"@angular-eslint/eslint-plugin-template": "catalog:dev",
123123
"@angular-eslint/template-parser": "catalog:dev",
124+
"@angular/cli": "catalog:dev",
124125
"@eslint/eslintrc": "catalog:dev",
125126
"@types/jasmine": "catalog:dev",
126127
"@typescript-eslint/eslint-plugin": "catalog:dev",
127128
"@typescript-eslint/parser": "catalog:dev",
128129
"eslint": "catalog:dev",
129130
"eslint-config-prettier": "catalog:dev",
131+
"eslint-plugin-headers": "catalog:dev",
130132
"eslint-plugin-import": "catalog:dev",
131133
"eslint-plugin-n": "catalog:dev",
132134
"eslint-plugin-unused-imports": "catalog:dev",

0 commit comments

Comments
 (0)