Skip to content

Commit

Permalink
Merge pull request #1343 from skaut/eslint-comments-plugin
Browse files Browse the repository at this point in the history
Added eslint comments plugin
  • Loading branch information
marekdedic authored Feb 17, 2024
2 parents cb65d66 + 6e21fdf commit 5e1ccf3
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/collector/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"extends": [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:prettier/recommended"
Expand All @@ -25,6 +26,8 @@
"no-warning-comments": "warn",
"strict": ["error", "never"],
"deprecation/deprecation": "warn",
"eslint-comments/no-unused-disable": "error",
"eslint-comments/require-description": "error",
"prefer-arrow-functions/prefer-arrow-functions": [
"error",
{
Expand Down
47 changes: 47 additions & 0 deletions packages/collector/package-lock.json

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

1 change: 1 addition & 0 deletions packages/collector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-prefer-arrow-functions": "^3.2.4",
"eslint-plugin-prettier": "^5.1.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/collector/src/getGlobalConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import type { GlobalConfig } from "./interfaces/GlobalConfig";
import { assertIsGlobalConfig } from "./interfaces/GlobalConfig";

export function getGlobalConfig(): GlobalConfig {
let contents = "";
let contents = undefined;
try {
const rawContents = fs.readFileSync("../../config.json", "utf8");
contents = JSON.parse(rawContents); // eslint-disable-line @typescript-eslint/no-unsafe-assignment
contents = JSON.parse(rawContents) as unknown;
} catch (e) {
throw new GlobalConfigError(String(e));
}
Expand Down
1 change: 0 additions & 1 deletion packages/collector/src/getProjectInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export async function getProjectInfo(project: Project): Promise<ProjectInfo> {
}
let info: unknown = undefined;
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
info = JSON.parse(Buffer.from(encodedContent, "base64").toString());
} catch (e) {
throw new ProjectInfoError((e as SyntaxError).message);
Expand Down
8 changes: 8 additions & 0 deletions packages/frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
],
"extends": [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:react/recommended",
Expand All @@ -30,6 +31,13 @@
"strict": ["error", "never"],
"compat/compat": "warn",
"deprecation/deprecation": "warn",
"eslint-comments/no-unused-disable": "error",
"eslint-comments/require-description": [
"error",
{
"ignore": ["eslint-env"]
}
],
"prefer-arrow-functions/prefer-arrow-functions": [
"error",
{
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/__tests__/components/Issue.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { testData } from "../testData"

const project = testData.projects[0]
const issue = project.issues[0]
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- Checked in the test
const issueWithProject = getIssueWithProject(
testData,
project.owner,
Expand All @@ -17,6 +17,7 @@ const issueWithProject = getIssueWithProject(

describe("Issue component", () => {
test("should render correctly", () => {
expect(issue).not.toBeNull()
const tree = renderer
.create(
<MemoryRouter>
Expand Down
29 changes: 29 additions & 0 deletions packages/frontend/package-lock.json

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

1 change: 1 addition & 0 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-prefer-arrow-functions": "^3.2.4",
"eslint-plugin-prettier": "^5.1.3",
Expand Down

0 comments on commit 5e1ccf3

Please sign in to comment.