diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js new file mode 100644 index 00000000..5340489e --- /dev/null +++ b/frontend/.eslintrc.js @@ -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", + }, + }, +}; diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json deleted file mode 100644 index 5046ccbc..00000000 --- a/frontend/.eslintrc.json +++ /dev/null @@ -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" - } - } -} diff --git a/frontend/package.json b/frontend/package.json index 4514c917..b32bec32 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -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" }, diff --git a/frontend/src/components/anonymous/PublicContentWrapper.tsx b/frontend/src/components/anonymous/PublicContentWrapper.tsx index 2af52cdb..4b9e585f 100644 --- a/frontend/src/components/anonymous/PublicContentWrapper.tsx +++ b/frontend/src/components/anonymous/PublicContentWrapper.tsx @@ -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"; diff --git a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx index d487ce11..79f63582 100644 --- a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx +++ b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx @@ -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 { diff --git a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkModel.tsx b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkModel.tsx index a576f5c4..7a4a27bd 100644 --- a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkModel.tsx +++ b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkModel.tsx @@ -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, diff --git a/frontend/src/hooks/useToast.ts b/frontend/src/hooks/useToast.ts index 0cfa3297..9c0a3658 100644 --- a/frontend/src/hooks/useToast.ts +++ b/frontend/src/hooks/useToast.ts @@ -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, diff --git a/frontend/src/i18n/i18n.types.ts b/frontend/src/i18n/i18n.types.ts index ce195f61..e2898249 100644 --- a/frontend/src/i18n/i18n.types.ts +++ b/frontend/src/i18n/i18n.types.ts @@ -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"; /* diff --git a/frontend/src/pages/api/config.ts b/frontend/src/pages/api/config.ts index cd0c1789..3f872b46 100644 --- a/frontend/src/pages/api/config.ts +++ b/frontend/src/pages/api/config.ts @@ -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 = {