ESLint Config Migration: Add a src/types-specific rule#1025
ESLint Config Migration: Add a src/types-specific rule#1025filmaj merged 2 commits intotslint-to-eslintfrom
Conversation
|
@filmaj Thanks for flagging this! I also have been aware of the inconsistency of the
Changing the names is not a small breaking change for existing apps and online resources by us and communities. For this reason, I agree that we should keep the names as-is. For the future, we can try to make property naming as consistent as possible. |
|
@seratch thanks for the context! Agreed that breaking backwards compatibility to enforce lint rules does not seem worth it at all 😆 I will adjust the rules so that both snake_case and camelCase are accepted. |
0aadb71 to
3eec381
Compare
3eec381 to
3841b6d
Compare
Summary
This is a PR that should be merged into #1024 and incrementally addresses #842.
This change extends the proposed ESLint config to allow for type properties in
src/types/**/*.tsfiles to be named in snake_case. Of the 1342 linting problems still to resolve in #1024, 830 of them are for the@typescript-eslint/naming-contentionrule (specifically: about renaming these properties to be camelCase), and this PR drops the number of problems from 1342 down to 745.Here is an example of the
naming-conventionsrule failing without the changes in this pull request:That said, even with enabling this rule, turns out some type properties under
src/typesthen fail as we use camelCase for them 😄:What does the team think? Do we want to enforce naming conventions for
src/types? I am coming at this task from a place of ignorance; I don't know how the source "should" look like, so this is an attempt at formalizing whatever style already exists in the project as the canonical ESLint style. If this is not the direction we want to go, cool - I am happy to tackle renaming the type properties. Consider this PR a place to discuss and debate 😄Requirements (place an
xin each[ ])