Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import angularTemplate from '@angular-eslint/template-parser';
import angularTemplatePlugin from '@angular-eslint/eslint-plugin-template';
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import headers from 'eslint-plugin-headers';
import eslintConfigPrettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import nodePlugin from 'eslint-plugin-n';
Expand Down Expand Up @@ -51,10 +52,12 @@ export default [
return newConfig;
}),
{
files: ['**/*.ts', '**/*.js'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The headers plugin and rule are currently scoped only to .ts and .js files. Since the PR aims to standardize license headers and the lint command in web/package.json also targets .html files, consider applying this rule to HTML files as well. This might require moving the headers configuration to a separate block or adding it to the HTML-specific configuration block.

plugins: {
'@typescript-eslint': typescriptEslintPlugin,
n: nodePlugin,
'unused-imports': unusedImports,
headers,
},
languageOptions: {
globals: {
Expand Down Expand Up @@ -104,6 +107,34 @@ export default [
varsIgnorePattern: '^_',
},
],
'headers/header-format': [
'warn',
{
source: 'string',
content: `Copyright (year) {company}.

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

https://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.`,
variables: {
company: 'The Ground Authors',
},
patterns: {
year: {
pattern: '\\d{4}',
defaultValue: '2026',
},
},
},
],
},
},
{
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"dependsOn": [
{
"target": "lint",
"projects": "*"
"projects": "*",
"params": "forward"
}
]
},
Expand Down Expand Up @@ -116,17 +117,18 @@
},
"homepage": "https://groundplatform.org",
"devDependencies": {
"@angular/cli": "catalog:dev",
"@angular-eslint/builder": "catalog:dev",
"@angular-eslint/eslint-plugin": "catalog:dev",
"@angular-eslint/eslint-plugin-template": "catalog:dev",
"@angular-eslint/template-parser": "catalog:dev",
"@angular/cli": "catalog:dev",
"@eslint/eslintrc": "catalog:dev",
"@types/jasmine": "catalog:dev",
"@typescript-eslint/eslint-plugin": "catalog:dev",
"@typescript-eslint/parser": "catalog:dev",
"eslint": "catalog:dev",
"eslint-config-prettier": "catalog:dev",
"eslint-plugin-headers": "catalog:dev",
"eslint-plugin-import": "catalog:dev",
"eslint-plugin-n": "catalog:dev",
"eslint-plugin-unused-imports": "catalog:dev",
Expand Down
Loading
Loading