Skip to content

Commit 0e5b7f5

Browse files
authored
Merge pull request #511 from sam1el/fix/pipeline
Fix/pipeline
2 parents 009c85e + 07edfd4 commit 0e5b7f5

File tree

6 files changed

+115
-16
lines changed

6 files changed

+115
-16
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

eslint.config.mjs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import { defineConfig } from "eslint/config";
2+
import checkFile from "eslint-plugin-check-file";
3+
import globals from "globals";
4+
import tsParser from "@typescript-eslint/parser";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
10+
const currentFilename = fileURLToPath(import.meta.url);
11+
const currentDirname = path.dirname(currentFilename);
12+
const compat = new FlatCompat({
13+
baseDirectory: currentDirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all
16+
});
17+
18+
export default defineConfig([
19+
{
20+
ignores: ["node_modules/**", "dist/**"],
21+
},
22+
{
23+
extends: compat.extends(
24+
"eslint:recommended",
25+
"plugin:@typescript-eslint/eslint-recommended",
26+
"plugin:@typescript-eslint/recommended",
27+
"prettier",
28+
),
29+
30+
31+
plugins: {
32+
"check-file": checkFile,
33+
},
34+
35+
languageOptions: {
36+
globals: {
37+
...globals.node,
38+
},
39+
40+
parser: tsParser,
41+
ecmaVersion: 6,
42+
sourceType: "commonjs",
43+
},
44+
45+
rules: {
46+
"check-file/folder-naming-convention": ["error", {
47+
"src/**/": "KEBAB_CASE",
48+
"test/lib/**/": "KEBAB_CASE",
49+
"test/unit/**/": "KEBAB_CASE",
50+
}],
51+
52+
"@typescript-eslint/naming-convention": ["error", {
53+
selector: "default",
54+
format: ["camelCase", "UPPER_CASE"],
55+
}, {
56+
selector: "typeLike",
57+
format: ["PascalCase"],
58+
}, {
59+
selector: "typeParameter",
60+
format: ["PascalCase"],
61+
}, {
62+
selector: "interface",
63+
format: ["PascalCase"],
64+
custom: {
65+
regex: "^I[A-Z]",
66+
match: false,
67+
},
68+
}],
69+
70+
"@typescript-eslint/explicit-module-boundary-types": "off",
71+
"@typescript-eslint/explicit-function-return-type": "off",
72+
"@typescript-eslint/no-explicit-any": "off",
73+
"no-prototype-builtins": "off",
74+
"@typescript-eslint/no-empty-function": "off",
75+
"@typescript-eslint/no-non-null-assertion": "off",
76+
"@typescript-eslint/no-var-requires": "warn",
77+
"@typescript-eslint/consistent-type-imports": "error",
78+
"@typescript-eslint/no-use-before-define": "off",
79+
"@typescript-eslint/no-unused-vars": "error",
80+
"no-buffer-constructor": "error",
81+
"no-import-assign": "error",
82+
},
83+
84+
} ,
85+
86+
// Test-specific config (flat config uses separate entries instead of overrides)
87+
{
88+
files: ["test/**", "test/**/*.ts"],
89+
languageOptions: {
90+
parser: tsParser,
91+
},
92+
rules: {
93+
// test fixtures frequently use kebab-case keys and require() imports
94+
"@typescript-eslint/naming-convention": "off",
95+
"@typescript-eslint/no-require-imports": "off",
96+
"@typescript-eslint/no-unused-vars": "off",
97+
"@typescript-eslint/no-var-requires": "off",
98+
},
99+
}
100+
]);

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"@octokit/auth-app": "^5.0.0",
4747
"@octokit/plugin-retry": "4.0.3",
4848
"@octokit/rest": "19.0.5",
49-
"tslib": "^2.6.0",
5049
"base-64": "^1.0.0",
5150
"bottleneck": "2.19.5",
5251
"bunyan": "1.8.15",
@@ -62,6 +61,7 @@
6261
"snyk-request-manager": "1.8.4",
6362
"source-map-support": "^0.5.16",
6463
"split": "1.0.1",
64+
"tslib": "^2.6.0",
6565
"yargs": "16.2.0"
6666
},
6767
"devDependencies": {
@@ -77,18 +77,18 @@
7777
"@types/node": "20.11.1",
7878
"@types/parse-link-header": "1.0.0",
7979
"@types/split": "1.0.0",
80-
"@typescript-eslint/eslint-plugin": "4.28.1",
81-
"@typescript-eslint/parser": "4.28.1",
82-
"eslint": "7.30.0",
83-
"eslint-config-prettier": "^6.10.0",
84-
"eslint-plugin-check-file": "1.2.3",
80+
"@typescript-eslint/eslint-plugin": "^8.46.0",
81+
"@typescript-eslint/parser": "^8.46.0",
82+
"eslint": "^9.37.0",
83+
"eslint-config-prettier": "^10.1.8",
84+
"eslint-plugin-check-file": "^3.3.0",
8585
"jest": "^29.7.0",
8686
"nock": "^13.2.1",
8787
"prettier": "2.7.1",
8888
"semantic-release": "17.3.0",
8989
"ts-jest": "^29.1.5",
9090
"tsc-watch": "^4.1.0",
91-
"typescript": "4.5",
91+
"typescript": "^5.9.3",
9292
"uuid": "9.0.0"
9393
},
9494
"overrides": {

test/scripts/__mocks__/github-cloud-app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/naming-convention */
1+
// Removed unused eslint-disable directive
22
// Mock for GitHub Cloud App authentication and API calls
33
export const mockGitHubAppToken = 'mock-github-app-token';
44
export const mockInstallationId = 12345;

test/scripts/__mocks__/snyk-request-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eslint-disable-next-line @typescript-eslint/naming-convention
1+
// Removed unused eslint-disable-next-line directive
22
export class requestsManager {
33
params: unknown;
44
constructor(params: unknown = {}) {

test/system/import:data/github-cloud-app.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('GitHub Cloud App import:data integration', () => {
2525
});
2626

2727
// Mock the loadFile function by creating a temporary file
28-
const fs = require('fs'); // eslint-disable-line @typescript-eslint/no-var-requires
29-
const path = require('path'); // eslint-disable-line @typescript-eslint/no-var-requires
28+
const fs = require('fs');
29+
const path = require('path');
3030
const tempFile = path.join(__dirname, 'temp-orgs-data.json');
3131

3232
try {
@@ -64,8 +64,8 @@ describe('GitHub Cloud App import:data integration', () => {
6464
],
6565
});
6666

67-
const fs = require('fs'); // eslint-disable-line @typescript-eslint/no-var-requires
68-
const path = require('path'); // eslint-disable-line @typescript-eslint/no-var-requires
67+
const fs = require('fs');
68+
const path = require('path');
6969
const tempFile = path.join(__dirname, 'temp-orgs-data.json');
7070

7171
try {
@@ -106,8 +106,8 @@ describe('GitHub Cloud App import:data integration', () => {
106106
],
107107
});
108108

109-
const fs = require('fs'); // eslint-disable-line @typescript-eslint/no-var-requires
110-
const path = require('path'); // eslint-disable-line @typescript-eslint/no-var-requires
109+
const fs = require('fs');
110+
const path = require('path');
111111
const tempFile = path.join(__dirname, 'temp-orgs-data.json');
112112

113113
try {

0 commit comments

Comments
 (0)