App: [HOLD for payment 2022-09-16] [$500] New Lint Rule: DisplayName property
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Write a functional component but don’t set the displayName property OR write a class component and set the displayName property.
Expected Result:
ESLint should complain.
Actual Result:
ESLint does not complain.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 40 (33 by maintainers)
I think we can cap the price for this.
Happy to help with publishing the package
Super quick turnaround there, thanks. Paid.
@andrewlor They’re just displayName errors right? If yes, I’ll fix them with a follow-up PR because it shouldn’t take more than 10 mins.
Looks good to me too 👍 Since this property displays error message according to class/functional component, I’m fine with single rule.
Ohh, so filename is inferred from the foldername. That should work. If there are any edge cases, the tests will catch them and we can fix them in the PR
Good point. We can just modify slightly to handle that case.
Hopefully that should cover everything? Assuming component files should only be in those two formats:
Test/index.jsorTest.js.@rushatgabhane Correct. As I understand it, for each rule I should add two files:
eslint-plugin-expensify/<rulename>.jsandeslint-plugin-expensify/tests/<rulename>.test.js, and also add an entry in https://github.com/Expensify/eslint-config-expensify/blob/main/rules/expensify.js.As for your second point, having these as two separate rules, I think that makes sense could make the code slightly more simple to read. I have no objections writing it like that.
@andrewlor you’ll be creating a new file over here https://github.com/Expensify/eslint-config-expensify/tree/main/eslint-plugin-expensify right?