Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

247 issue eslint rule to automate adding copyright header #248

Merged
Merged
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
16 changes: 15 additions & 1 deletion api/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', 'import'],
plugins: ['@typescript-eslint/eslint-plugin', 'import', 'license-header'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
Expand Down Expand Up @@ -71,5 +71,19 @@ module.exports = {
},
},
],
'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).',
' */',
],
],
},
};
19 changes: 19 additions & 0 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "~3.6.1",
"eslint-plugin-license-header": "^0.6.1",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^8.0.0",
"jest": "^29.5.0",
Expand Down Expand Up @@ -157,4 +158,4 @@
"@/(.*)": "<rootDir>/$1"
}
}
}
}
8 changes: 8 additions & 0 deletions api/src/chat/schemas/types/subscriberContext.ts
Original file line number Diff line number Diff line change
@@ -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).
*/

export interface SubscriberContext {
vars?: { [key: string]: any };
}
8 changes: 8 additions & 0 deletions api/src/eventemitter.d.ts
Original file line number Diff line number Diff line change
@@ -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 OnEventOptions } from '@nestjs/event-emitter/dist/interfaces';
import type { Document, HydratedDocument, Query, TFilterQuery } from 'mongoose';
import { type Socket } from 'socket.io';
Expand Down
8 changes: 8 additions & 0 deletions api/src/plugins/map-types.ts
Original file line number Diff line number Diff line change
@@ -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 { BaseBlockPlugin } from './base-block-plugin';
import { BaseEventPlugin } from './base-event-plugin';
import { BasePlugin } from './base-plugin.service';
Expand Down
8 changes: 8 additions & 0 deletions api/src/utils/helpers/URL.ts
Original file line number Diff line number Diff line change
@@ -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).
*/

export const buildURL = (baseUrl: string, relativePath: string): string => {
try {
return new URL(relativePath).toString();
Expand Down
1 change: 1 addition & 0 deletions api/src/utils/helpers/safeRandom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 crypto from 'crypto';

/**
Expand Down
75 changes: 75 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -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",
},
},
};
52 changes: 0 additions & 52 deletions frontend/.eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/anonymous/PublicContentWrapper.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/hooks/useToast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/i18n/i18n.types.ts
Original file line number Diff line number Diff line change
@@ -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";

/*
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/pages/api/config.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading