prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.43k stars 255 forks source link

refactor: Enhanced Readability and Efficiency #273

Closed lucioerlan closed 9 months ago

lucioerlan commented 10 months ago

This PR:

Changes: lines-around-comment: Introduced an array requiredProperties and the use of the every() method for validation, making the code more concise and easier to update.

unicorn/template-indent: Employed a Set for forbidden elements and a dedicated function for checking, improving performance and readability.

Justification:

References: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every

lydell commented 9 months ago

Hi! Thanks for the pull request. I find the code good as-is though.

lucioerlan commented 9 months ago

lydell

That's just your opinion and I respect it.

I often use this package in my projects and recently encountered an error while using it. So, I decided to look into how it was made and saw an opportunity to improve it. This was just one of several enhancements I intended to make. Anyway, thank you for responding.