React.js #4
Replies: 4 comments 17 replies
-
Hello everyone! Would you tell me please how to check an empty folder using your plugin? I created a structure like this:
I added an extra folder "bbb" to the src folder. The only way I can run eslint is This command |
Beta Was this translation helpful? Give feedback.
-
Can I ask one more question please? |
Beta Was this translation helpful? Give feedback.
-
What's about the extension restriction and children? I have a nested folder called "translations". Inside that folder I want to allow only two files: de.json and en.json. This doesnt work... The mentioned script is added. |
Beta Was this translation helpful? Give feedback.
-
Unexpected Folder Structure Errors in eslint-plugin-project-structureHello, I'm encountering unexpected errors while using eslint-plugin-project-structure. I believe my folder structure follows the defined rules, but the plugin is flagging many files and folders as incorrect. My folder structure definition is as follows: export const folderStructureConfig = createFolderStructure({
structure: {
children: [
{ name: "*" },
{
name: "src",
children: [
{ name: "App.tsx" },
{ name: "main.tsx" },
{ name: "vite-env.d.ts" },
{
name: "@commons",
children: [
{ name: "components", ruleId: "componentRule" },
{ name: "constants", ruleId: "tsRule" },
{ name: "hooks", ruleId: "hooksRule" },
{ name: "layouts", ruleId: "componentRule" },
{ name: "routes", ruleId: "componentRule" },
{ name: "services", ruleId: "tsRule" },
{ name: "stores", ruleId: "tsRule" },
{ name: "types", ruleId: "tsRule" },
{ name: "utilities", ruleId: "tsRule" },
],
},
{ name: "assets", children: [{ name: "*" }] },
{ name: "domains", ruleId: "domainRule" },
{
name: "styles",
children: [
{ name: "*.styles.ts" },
{ name: "Theme", children: [{ name: "*.theme.ts" }] },
],
},
],
},
],
},
rules: {
hooksRule: {
children: [
{ name: ".gitkeep" },
{ name: "use{PascalCase}.ts" },
{
name: "use{PascalCase}",
children: [
{ name: ".gitkeep" },
{ name: "use{PascalCase}.ts" },
{ name: "use{PascalCase}", ruleId: "hooksRule" },
],
},
],
},
componentRule: {
children: [
{ name: ".gitkeep" },
{ name: "{PascalCase}(.styled)?.tsx" },
{
name: "{PascalCase}",
children: [
{ name: ".gitkeep" },
{ name: "{PascalCase}(.styled)?.tsx" },
{ name: "{PascalCase}", ruleId: "componentRule" },
],
},
],
},
tsRule: {
children: [
{ name: ".gitkeep" },
{ name: "{camelCase}(.*)?.ts" },
{
name: "{camelCase}",
children: [
{ name: ".gitkeep" },
{ name: "{camelCase}(.*)?.ts" },
{ name: "{camelCase}", ruleId: "tsRule" },
],
},
],
},
domainRule: {
children: [
{
name: "{kebab-case}",
children: [
{ name: "apis", ruleId: "tsRule" },
{ name: "components", ruleId: "componentRule" },
{ name: "hooks", ruleId: "hooksRule" },
{ name: "layouts", ruleId: "componentRule" },
{ name: "pages", ruleId: "componentRule" },
{ name: "types", ruleId: "tsRule" },
],
},
{ name: "{kebab-case}", ruleId: "domainRule" },
],
},
},
}); However, I'm getting the following errors:
These errors seem inconsistent with the rules I've defined. Specifically:
How can I resolve these issues? I'm wondering if I've defined the rules incorrectly or if the plugin is misinterpreting the rules. eslint-plugin-project-structure version: [2.1.12] Thank you for your help. |
Beta Was this translation helpful? Give feedback.
-
All questions and answers related to React.js project structure.
Beta Was this translation helpful? Give feedback.
All reactions