Skip to content

Commit 4566b61

Browse files
committed
feat(tools): enforce stricter rules and add new stylelint plugin
- Added a restriction to prevent circular imports from `features` into `core` modules in ESLint configuration. - Disabled restricted imports for `features/authentication`. - Integrated `stylelint-declaration-block-no-ignored-properties` plugin for better CSS validation. - Updated `package.json` and `package-lock.json` to include the new plugin.
1 parent 659f788 commit 4566b61

4 files changed

Lines changed: 42 additions & 2 deletions

File tree

.stylelintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"extends": ["stylelint-config-standard-scss", "stylelint-config-recess-order"],
3+
"plugins": ["stylelint-declaration-block-no-ignored-properties"],
34
"customSyntax": "postcss-scss",
45
"rules": {
56
"import-notation": null,
@@ -9,6 +10,7 @@
910
"selector-max-id": 0,
1011
"max-nesting-depth": 5,
1112
"color-hex-length": "short",
12-
"selector-class-pattern": "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*(__[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?(--[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$"
13+
"selector-class-pattern": "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*(__[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?(--[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$",
14+
"plugin/declaration-block-no-ignored-properties": true
1315
}
1416
}

eslint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,29 @@ export default tsEslint.config(
151151
'sonarjs/pseudo-random': 'off',
152152
},
153153
},
154+
{
155+
files: ['src/app/core/**/*.ts'],
156+
rules: {
157+
'no-restricted-imports': [
158+
'error',
159+
{
160+
patterns: [
161+
{
162+
group: ['~features/*'],
163+
message:
164+
'Circular/incorrect dependency: Modules in "core" should not import from "features". Move shared logic to "core" or "shared".',
165+
},
166+
],
167+
},
168+
],
169+
},
170+
},
171+
{
172+
files: ['~features/authentication/**/*.*'],
173+
rules: {
174+
'no-restricted-imports': 'off',
175+
},
176+
},
154177
{
155178
files: ['**/*.spec.ts'],
156179
rules: {

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"eslint-config-prettier": "10.1.8",
6565
"eslint-plugin-eslint-comments": "3.2.0",
6666
"eslint-plugin-promise": "7.2.1",
67-
"eslint-plugin-sonarjs": "^4.0.2",
67+
"eslint-plugin-sonarjs": "4.0.2",
6868
"eslint-plugin-unicorn": "64.0.0",
6969
"http-serve": "1.0.1",
7070
"husky": "9.1.7",
@@ -79,6 +79,7 @@
7979
"stylelint": "17.6.0",
8080
"stylelint-config-recess-order": "7.7.0",
8181
"stylelint-config-standard-scss": "17.0.0",
82+
"stylelint-declaration-block-no-ignored-properties": "3.0.0",
8283
"stylelint-order": "8.1.1",
8384
"typescript": "5.9.3",
8485
"typescript-eslint": "8.58.1",

0 commit comments

Comments
 (0)