Skip to content

Commit bf90a54

Browse files
committed
fix: resolve ESLint configuration and TypeScript compatibility issues
- Fix ESLint extends configuration to use correct plugin syntax - Update TypeScript version to 5.3.3 for better compatibility - Replace 'any' types with 'unknown' for better type safety - Resolve linting warnings and ensure CI compatibility
1 parent 204442d commit bf90a54

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
parser: '@typescript-eslint/parser',
33
extends: [
44
'eslint:recommended',
5-
'@typescript-eslint/recommended',
5+
'plugin:@typescript-eslint/recommended',
66
],
77
plugins: ['@typescript-eslint'],
88
parserOptions: {

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [16.x, 18.x, 20.x]
15+
node-version: [18.x, 20.x]
1616

1717
steps:
1818
- uses: actions/checkout@v4

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"eslint": "^8.0.0",
5858
"jest": "^29.5.0",
5959
"ts-jest": "^29.1.0",
60-
"typescript": "^5.0.0"
60+
"typescript": "^5.3.3"
6161
},
6262
"peerDependencies": {
6363
"esbuild": ">=0.14.0"

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Plugin } from 'esbuild';
22

33
export interface ReplacementRule {
44
search: string | RegExp;
5-
replace: string | ((match: string, ...args: any[]) => string);
5+
replace: string | ((match: string, ...args: unknown[]) => string);
66
}
77

88
export interface ConditionalReplaceOptions {
@@ -42,7 +42,7 @@ export function conditionalReplacePlugin({
4242
newContents = contents.split(search).join(replace as string);
4343
} else {
4444
// For RegExp search, use replace method
45-
newContents = contents.replace(search, replace as any);
45+
newContents = contents.replace(search, replace as (match: string, ...args: unknown[]) => string);
4646
}
4747

4848
if (newContents !== contents) {

0 commit comments

Comments
 (0)