permitio / permit-cli

A command line utility from Permit.io to work with everything IAM and Authorization. A one-stop-shop to manage all your Authorization tools (OPA, OpenFGA, Cedar, OPAL, AVP...) as well as the Permit Service.
21 stars 27 forks source link

Add a Set of ESLint Rules and Clear the Errors/Warning #15

Closed gemanor closed 5 days ago

gemanor commented 4 weeks ago

Before attempting this issue, please share the set of the rules you're planning to put

We want to have better and more consistent linting rules in the tool that will not balance productivity with efficiency. This task is about having ESLint implemented in the repository with a set of rules that fit the application and cleaning the current warnings.

Acceptance criteria:

gemanor commented 4 weeks ago

/bounty 150

algora-pbc[bot] commented 4 weeks ago

šŸ’Ž $150 bounty ā€¢ Permit.io

Steps to solve:

  1. Start working: Comment /attempt #15 with your implementation plan
  2. Submit work: Create a pull request including /claim #15 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to permitio/permit-cli!

Add a bounty ā€¢ Share on socials

Attempt Started (GMT+0) Solution
šŸŸ¢ @Mubashirshariq Oct 28, 2024, 3:59:33 PM #21
šŸŸ¢ @asr2003 Oct 28, 2024, 4:30:43 PM WIP
šŸŸ¢ @gsaivinay Oct 28, 2024, 5:45:19 PM #22
Mubashirshariq commented 4 weeks ago

/attempt #15

Algora profile Completed bounties Tech Active attempts Options
@Mubashirshariq 3 bounties from 3 projects
JavaScript, TypeScript,
HTML
Cancel attempt
asr2003 commented 4 weeks ago

@gemanor Iā€™m planning to implement the following set of ESLint rules for the project:

  • @typescript-eslint/no-explicit-any: Warns when any type is used, to encourage better typing practices
  • @typescript-eslint/no-unused-vars: Throws an error for unused variables, helping clean up the code
  • no-console: Warns when console.log is used, to avoid leaving debug statements in production code
  • prefer-const: Warns when variables could be declared as const but are not
  • prettier/prettier: Enforces the existing Prettier configuration from .prettierrc

I will add the above rules and fix warnings along the way and also add some other eslint rules further if needed. Let me know if any further refinement/changes needed (PS: I have referred above from a blog docs)

With this /attempt #15

Algora profile Completed bounties Tech Active attempts Options
@asr2003 8 bounties from 4 projects
Rust, TypeScript,
Go & more
Cancel attempt
gsaivinay commented 4 weeks ago

/attempt #15

  • Extends the js.configs.recommended, plugin:react/recommended, and eslint-config-prettier configurations
  • Includes the @typescript-eslint/eslint-plugin, eslint-plugin-react, eslint-plugin-react-hooks, and eslint-plugin-prettier plugins
  • Uses the @typescript-eslint/parser TypeScript parser
  • Specifies global variables for Headers, RequestInit, and fetch
  • Applies recommended rulesets from the @typescript-eslint/eslint-plugin, eslint-plugin-react, and eslint-plugin-react-hooks plugins
  • Enables prettier/prettier formatting with a "warn" level
  • Warns on @typescript-eslint/no-unused-vars
  • Disables the react/react-in-jsx-scope rule
Algora profile Completed bounties Tech Active attempts Options
@gsaivinay 1 bounty from 1 project
Python
Cancel attempt
algora-pbc[bot] commented 4 weeks ago

šŸ’” @Mubashirshariq submitted a pull request that claims the bounty. You can visit your bounty board to reward.

gemanor commented 3 weeks ago

@Mubashirshariq , we usually gives these bounties first come, first serve priority, but @gsaivinay's solution is more clean and uses ready-made rules Please take 1 day to make your PR comply with @gsaivinay to make it yours, or instead agree with him on splitting the bounties.

gemanor commented 5 days ago

@gsaivinay we will go with @Mubashirshariq PR. @Mubashirshariq I added some comments on the PR

gsaivinay commented 5 days ago

@gemanor

although I haven't agreed on taking ownership, it is fine by me as first come first priority.

algora-pbc[bot] commented 1 day ago

šŸŽ‰šŸŽˆ @Mubashirshariq has been awarded $180! šŸŽˆšŸŽŠ