-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(utils): add string helper #916
base: main
Are you sure you want to change the base?
Conversation
Code PushUp🤨 Code PushUp report has both improvements and regressions – compared target commit d34b256 with source commit 6c7ed9f. 🕵️ See full comparison in Code PushUp portal 🔍 🏷️ Categories👍 2 groups improved, 👎 1 group regressed, 👍 5 audits improved, 👎 6 audits regressed, 10 audits changed without impacting score🗃️ Groups
15 other groups are unchanged. 🛡️ Audits
574 other audits are unchanged. |
# Conflicts: # packages/utils/src/index.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job with the refactor and the tests 👍
I think the type tests need some more setup (see comments), but I don't see it as a blocker for this PR.
import { assertType, describe, expectTypeOf, it } from 'vitest'; | ||
import type { CamelCaseToKebabCase, KebabCaseToCamelCase } from './types.js'; | ||
|
||
/* eslint-disable vitest/expect-expect */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible to configure alternative assertion function names to expect
using assertFunctionNames
option. I suggest adding this configuration to the base eslint.config.js
:
export default tseslint.config(
// ...
{
files: ['**/*.type.test.ts'],
rules: {
'vitest/expect-expect': [
'error',
{ assertFunctionNames: ['expectTypeOf', 'assertType'] },
],
},
},
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed these type tests aren't included anywhere. Extending the vite.config.unit.ts
configuration like this includes them in unit-test
target:
export default defineConfig({
// ...
test: {
// ...
typecheck: {
enabled: true,
include: ['**/*.type.test.ts'],
},
},
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR includes helper for the TypeScript plugin #902