Skip to content

Commit

Permalink
3.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Igorkowalski94 committed Jan 14, 2025
1 parent f3a3a56 commit db755bd
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 129 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Igor Kowalski (Igorkowalski94)",
"name": "eslint-plugin-project-structure",
"version": "3.13.0",
"version": "3.13.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": [
Expand Down Expand Up @@ -56,34 +56,34 @@
"husky:prepare": "husky install"
},
"dependencies": {
"@typescript-eslint/utils": "^8.17.0",
"@typescript-eslint/utils": "^8.20.0",
"comment-json": "^4.2.5",
"js-yaml": "^4.1.0",
"jsonschema": "^1.4.1",
"jsonschema": "^1.5.0",
"micromatch": "^4.0.8"
},
"devDependencies": {
"@eslint/compat": "^1.2.4",
"@eslint/js": "^9.16.0",
"@eslint/compat": "^1.2.5",
"@eslint/js": "^9.18.0",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.14",
"@types/js-yaml": "^4.0.9",
"@types/micromatch": "^4.0.9",
"@types/node": "^22.10.1",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"@types/node": "^22.10.6",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-project-structure": "3.12.0",
"eslint-plugin-project-structure": "3.13.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"prettier": "^3.4.2",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"ts-prune": "^0.10.3",
"tsup": "^8.3.5",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0"
"typescript": "^5.7.3",
"typescript-eslint": "^8.20.0"
},
"resolutions": {
"micromatch": "^4.0.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,22 @@ export const checkImportPath = ({
if (!importPathExists && !pathAlias) {
const isExternal = isExternalImport(importPath, projectRoot);

if (isExternal) {
const isValidExternalImportPattern = allowImportsFromExtracted.some((p) =>
micromatch.every(importPath, p),
);

if (isValidExternalImportPattern || allowExternalImports !== false)
return;

throw getExternalImportError({
moduleName,
errorMessage,
debugMode,
filename,
importPath,
allowImportsFromExtracted,
});
}

throw getImportPathNotExistsError();
if (!isExternal) throw getImportPathNotExistsError();

const isValidExternalImportPattern = allowImportsFromExtracted.some((p) =>
micromatch.every(importPath, p),
);

if (isValidExternalImportPattern || allowExternalImports !== false) return;

throw getExternalImportError({
moduleName,
errorMessage,
debugMode,
filename,
importPath,
allowImportsFromExtracted,
});
}

const isValidImportPath = validateImportPath({
Expand Down
Loading

0 comments on commit db755bd

Please sign in to comment.