-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor and optimize codebase #2
Conversation
- Heading levels should only increment by one level at a time.
- Fixed 1 high and 1 moderate vulnerabilities.
Hi. Thanks, but there are important rules for open source:
If you can get the formatting back, I can take a look and possibly accept this PR. Thanks any way. |
Hello @SanichKotikov, will do! But first, I'd want to know if the aforementioned formatting include reverting back from |
@RoachxD It's preferable to use named functions, especially for components, because arrow functions can be marked as unknown/unnamed in some debug tools. |
- Prettier has been added and configured for this project. - The `.gitignore` file has been updated. - A new `.prettierignore` file has been created.
- Created `index.ts` file for `components`. - Updated main `index.ts` in order to reflect the above addition. - Sorted imports inside main `index.ts`.
- Created `utils.ts` and added a micro-optimized version of `isEmpty` from 'i18n-mini/lib/utils', which is ~70% faster. - Updated `DateTime.tsx` and `Numeric.tsx` components to use the new optimized `isEmpty` function.
- Defined a new constant for preset values. - Reversed ternary operator. - Used nullish coalescing operator instead of the logical OR operator.
- Formatted all files through Prettier (`npx prettier . --write`).
Do you think I should PR on i18n-mini in regards to the optimized version of |
@RoachxD thanks, but I can't merge this PR. I've asked you to reduce count of changes, but instead of this you add more and more... It's better to keep one thing in one PR. |
@RoachxD I've made some updates. Thanks for highlighting some of the issues. About Object.values and isEmpty, I think, it's better to update it in i18n-mini and keep functional style, for example use |
@SanichKotikov I understand, sorry for being that unstructured because of my eagerness! I will be creating multiple issues and wait for your answers in order to see if it's viable or not to create a PR based on your opinion. Thanks! |
This pull request contains several changes to the codebase that aim to improve its readability and performance. The main changes are:
MD001/heading-increment/header-increment
rule violation inREADME.md
.package-lock.json
.index.ts
.index.ts
,context.ts
,DateTime.tsx
,I18nProvider.tsx
,Number.tsx
, andText.tsx
.DateTime.tsx
andNumber.tsx
.DateTime.tsx
andNumber.tsx
.if
statement incontext.ts
.Suggest using
Object.values
instead ofisEmpty
for micro-optimizingDateTime.tsx
andNumber.tsx
.These changes do not affect the functionality or the output of the code, but they make it more consistent, concise, and maintainable. I hope you find them useful and welcome any feedback or suggestions. Thank you for your time and consideration.