Skip to content

Commit ef180af

Browse files
Update ESLint configuration and dependencies
- Modified ESLint configuration to target only TypeScript files (`**/*.ts`) by removing TypeScript React files (`**/*.tsx`). - Enhanced naming convention rules to exclude const variables from the default identifier rule and updated the filter for variable naming to ensure uppercase constants are not matched. - Added `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` as devDependencies in `package.json` to support TypeScript linting. These changes refine the linting process for TypeScript files and improve code quality standards across the project.
1 parent ff7c757 commit ef180af

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

workers/main/eslint.config.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import simpleImportSort from 'eslint-plugin-simple-import-sort';
66

77
export default [
88
{
9-
files: ['**/*.ts', '**/*.tsx'],
9+
files: ['**/*.ts'],
1010
settings: {
1111
'import/resolver': {
1212
typescript: {
@@ -67,12 +67,16 @@ export default [
6767
// Naming conventions based on naming-cheatsheet: https://github.com/kettanaito/naming-cheatsheet
6868
'@typescript-eslint/naming-convention': [
6969
'warn',
70-
// Default rule for all identifiers
70+
// Default rule for all identifiers (excluding const variables)
7171
{
7272
selector: 'default',
7373
format: ['camelCase'],
7474
leadingUnderscore: 'allow',
7575
trailingUnderscore: 'allow',
76+
filter: {
77+
regex: '^[A-Z_]+$',
78+
match: false
79+
}
7680
},
7781
// Prevent interfaces starting with 'I'
7882
{
@@ -92,10 +96,11 @@ export default [
9296
{
9397
selector: 'variable',
9498
modifiers: ['const'],
99+
types: ['string', 'number', 'boolean'],
95100
format: ['UPPER_CASE'],
96101
filter: {
97102
regex: '^[A-Z_]+$',
98-
match: true
103+
match: false
99104
}
100105
}
101106
],

workers/main/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
},
1010
"devDependencies": {
1111
"@eslint/js": "9.27.0",
12+
"@typescript-eslint/eslint-plugin": "8.39.0",
13+
"@typescript-eslint/parser": "8.39.0",
1214
"@temporalio/testing": "1.11.8",
1315
"@types/node": "22.15.21",
1416
"@types/simple-oauth2": "5.0.7",
@@ -36,8 +38,6 @@
3638
"@temporalio/client": "1.11.8",
3739
"@temporalio/worker": "1.11.8",
3840
"@temporalio/workflow": "1.11.8",
39-
"@typescript-eslint/eslint-plugin": "8.39.0",
40-
"@typescript-eslint/parser": "8.39.0",
4141
"axios": "1.9.0",
4242
"axios-rate-limit": "1.4.0",
4343
"axios-retry": "4.5.0",
@@ -46,4 +46,4 @@
4646
"simple-oauth2": "5.1.0",
4747
"zod": "3.25.17"
4848
}
49-
}
49+
}

0 commit comments

Comments
 (0)