People like to complain about stupid things like devs using the React.FC syntax sparingly, and I like to fix stupid things so to avoid all the complaining and arguing I set up a few new linting rules to disallow just that.
Now go and argue with ESLINT, I don't care (not that I cared before).
Using React as a global var is not allowed.
Importing React as a default import is not allowed.
Using the React.<something> syntax is not allowed (this only works inside functions).
You can obviously disable the rules on a per file basis if that's what your heart desires.
Steps:
You should pull this branch and test it locally.
Try to use React.FC, React.useState, etc. It shouldn't be possible.
Note
This will probably create some conflicts if it gets merged into main before the other pending pull requests. In that case (assuming this was merged into main and there's some other branch you're working on still not merged):
Pull the latest changes from main
Merge main into your branch.
Oh, lotsa conflicts! Don't worry, the only things I changed were ESLINT's rules and the removal of all the React. instances everywhere.
Just accept your fate and resolve the conflicts. The files on your branch are the good ones, don't overthink it.
Now you should have all the conflicts resolved, but probably your files will throw some errors when trying to commit / push the changes (remember, we can't use React anymore).
Fix all the errors, it should be simple.
Save, commit, push, done.
Type of change:
[ ] New feature
[ ] Bug fix
[ ] Breaking change
[ ] Enhancement
[ ] Refactoring
[x] Chore
How Has This Been Tested?
[x] Manual testing
[ ] Automated tests
[ ] Other (explain)
Remember to check that:
Your code follows the style guidelines of this project
You have performed a self-review of your code
You have commented your code in hard-to-understand areas
You have made corresponding changes to the documentation
Closes #151
Description:
People like to complain about stupid things like devs using the
React.FC
syntax sparingly, and I like to fix stupid things so to avoid all the complaining and arguing I set up a few new linting rules to disallow just that.Now go and argue with ESLINT, I don't care (not that I cared before).
React
as a global var is not allowed.React
as a default import is not allowed.React.<something>
syntax is not allowed (this only works inside functions).You can obviously disable the rules on a per file basis if that's what your heart desires.
Steps:
React.FC
,React.useState
, etc. It shouldn't be possible.Note
This will probably create some conflicts if it gets merged into main before the other pending pull requests. In that case (assuming this was merged into
main
and there's some other branch you're working on still not merged):main
main
into your branch.React.
instances everywhere.React
anymore).Type of change:
How Has This Been Tested?
Remember to check that: