Skip to content

Commit 5efc1d1

Browse files
committed
chore: updated project framework and aligned with others
1 parent c83ceba commit 5efc1d1

13 files changed

+806
-397
lines changed

.eslintrc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@
2828
"no-constant-condition": 0,
2929
"no-useless-escape": 0,
3030
"no-console": "error",
31+
"no-restricted-globals": [
32+
"error",
33+
{
34+
"name": "global",
35+
"message": "Use `globalThis` instead"
36+
},
37+
{
38+
"name": "window",
39+
"message": "Use `globalThis` instead"
40+
}
41+
],
3142
"require-yield": 0,
3243
"eqeqeq": ["error", "smart"],
3344
"spaced-comment": [
@@ -39,7 +50,8 @@
3950
},
4051
"block": {
4152
"exceptions": ["*"]
42-
}
53+
},
54+
"markers": ["/"]
4355
}
4456
],
4557
"capitalized-comments": [
@@ -80,7 +92,8 @@
8092
],
8193
"pathGroupsExcludedImportTypes": [
8294
"type"
83-
]
95+
],
96+
"newlines-between": "never"
8497
}
8598
],
8699
"@typescript-eslint/no-namespace": 0,
@@ -102,7 +115,7 @@
102115
"@typescript-eslint/consistent-type-imports": ["error"],
103116
"@typescript-eslint/consistent-type-exports": ["error"],
104117
"no-throw-literal": "off",
105-
"@typescript-eslint/no-throw-literal": ["error"],
118+
"@typescript-eslint/no-throw-literal": "off",
106119
"@typescript-eslint/no-floating-promises": ["error", {
107120
"ignoreVoid": true,
108121
"ignoreIIFE": true

.gitlab-ci.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ check:test:
8181
path: ./tmp/coverage/cobertura-coverage.xml
8282
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
8383
rules:
84-
# Runs on staging commits and ignores version commits
84+
# Runs on feature commits and ignores version commits
8585
- if: $CI_COMMIT_BRANCH =~ /^feature.*$/ && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
8686
# Manually run on commits other than master and staging and ignore version commits
8787
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(?:master|staging)$/ && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
@@ -140,7 +140,6 @@ build:linux:
140140
- >
141141
nix-shell --arg ci true --run $'
142142
npm test -- --ci --coverage;
143-
npm run bench;
144143
'
145144
artifacts:
146145
when: always
@@ -150,7 +149,6 @@ build:linux:
150149
coverage_report:
151150
coverage_format: cobertura
152151
path: ./tmp/coverage/cobertura-coverage.xml
153-
metrics: ./benches/results/metrics.txt
154152
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
155153
rules:
156154
# Runs on staging commits and ignores version commits
@@ -169,9 +167,8 @@ build:windows:
169167
- .\scripts\choco-install.ps1
170168
- refreshenv
171169
- npm install --ignore-scripts
172-
- $env:Path = "$(npm bin);" + $env:Path
170+
- $env:Path = "$(npm root)\.bin;" + $env:Path
173171
- npm test -- --ci --coverage
174-
- npm run bench
175172
artifacts:
176173
when: always
177174
reports:
@@ -180,7 +177,6 @@ build:windows:
180177
coverage_report:
181178
coverage_format: cobertura
182179
path: ./tmp/coverage/cobertura-coverage.xml
183-
metrics: ./benches/results/metrics.txt
184180
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
185181
rules:
186182
# Runs on staging commits and ignores version commits
@@ -199,9 +195,8 @@ build:macos:
199195
- ./scripts/brew-install.sh
200196
- hash -r
201197
- npm install --ignore-scripts
202-
- export PATH="$(npm bin):$PATH"
198+
- export PATH="$(npm root)/.bin:$PATH"
203199
- npm test -- --ci --coverage
204-
- npm run bench
205200
artifacts:
206201
when: always
207202
reports:
@@ -210,7 +205,6 @@ build:macos:
210205
coverage_report:
211206
coverage_format: cobertura
212207
path: ./tmp/coverage/cobertura-coverage.xml
213-
metrics: ./benches/results/metrics.txt
214208
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
215209
rules:
216210
# Runs on staging commits and ignores version commits

jest.config.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,21 @@ module.exports = {
3333
roots: ['<rootDir>/tests'],
3434
testMatch: ['**/?(*.)+(spec|test|unit.test).+(ts|tsx|js|jsx)'],
3535
transform: {
36-
'^.+\\.tsx?$': 'ts-jest',
37-
'^.+\\.jsx?$': 'babel-jest',
36+
"^.+\\.(t|j)sx?$": [
37+
"@swc/jest",
38+
{
39+
jsc: {
40+
parser: {
41+
syntax: "typescript",
42+
tsx: true,
43+
decorators: compilerOptions.experimentalDecorators,
44+
dynamicImport: true,
45+
},
46+
target: compilerOptions.target.toLowerCase(),
47+
keepClassNames: true,
48+
},
49+
}
50+
],
3851
},
3952
reporters: [
4053
'default',
@@ -60,6 +73,9 @@ module.exports = {
6073
// Setup files after env are executed before each test file
6174
// after the jest test environment is installed
6275
// Can access globals
63-
setupFilesAfterEnv: ['<rootDir>/tests/setupAfterEnv.ts'],
76+
setupFilesAfterEnv: [
77+
'jest-extended/all',
78+
'<rootDir>/tests/setupAfterEnv.ts'
79+
],
6480
moduleNameMapper: moduleNameMapper,
6581
};

0 commit comments

Comments
 (0)