fix(frontend): restrict dynamic header to the updates files

This commit is contained in:
yassinedorbozgithub 2025-01-02 11:44:30 +01:00
parent cde0e001a3
commit 9233a447aa
3 changed files with 38 additions and 9 deletions

View File

@ -0,0 +1,21 @@
module.exports = {
extends: './.eslintrc.js',
rules: {
'header/header': [
2,
'block',
[
'',
' * Copyright © ' +
new Date().getFullYear() +
' Hexastack. All rights reserved.',
' *',
' * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:',
' * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.',
' * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software\'s "About" section, documentation, and README file).',
' ',
],
2,
],
},
};

View File

@ -8,7 +8,7 @@
module.exports = {
root: true,
plugins: ["@typescript-eslint/eslint-plugin", "import", "license-header"],
plugins: ["@typescript-eslint/eslint-plugin", "import", "header"],
extends: ["next/core-web-vitals"],
rules: {
"@typescript-eslint/no-unused-vars": [
@ -52,19 +52,23 @@ module.exports = {
],
"react/jsx-curly-brace-presence": "warn",
"react/self-closing-comp": "error",
"license-header/header": [
"error",
"header/header": [
2,
"block",
[
"/*",
" * Copyright © " +
new Date().getFullYear() +
" Hexastack. All rights reserved.",
"",
{
pattern:
"^ \\* Copyright © 20\\d{2} Hexastack. All rights reserved.$",
template: " * Copyright © 2025 Hexastack. All rights reserved.",
},
" *",
" * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:",
' * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.',
' * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software\'s "About" section, documentation, and README file).',
" */",
" ",
],
2,
],
},
settings: {

View File

@ -13,6 +13,9 @@
"lint:fix": "next lint --fix",
"typecheck": "tsc --noEmit --downlevelIteration"
},
"lint-staged": {
"*.{ts,tsx}": "eslint --fix -c \".eslintrc-staged.js\""
},
"dependencies": {
"@chatscope/chat-ui-kit-react": "^2.0.3",
"@chatscope/chat-ui-kit-styles": "^1.4.0",
@ -52,7 +55,8 @@
"eslint": "^8.42.0",
"eslint-config-next": "14.2.3",
"eslint-import-resolver-typescript": "~3.6.1",
"eslint-plugin-license-header": "^0.6.1",
"eslint-plugin-header": "^3.1.1",
"lint-staged": "^15.3.0",
"random-seed": "^0.3.0",
"typescript": "^5.5.3"
},