Skip to content

Commit 898697b

Browse files
committed
feat: @krauters/eslint-config
1 parent d9f1b92 commit 898697b

File tree

14 files changed

+3374
-99
lines changed

14 files changed

+3374
-99
lines changed

.github/workflows/tests.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ permissions:
1010
contents: read
1111

1212
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
- name: Install Dependencies
21+
run: npm ci
22+
- name: Run tests
23+
run: npm run test
1324
test-action:
1425
runs-on: ubuntu-latest
1526
steps:

dist/index.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37661,7 +37661,7 @@ var core = __nccwpck_require__(2186);
3766137661
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
3766237662
var github = __nccwpck_require__(5438);
3766337663
;// CONCATENATED MODULE: ./package.json
37664-
const package_namespaceObject = JSON.parse('{"u2":"@krauters/github-notifier","i8":"0.10.0","Xh":"https://github.com/krauters/github-notifier"}');
37664+
const package_namespaceObject = JSON.parse('{"u2":"@krauters/github-notifier","i8":"0.11.0","Xh":"https://github.com/krauters/github-notifier"}');
3766537665
;// CONCATENATED MODULE: ./src/defaults.ts
3766637666
const scmUrl = 'https://github.com';
3766737667
const prBaseUrl = `${scmUrl}/pulls?q=is%3Aopen+is%3Apr+archived%3Afalse+draft%3Afalse+user%3A`;
@@ -37744,6 +37744,7 @@ function* generateBatches(items, size = 50) {
3774437744
yield items.slice(i, i + size);
3774537745
}
3774637746
}
37747+
// Todo - Move this to shared utils.
3774737748
const snapActions = {
3774837749
[SnapType.Day]: (date) => {
3774937750
date.setHours(0, 0, 0, 0);
@@ -41463,6 +41464,7 @@ var PullState;
4146341464
})(PullState || (PullState = {}));
4146441465

4146541466
;// CONCATENATED MODULE: ./src/utils/github/github-client.ts
41467+
/* eslint-disable @typescript-eslint/naming-convention */
4146641468

4146741469

4146841470

@@ -41574,10 +41576,12 @@ class GitHubClient {
4157441576
};
4157541577
}
4157641578
const minutesUntilMerged = minutesBetweenDates(pull.createdAt, pull.mergedAt);
41579+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
4157741580
minutesUntilMerged && report[key].minutesUntilMerged.push(minutesUntilMerged / 60);
4157841581
const minutesUntilFirstReview = firstReview
4157941582
? minutesBetweenDates(pull.createdAt, new Date(String(firstReview.submitted_at)))
4158041583
: undefined;
41584+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
4158141585
minutesUntilFirstReview && report[key].minutesUntilFirstReview.push(minutesUntilFirstReview / 60);
4158241586
}
4158341587
let reportString = 'GitHub Notifier Pull Report (Averages)\n';
@@ -41921,6 +41925,7 @@ function getContextMarkdownBlock(text, withIndentation = false) {
4192141925
* @param {boolean} withUserMentions - Whether or not to mention Slack users.
4192241926
* @returns {Promise<KnownBlock[]>}
4192341927
*/
41928+
// eslint-disable-next-line max-lines-per-function
4192441929
async function getPullBlocks(pull, slack, withUserMentions) {
4192541930
const { age, ageInHours, commits, draft, filesAndChanges, number, repo, repoUrl, requestedReviewers, reviewReport, title, url, } = pull;
4192641931
let ageBasedEmoji = getAgeBasedEmoji(ageInHours);
@@ -41975,6 +41980,7 @@ async function getPullBlocks(pull, slack, withUserMentions) {
4197541980
const slackUserIdsOrLogins = [];
4197641981
for (const username of requestedReviewers) {
4197741982
const slackUser = await slack.getSlackUser({ username });
41983+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
4197841984
slackUserIdsOrLogins.push((withUserMentions && slackUser?.id && `<@${slackUser.id}>`) || username);
4197941985
}
4198041986
contextBlocks.unshift(...getContextMarkdownBlock(formatStringList(slackUserIdsOrLogins) +
@@ -42147,7 +42153,10 @@ class SlackClient {
4214742153
return user?.id === userId;
4214842154
}
4214942155
const profile = user.profile;
42150-
return ((email && profile?.email === email) ||
42156+
return (
42157+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
42158+
(email && profile?.email === email) ||
42159+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
4215142160
String(profile?.email).includes(username) ||
4215242161
profile?.display_name === username ||
4215342162
profile?.real_name === username);
@@ -42189,9 +42198,7 @@ class SlackClient {
4218942198
;// CONCATENATED MODULE: ./src/utils/test-data.ts
4219042199

4219142200

42192-
/**
42193-
* Get approved pull request as test data.
42194-
*/
42201+
// eslint-disable-next-line jsdoc/require-jsdoc
4219542202
function getApprovedPullRequest() {
4219642203
console.log(`Getting test data for user [${github.context.actor}]`);
4219742204
return {
@@ -42317,7 +42324,7 @@ async function main() {
4231742324
const withArchived = (0,core.getBooleanInput)('with-archived');
4231842325
const withPublic = (0,core.getBooleanInput)('with-public');
4231942326
const withDrafts = (0,core.getBooleanInput)('with-drafts');
42320-
const withPullReport = false; // Not an active feature yet
42327+
const withPullReport = false;
4232142328
const withUserMentions = (0,core.getBooleanInput)('with-user-mentions');
4232242329
const repositoryFilter = stringToArray((0,core.getInput)('repository-filter'));
4232342330
// https://github.com/actions/github-script/issues/436

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import eslintConfig from '@krauters/eslint-config'
2+
3+
export default eslintConfig

0 commit comments

Comments
 (0)