Skip to content
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

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

Open
gemanor opened this issue Oct 28, 2024 · 8 comments · May be fixed by #21 or #22
Open

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

gemanor opened this issue Oct 28, 2024 · 8 comments · May be fixed by #21 or #22

Comments

@gemanor
Copy link
Collaborator

gemanor commented Oct 28, 2024

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:

  • Implement set of rules and clear the current warning/errors in the code
  • Add a command to run the linting
  • Share a video with sanity check of all the features in the CLI (so we know they haven't broken)
@gemanor
Copy link
Collaborator Author

gemanor commented Oct 28, 2024

/bounty 150

Copy link

algora-pbc bot commented Oct 28, 2024

💎 $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 bountyShare 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
Copy link

Mubashirshariq commented Oct 28, 2024

  • no-unused-vars: Throws an error for declared variables that are not used, keeping the code clean and efficient.
  • no-undef: Throws an error when using undeclared variables, preventing potential reference errors.
  • @typescript-eslint/no-explicit-any: Warns when the any type is used, to encourage better typing practices.
  • @typescript-eslint/no-unused-vars: Throws an error for unused variables, helping to 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, promoting better immutability.
  • prettier/prettier: Enforces the existing Prettier configuration from .prettierrc.

/attempt #15

Algora profile Completed bounties Tech Active attempts Options
@Mubashirshariq 3 bounties from 3 projects
JavaScript, TypeScript,
HTML
Cancel attempt

@asr2003
Copy link

asr2003 commented Oct 28, 2024

@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
Copy link

gsaivinay commented Oct 28, 2024

/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

@Mubashirshariq Mubashirshariq linked a pull request Oct 28, 2024 that will close this issue
Copy link

algora-pbc bot commented Oct 28, 2024

💡 @Mubashirshariq submitted a pull request that claims the bounty. You can visit your bounty board to reward.

@gsaivinay gsaivinay linked a pull request Oct 28, 2024 that will close this issue
Copy link

algora-pbc bot commented Oct 28, 2024

💡 @gsaivinay submitted a pull request that claims the bounty. You can visit your bounty board to reward.

@gemanor
Copy link
Collaborator Author

gemanor commented Nov 3, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants