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
Configure ESLint rules for shared folders, bump ESLint deps #453
Conversation
"@typescript-eslint/no-misused-promises": [ | ||
"error", // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.md#checksvoidreturn | ||
{ "checksVoidReturn": { "attributes": false, "properties": false } } | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to make this rule a bit more loose after upgrading "@typescript-eslint/eslint-plugin"
. See typescript-eslint/typescript-eslint#4650 and https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.md#checksvoidreturn for context. The rule is not less strict that it was.
{ | ||
"files": ["**/shared/**/*"], | ||
"rules": { | ||
"canonical/filename-no-index": "error", | ||
"unicorn/filename-case": "error" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main part of the PR
π What is the purpose of this PR?
@teenoh and I are moving UI components into
[frontend]/src/shared/ui
. We will be trying the new fractal tree approach for the folder structure to make codebase development more consistent and robust.This PR configures two new ESLint rules for the future
shared
folders infrontend
. It also upgrades ESLint-related dependencies given the opportunity.πΎ Next steps
Move primitive UI components to
[frontend]/src/shared/ui
, following the new file structure. This will enable UI development for the new Entity Editor: Entity editor header WIPΒ #445Use
kebab-case
in[frontend]/src/pages
to be able to lint localshared
inside pages.Consider converting the new
ui
folder into a package (we'll need that for blocks).π What does this change?
New ESLint rule:
"canonical/filename-no-index"
β makes sure we donβt useindex.ts(x)
files in the new shared folder as this is against the new experimental file structure rules.New ESLint rule:
"unicorn/filename-case"
β makes sure we usekebab-case
only.camelCase
is more error-prone.All ESLint dependencies are updated.
π Does this require a change to the docs?
π Related links
π‘ What tests cover this?
β How to test this?
Check CI
πΉ Demo
With the new rules, creating
index.ts(x)
orhelloWorld.ts
will produce the following: