feat(frontend): automate adding copyright header

This commit is contained in:
yassinedorbozgithub 2024-10-19 12:12:32 +01:00
parent 08b1deae50
commit 45e3352577
9 changed files with 117 additions and 52 deletions

75
frontend/.eslintrc.js Normal file
View File

@ -0,0 +1,75 @@
/*
* Copyright © 2024 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).
*/
module.exports = {
root: true,
plugins: ["@typescript-eslint/eslint-plugin", "import", "license-header"],
extends: ["next/core-web-vitals"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"import/newline-after-import": "error",
"import/order": [
"error",
{
groups: [
"builtin", // Built-in imports (come from NodeJS native) go first
"external", // <- External imports
"unknown", // <- unknown
"index", // <- index imports
"internal", // <- Absolute imports
"parent", // <- Relative imports, the sibling and parent types they can be mingled together
"sibling",
],
"newlines-between": "always",
alphabetize: {
/* sort in ascending order. Options: ["ignore", "asc", "desc"] */
order: "asc",
/* ignore case. Options: [true, false] */
caseInsensitive: true,
},
},
],
"newline-after-var": "error",
"newline-before-return": "error",
"no-console": "error",
"no-duplicate-imports": "error",
"object-shorthand": "error",
"padding-line-between-statements": [
"error",
{ blankLine: "never", prev: ["const"], next: "const" },
],
"react/jsx-curly-brace-presence": "warn",
"react/self-closing-comp": "error",
"license-header/header": [
"error",
[
"/*",
" * 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).',
" */",
],
],
},
settings: {
react: {
version: "detect",
},
},
};

View File

@ -1,52 +0,0 @@
{
"plugins": ["@typescript-eslint/eslint-plugin", "import"],
"extends": ["next/core-web-vitals"],
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"import/newline-after-import": "error",
"import/order": [
"error",
{
"groups": [
"builtin", // Built-in imports (come from NodeJS native) go first
"external", // <- External imports
"unknown", // <- unknown
"index", // <- index imports
"internal", // <- Absolute imports
"parent", // <- Relative imports, the sibling and parent types they can be mingled together
"sibling"
],
"newlines-between": "always",
"alphabetize": {
/* sort in ascending order. Options: ["ignore", "asc", "desc"] */
"order": "asc",
/* ignore case. Options: [true, false] */
"caseInsensitive": true
}
}
],
"newline-after-var": "error",
"newline-before-return": "error",
"no-console": "error",
"no-duplicate-imports": "error",
"object-shorthand": "error",
"padding-line-between-statements": [
"error",
{ "blankLine": "never", "prev": ["const"], "next": "const" }
],
"react/jsx-curly-brace-presence": "warn",
"react/self-closing-comp": "error"
},
"settings": {
"react": {
"version": "detect"
}
}
}

View File

@ -52,6 +52,7 @@
"eslint": "^8.42.0",
"eslint-config-next": "14.2.3",
"eslint-import-resolver-typescript": "~3.6.1",
"eslint-plugin-license-header": "^0.6.1",
"random-seed": "^0.3.0",
"typescript": "^5.5.3"
},

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 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).
*/
import { CircularProgress, Grid } from "@mui/material";
import { FC } from "react";

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 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).
*/
import { css, keyframes } from "@emotion/react";
import styled from "@emotion/styled";
import {

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 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).
*/
import {
DefaultLinkModel,
DefaultLinkModelOptions,

View File

@ -5,6 +5,7 @@
* 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).
*/
import {
OptionsObject,
enqueueSnackbar,

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 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).
*/
import { TOptionsBase } from "i18next";
/*

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 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).
*/
import type { NextApiRequest, NextApiResponse } from "next";
type ResponseData = {