diff --git a/documentation/project-structure-export-rules.md b/documentation/project-structure-export-rules.md index 19db0e9..c287101 100644 --- a/documentation/project-structure-export-rules.md +++ b/documentation/project-structure-export-rules.md @@ -154,7 +154,7 @@ export const Importantvariable4 = ""; ### **`"filePattern"`**: `` -Here you define which files should meet the rules. You can use all **[micromatch.isMatch](https://github.com/micromatch/micromatch?tab=readme-ov-file#ismatch)** functionalities. +Here you define which files should meet the rules. You can use all **[micromatch.every](https://github.com/micromatch/micromatch?tab=readme-ov-file#every)** functionalities. ```jsonc { diff --git a/documentation/project-structure-independent-modules.md b/documentation/project-structure-independent-modules.md index 1b775bb..e1ee5cb 100644 --- a/documentation/project-structure-independent-modules.md +++ b/documentation/project-structure-independent-modules.md @@ -344,7 +344,7 @@ The name of your module. Your module's pattern.
-You can use all **[micromatch.isMatch](https://github.com/micromatch/micromatch?tab=readme-ov-file#ismatch)** functionalities. +You can use all **[micromatch.every](https://github.com/micromatch/micromatch?tab=readme-ov-file#every)** functionalities. ```jsonc { @@ -364,7 +364,7 @@ You can use all **[micromatch.isMatch](https://github.com/micromatch/micromatch? The place where you specify what can be imported into your module.
-You can use all **[micromatch.isMatch](https://github.com/micromatch/micromatch?tab=readme-ov-file#ismatch)** functionalities.
+You can use all **[micromatch.every](https://github.com/micromatch/micromatch?tab=readme-ov-file#every)** functionalities.
If at least **one** pattern in **`allowImportsFrom`** meets the condition, the import is considered allowed.
diff --git a/package.json b/package.json index 2b0f932..78a7fc0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Igor Kowalski (Igorkowalski94)", "name": "eslint-plugin-project-structure", - "version": "2.0.2", + "version": "2.0.3", "license": "MIT", "description": "Eslint plugin with rules that will help you achieve a project structure that is scalable, consistent, and well thought out.", "keywords": [ @@ -70,7 +70,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-independent-modules": "^0.0.26", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-project-structure": "2.0.0", + "eslint-plugin-project-structure": "2.0.2", "husky": "^9.0.11", "jest": "^29.7.0", "prettier": "^3.3.2", diff --git a/src/rules/exportRules/helpers/validateExport.ts b/src/rules/exportRules/helpers/validateExport.ts index 934d23e..d6a3236 100644 --- a/src/rules/exportRules/helpers/validateExport.ts +++ b/src/rules/exportRules/helpers/validateExport.ts @@ -27,7 +27,7 @@ export const validateExport = ({ const filenamePath = getFilenamePathWithoutRoot({ filename, settings }); const rule = options.find(({ filePattern }) => - micromatch.isMatch(filenamePath, filePattern), + micromatch.every(filenamePath, filePattern), ); if (!rule) return; diff --git a/src/rules/independentModules/helpers/checkImportPath.ts b/src/rules/independentModules/helpers/checkImportPath.ts index 9320db3..d730c25 100644 --- a/src/rules/independentModules/helpers/checkImportPath.ts +++ b/src/rules/independentModules/helpers/checkImportPath.ts @@ -45,7 +45,7 @@ export const checkImportPath = ({ if (isExternal) { const isValidExternalImportPattern = allowImportsFromExtracted.some( - (p) => micromatch.isMatch(importPath, p), + (p) => micromatch.every(importPath, p), ); if (isValidExternalImportPattern || allowExternalImports !== false) diff --git a/src/rules/independentModules/helpers/findModuleConfig.ts b/src/rules/independentModules/helpers/findModuleConfig.ts index b467e22..f94e44b 100644 --- a/src/rules/independentModules/helpers/findModuleConfig.ts +++ b/src/rules/independentModules/helpers/findModuleConfig.ts @@ -6,4 +6,4 @@ export const findModuleConfig = ( fileName: string, modules: IndependentModulesConfig["modules"], ): Module | undefined => - modules.find(({ pattern }) => micromatch.isMatch(fileName, pattern)); + modules.find(({ pattern }) => micromatch.every(fileName, pattern)); diff --git a/src/rules/independentModules/helpers/validateImportPath.ts b/src/rules/independentModules/helpers/validateImportPath.ts index 61bdd16..f5acdc8 100644 --- a/src/rules/independentModules/helpers/validateImportPath.ts +++ b/src/rules/independentModules/helpers/validateImportPath.ts @@ -21,5 +21,5 @@ export const validateImportPath = ({ filename, }); - return micromatch.isMatch(importPath, newPattern); + return micromatch.every(importPath, newPattern); }); diff --git a/yarn.lock b/yarn.lock index 4c2218b..cc7b129 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2599,14 +2599,14 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-project-structure@npm:2.0.0": - version: 2.0.0 - resolution: "eslint-plugin-project-structure@npm:2.0.0" +"eslint-plugin-project-structure@npm:2.0.2": + version: 2.0.2 + resolution: "eslint-plugin-project-structure@npm:2.0.2" dependencies: "@typescript-eslint/utils": ^7.13.0 js-yaml: ^4.1.0 micromatch: ^4.0.7 - checksum: 79d9cd63e215fc8b64bbd81a8d2a3ebe347577f630a8892e5b0977a055d242ffca303a36ad7da39d6d0da6042ffc37fe328840d20ec13adec8f61783b18bcdf8 + checksum: 9d9ad8214decfb6381bde6b9272800a9ccc2940ed451c8d20cf83389201918f6946b7ebbd176d7c255e1ed474513f9f7c7726ee79ffcf8a1f59f7e411ac0927a languageName: node linkType: hard @@ -2629,7 +2629,7 @@ __metadata: eslint-plugin-import: ^2.29.1 eslint-plugin-independent-modules: ^0.0.26 eslint-plugin-prettier: ^5.1.3 - eslint-plugin-project-structure: 2.0.0 + eslint-plugin-project-structure: 2.0.2 husky: ^9.0.11 jest: ^29.7.0 js-yaml: ^4.1.0