Skip to content

Commit

Permalink
3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Igorkowalski94 committed Oct 11, 2024
1 parent ad3bf72 commit 50e5fb1
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 97 deletions.
12 changes: 7 additions & 5 deletions fileComposition.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ export const fileCompositionConfig = createFileComposition({
{
filePattern: "src/rules/*/*.ts",
allowOnlySpecifiedSelectors: {
file: false,
nestedSelectors: false,
},
rules: [
{
selector: { type: "variableExpression", limitTo: "ESLintUtils" },
scope: "fileExport",
format: "{fileName}",
},
],
Expand All @@ -53,25 +54,25 @@ export const fileCompositionConfig = createFileComposition({
{
selector: ["interface", "type"],
positionIndex: 0,
scope: "fileRoot",
scope: ["fileExport", "fileRoot"],
format: "{FileName}Props",
},
{
selector: ["interface", "type"],
positionIndex: 1,
scope: "fileRoot",
scope: ["fileExport", "fileRoot"],
format: "{FileName}Return",
},
{
selector: "class",
positionIndex: 2,
scope: "fileRoot",
scope: "fileExport",
format: "{FileName}",
},
{
selector: "arrowFunction",
positionIndex: 2,
scope: "fileRoot",
scope: "fileExport",
format: "{fileName}",
},
{
Expand All @@ -81,6 +82,7 @@ export const fileCompositionConfig = createFileComposition({
"variable",
"variableExpression",
],
scope: "nestedSelectors",
format: "{camelCase}",
},
],
Expand Down
16 changes: 8 additions & 8 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.7.0",
"version": "3.7.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 @@ -72,27 +72,27 @@
"micromatch": "^4.0.8"
},
"devDependencies": {
"@eslint/compat": "^1.1.1",
"@eslint/js": "^9.11.1",
"@eslint/compat": "^1.2.0",
"@eslint/js": "^9.12.0",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.13",
"@types/js-yaml": "^4.0.9",
"@types/micromatch": "^4.0.9",
"@types/node": "^22.7.4",
"eslint": "^9.11.1",
"@types/node": "^22.7.5",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-project-structure": "3.2.0",
"eslint-plugin-project-structure": "3.7.0",
"husky": "^9.1.6",
"jest": "^29.7.0",
"prettier": "^3.3.3",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"ts-prune": "^0.10.3",
"tsup": "^8.3.0",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.0"
"typescript": "^5.6.3",
"typescript-eslint": "^8.8.1"
},
"resolutions": {
"micromatch": "^4.0.8",
Expand Down
4 changes: 2 additions & 2 deletions src/rules/fileComposition/fileComposition.consts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const ESLINT_ERRORS = {
invalidName: `🔥 Invalid {{selectorType}} name, allowed formats = {{formatWithoutReferences}} 🔥`,
invalidPosition: `🔥 Invalid {{selectorType}} position. It is located in line {{currentLine}} but should be in line {{correctLine}}. 🔥`,
invalidName: `🔥 Invalid '{{selectorType}}' name, allowed formats = {{formatWithoutReferences}} 🔥`,
invalidPosition: `🔥 Invalid '{{selectorType}}' position. It is located in line {{currentLine}} but should be in line {{correctLine}}. 🔥`,
prohibitedSelectorRoot: `🔥 The use of '{{selectorType}}' is prohibited in the root of the file. 🔥{{error}}`,
prohibitedSelectorNested: `🔥 The use of nested '{{selectorType}}' is prohibited in this file. 🔥{{error}}`,
prohibitedSelectorExport: `🔥 Exporting '{{selectorType}}' is prohibited in this file. 🔥{{error}}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const validateRules = ({
});

if (isValid) {
if (positionIndex === undefined) return;
if (positionIndex === undefined || scope === "nestedSelectors") return;

return handlePositionIndex({
context,
Expand Down
Loading

0 comments on commit 50e5fb1

Please sign in to comment.