From bf236ae96cf45fc03f99afd9bb16d5979b762b4b Mon Sep 17 00:00:00 2001 From: Igor Kowalski Date: Wed, 2 Oct 2024 14:52:59 +0200 Subject: [PATCH] 3.0.1 --- package.json | 2 +- .../validateFile/helpers/validateRules/validateRules.ts | 4 +++- .../fileComposition/helpers/validateFile/validateFile.test.ts | 1 + .../fileComposition/helpers/validateFile/validateFile.ts | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0d08b95..9e5e43b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Igor Kowalski (Igorkowalski94)", "name": "eslint-plugin-project-structure", - "version": "3.0.0", + "version": "3.0.1", "license": "MIT", "description": "Powerful ESLint plugin with rules to help you achieve a scalable, consistent, and well-structured project. Create your own framework! Define your folder structure, file composition, advanced naming conventions, and create independent modules. Take your project to the next level and save time by automating the review of key principles of a healthy project! react folder structure react file structure react project structure react conventions architecture react next.js angular node solid vue svelte", "keywords": [ diff --git a/src/rules/fileComposition/helpers/validateFile/helpers/validateRules/validateRules.ts b/src/rules/fileComposition/helpers/validateFile/helpers/validateRules/validateRules.ts index 83e18b6..8c51984 100644 --- a/src/rules/fileComposition/helpers/validateFile/helpers/validateRules/validateRules.ts +++ b/src/rules/fileComposition/helpers/validateFile/helpers/validateRules/validateRules.ts @@ -23,6 +23,7 @@ interface ValidateRulesProps { name: string; filenamePath: string; node: ValidateFileProps["node"]; + nodeNotExported?: ValidateFileProps["node"]; nodeType: NodeType; rules: Rule[]; errorMessageId: keyof typeof ESLINT_ERRORS; @@ -44,6 +45,7 @@ export const validateRules = ({ expressionName, allowOnlySpecifiedSelectors, scope, + nodeNotExported, context, context: { report }, }: ValidateRulesProps): void => { @@ -94,7 +96,7 @@ export const validateRules = ({ if (isValid) return validatePositionIndex({ - node, + node: nodeNotExported ?? node, positionIndex, selectorType, context, diff --git a/src/rules/fileComposition/helpers/validateFile/validateFile.test.ts b/src/rules/fileComposition/helpers/validateFile/validateFile.test.ts index 2460195..f282c44 100644 --- a/src/rules/fileComposition/helpers/validateFile/validateFile.test.ts +++ b/src/rules/fileComposition/helpers/validateFile/validateFile.test.ts @@ -91,6 +91,7 @@ describe("validateFile", () => { name: "componentNameExport", nodeType: "VariableDeclarator", node: {}, + nodeNotExported: {}, filenamePath: path.relative( "C:/somePath", "C:/somePath/src/features/Feature1/Feature1.ts", diff --git a/src/rules/fileComposition/helpers/validateFile/validateFile.ts b/src/rules/fileComposition/helpers/validateFile/validateFile.ts index 09d8c10..36ad286 100644 --- a/src/rules/fileComposition/helpers/validateFile/validateFile.ts +++ b/src/rules/fileComposition/helpers/validateFile/validateFile.ts @@ -52,6 +52,7 @@ export const validateFile = ({ name: currentName, nodeType, node: currentNode, + nodeNotExported: node, context, filenamePath, errorMessageId: "prohibitedSelectorExport",