Skip to content

Commit 0ca546e

Browse files
dependabot[bot]gstraccini[bot]guibranco
authored
Bump eslint from 8.57.1 to 9.19.0 (#349)
* Bump eslint from 8.57.1 to 9.19.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.57.1 to 9.19.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.57.1...v9.19.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Delete unused file * Migrate ESLint from v8 to v9 * Update configuration file location * Fix file * Update files * Update package-lock.json * Restore files * #9 chore add commit message hook and update linter configuration * #9 chore - update ESLint configuration file for dependencies changes * #9 chore - update eslint configuration to remove lib exclusion * #9 chore - update dependencies in ESLint configuration and package files * #9 chore - update eslint config with new regex and rules * Update linter.yml * Fixing lint problems with autofix * Update linter.yml * Generate dist files * Update linter.yml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com> Co-authored-by: Guilherme Branco Stracini <[email protected]>
1 parent cfac6e2 commit 0ca546e

File tree

11 files changed

+982
-1125
lines changed

11 files changed

+982
-1125
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.githooks/prepare-commit-msg

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env sh
2+
3+
# This script generates an AI-powered commit message using dotnet-aicommitmessage.
4+
# It can be bypassed by setting the GIT_AICOMMIT_SKIP environment variable.
5+
6+
# Exit immediately if GIT_AICOMMIT_SKIP is set
7+
if [ -n "$GIT_AICOMMIT_SKIP" ]; then
8+
exit 0
9+
fi
10+
11+
# Check if dotnet-aicommitmessage is installed and in PATH
12+
if ! command -v dotnet-aicommitmessage >/dev/null 2>&1; then
13+
echo "Error: dotnet-aicommitmessage is not installed or not in PATH" >&2
14+
echo "Please install it by running 'dotnet tool install -g aicommitmessage'" >&2
15+
exit 1
16+
fi
17+
18+
# Ensure the commit message file is provided
19+
if [ -z "$1" ]; then
20+
echo "Error: Commit message file not provided" >&2
21+
exit 1
22+
fi
23+
24+
COMMIT_MSG_FILE="$1"
25+
26+
# Check if the commit message file exists
27+
if [ ! -f "$COMMIT_MSG_FILE" ]; then
28+
echo "Error: Commit message file '$COMMIT_MSG_FILE' not found" >&2
29+
exit 1
30+
fi
31+
32+
# Read the current commit message
33+
CURRENT_MESSAGE=$(cat "$COMMIT_MSG_FILE")
34+
35+
# Backup the commit message file
36+
cp "$COMMIT_MSG_FILE" "${COMMIT_MSG_FILE}.bak"
37+
38+
# Generate the AI commit message
39+
if ! AI_MESSAGE=$(dotnet-aicommitmessage generate-message -m "$CURRENT_MESSAGE" 2>/dev/null); then
40+
echo "Error: Failed to generate AI commit message. Using original message." >&2
41+
exit 0
42+
fi
43+
44+
# Check if the generated message is empty
45+
if [ -z "$AI_MESSAGE" ] || echo "$AI_MESSAGE" | grep -q '^[[:space:]]*$'; then
46+
echo "Error: Generated commit message is empty." >&2
47+
exit 1
48+
fi
49+
50+
# Write the new commit message back to the file
51+
if ! echo "$AI_MESSAGE" > "$COMMIT_MSG_FILE" 2>/dev/null; then
52+
echo "Error: Failed to write new commit message" >&2
53+
cp "${COMMIT_MSG_FILE}.bak" "$COMMIT_MSG_FILE"
54+
rm "${COMMIT_MSG_FILE}.bak"
55+
exit 1
56+
fi
57+
58+
# Remove the backup file
59+
rm "${COMMIT_MSG_FILE}.bak"
60+
exit 0

.github/linters/.eslintrc.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

.github/linters/eslint.config.mjs

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import jest from 'eslint-plugin-jest'
2+
import typescriptEslint from '@typescript-eslint/eslint-plugin'
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 __filename = fileURLToPath(import.meta.url)
11+
const __dirname = path.dirname(__filename)
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all
16+
})
17+
18+
export default [
19+
{
20+
ignores: [
21+
'!**/.*',
22+
'**/node_modules/.*',
23+
'**/dist/**',
24+
'**/coverage/**',
25+
'**/*.json',
26+
'**/__test__/**',
27+
'**/.github/**'
28+
]
29+
},
30+
...compat.extends(
31+
'eslint:recommended',
32+
'plugin:@typescript-eslint/eslint-recommended',
33+
'plugin:@typescript-eslint/recommended',
34+
'plugin:github/recommended',
35+
'plugin:jest/recommended',
36+
),
37+
{
38+
plugins: {
39+
jest,
40+
'@typescript-eslint': typescriptEslint
41+
},
42+
43+
languageOptions: {
44+
globals: {
45+
...globals.node,
46+
...globals.jest,
47+
Atomics: 'readonly',
48+
SharedArrayBuffer: 'readonly',
49+
BufferEncoding: 'readonly',
50+
},
51+
52+
parser: tsParser,
53+
ecmaVersion: 2023,
54+
sourceType: 'module',
55+
56+
parserOptions: {
57+
project: ['./.github/linters/tsconfig.json', './tsconfig.json']
58+
}
59+
},
60+
61+
rules: {
62+
camelcase: 'off',
63+
'eslint-comments/no-use': 'off',
64+
'eslint-comments/no-unused-disable': 'off',
65+
'i18n-text/no-en': 'off',
66+
'import/no-namespace': 'off',
67+
'no-console': 'off',
68+
'no-unused-vars': 'off',
69+
'prettier/prettier': 'error',
70+
'filenames/match-regex': 'off',
71+
semi: 'off',
72+
'@typescript-eslint/array-type': 'error',
73+
'@typescript-eslint/await-thenable': 'error',
74+
'@typescript-eslint/ban-ts-comment': 'error',
75+
'@typescript-eslint/consistent-type-assertions': 'error',
76+
77+
'@typescript-eslint/explicit-member-accessibility': [
78+
'error',
79+
{
80+
accessibility: 'no-public'
81+
}
82+
],
83+
84+
'@typescript-eslint/explicit-function-return-type': [
85+
'error',
86+
{
87+
allowExpressions: true
88+
}
89+
],
90+
91+
'@typescript-eslint/no-array-constructor': 'error',
92+
'@typescript-eslint/no-empty-interface': 'error',
93+
'@typescript-eslint/no-explicit-any': 'error',
94+
'@typescript-eslint/no-extraneous-class': 'error',
95+
'@typescript-eslint/no-for-in-array': 'error',
96+
'@typescript-eslint/no-inferrable-types': 'error',
97+
'@typescript-eslint/no-misused-new': 'error',
98+
'@typescript-eslint/no-namespace': 'error',
99+
'@typescript-eslint/no-non-null-assertion': 'warn',
100+
'@typescript-eslint/no-require-imports': 'error',
101+
'@typescript-eslint/no-unnecessary-qualifier': 'error',
102+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
103+
'@typescript-eslint/no-unused-vars': 'error',
104+
'@typescript-eslint/no-useless-constructor': 'error',
105+
'@typescript-eslint/no-var-requires': 'error',
106+
'@typescript-eslint/prefer-for-of': 'warn',
107+
'@typescript-eslint/prefer-function-type': 'warn',
108+
'@typescript-eslint/prefer-includes': 'error',
109+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
110+
'@typescript-eslint/promise-function-async': 'error',
111+
'@typescript-eslint/require-array-sort-compare': 'error',
112+
'@typescript-eslint/restrict-plus-operands': 'error',
113+
'@typescript-eslint/space-before-function-paren': 'off',
114+
'@typescript-eslint/unbound-method': 'error'
115+
}
116+
}
117+
]

.github/workflows/linter.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
DEFAULT_BRANCH: main
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545
TYPESCRIPT_DEFAULT_STYLE: prettier
46+
VALIDATE_TYPESCRIPT_STANDARD: false
47+
VALIDATE_JAVASCRIPT_STANDARD: false
4648
VALIDATE_JSCPD: false
4749
VALIDATE_CHECKOV: false
48-
VALIDATE_TYPESCRIPT_STANDARD: false

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21.6.2
1+
22.13.1

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2024 Guilherme Branco Stracini
3+
Copyright (c) 2025 Guilherme Branco Stracini
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software") to deal

dist/index.js

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

0 commit comments

Comments
 (0)