Closed jordan-ae closed 6 months ago
You also should not change any other files.
@0x4007 The other modifications were made my running the linters. If you check the changes you'll see the linters just added spaces where it seemed necessary and all that. I can revert the changes if they will cause any issues though.
There actually already is a rule for PascalCase
interfaces, no need to create a new one. The thing is that rule enforces Pascal Case
but not strictly meaning you can chain uppercase letters.
If we want to prevent this we can use StrictPascalCase
. Maybe it would be a good idea to use it everywhere @0x4007 ?
See also: https://typescript-eslint.io/rules/naming-convention/#format-options
That rule seems to only check for the first character being capitalized according to the docs. I think a regex that looks for three or more consecutive capitalized letters should be flagged as an error
StrictPascalCase
will enforce no more that one capital letter inside the name, regardless of the position. Example:
Quoting the docs: "consecutive capitals are not allowed (i.e. myId is valid, but myID is not)."
I think let's use strictpascalcase then!
@0x4007 Shall this be applied to other elements too, like variables etc? There is the same version for camel case called StrictCamelCase
.
Yes let's apply this across all identifiers.
@0x4007, @gentlementlegen I've added StrictPascalCase to the eslint rules. They'll be a couple of errors in certain files due to the new eslint configuration which I haven't changed because of this comment. I'd love to clean up the files though!
You also should not change any other files.
I also suggest we create a pre-commit hook. By doing so we can ensure no errors go into the repository and enforce code style. The pre-commit hook will run only on staged files to avoid slow and irrelevant processes.
We have lint-staged for this purpose but perhaps it's not configured correctly.
We have lint-staged for this purpose but perhaps it's not configured correctly.
Okay I'll take sometime to look into that too
@gentlementlegen please can you review? Thanks
Hey @0x4007 I've undone all the changes not related to the issue. This should be ready to go now!
I think let's use strictpascalcase then!I
I thought we were going full in on StrictPascalCase 😬
… naming conventions
Resolves #39