@breadstone-infrastructure/eslint-rules 0.0.71 → 0.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ ## 0.0.71 (2025-06-30)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - add missing newline at end of package.json ([73866991d5](https://github.com/RueDeRennes/mosaik/commit/73866991d5))
6
+
7
+ ## 0.0.70 (2025-06-28)
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - update background color to transparent for page header and menu components; update release script to version 0.0.70 ([e8e7c124a4](https://github.com/RueDeRennes/mosaik/commit/e8e7c124a4))
12
+
13
+ ## 0.0.69 (2025-06-26)
14
+
15
+ This was a version bump only for eslint-rules to align it with other projects, there were no code changes.
16
+
17
+ ## 0.0.68 (2025-06-26)
18
+
19
+ ### 🚀 Features
20
+
21
+ - add copyExecutorsJson script and update build commands ([0a0aba85b9](https://github.com/RueDeRennes/mosaik/commit/0a0aba85b9))
22
+
23
+ ## 0.0.67 (2025-06-26)
24
+
25
+ This was a version bump only for eslint-rules to align it with other projects, there were no code changes.
26
+
1
27
  ## 0.0.66 (2025-06-25)
2
28
 
3
29
  This was a version bump only for eslint-rules to align it with other projects, there were no code changes.
package/README.md CHANGED
@@ -1,42 +1,26 @@
1
- # @breadstone-infrastructure/eslint-rules
1
+ # 📦 @breadstone-infrastructure/eslint-rules
2
2
 
3
- **Custom ESLint rules for the Mosaik Nx workspace and Breadstone projects.**
3
+ | Package Status | Source |
4
+ |----------------|--------|
5
+ | [![npm](https://img.shields.io/npm/v/@breadstone-infrastructure/eslint-rules?label=npm)](https://www.npmjs.com/package/@breadstone-infrastructure/eslint-rules) | [infra/eslint-rules](../../infra/eslint-rules) |
4
6
 
5
- This package provides a set of custom ESLint rules to enforce code style, consistency, and best practices across TypeScript/JavaScript projects, especially for localization and large-scale codebases.
7
+ > Custom ESLint rules for the Mosaik Nx workspace and Breadstone projects.
8
+ > Enforces code style, consistency, and best practices for TypeScript/JavaScript and localization.
6
9
 
7
10
  ---
8
11
 
9
- ## Features
12
+ ## 📁 Project Structure
10
13
 
11
- - **Region Enforcement**: Require `#region`/`#endregion` tags in classes and interfaces for better code organization.
12
- - **Command Naming**: Enforce naming conventions for command objects and classes.
13
- - **Translation Resource Checks**: Detect duplicate keys, empty values, missing translations, key consistency, unused keys, and more in localization resource files.
14
- - **Class Layout**: Ensure `extends` and `implements` clauses are on separate lines.
15
- - **Component Documentation**: (WIP) Enforce JSDoc comments for components.
14
+ Part of the monorepo [`mosaik`](https://github.com/RueDeRennes/mosaik)
15
+ Package path: `infra/eslint-rules`
16
+ Version: see [npm](https://www.npmjs.com/package/@breadstone-infrastructure/eslint-rules)
17
+ License: MIT
16
18
 
17
19
  ---
18
20
 
19
- ## Available Rules
21
+ ## 📦 Installation
20
22
 
21
- | Rule Name | Description |
22
- |----------------------------------|----------------------------------------------------------------------------------------------|
23
- | `region-in-classes` | Require `#region`/`#endregion` tags for Fields, Ctor, Properties, Methods in classes |
24
- | `region-in-interfaces` | Require `#region`/`#endregion` tags for Properties and Methods in interfaces |
25
- | `command-naming` | Enforce `[verb][Object]Command` naming for commands |
26
- | `duplicate-keys` | Detect duplicate translation keys in resource files |
27
- | `empty-values` | Detect translation keys with empty values |
28
- | `key-consistency` | Ensure translation keys are consistent across locales |
29
- | `missing-translations` | Detect missing translations in resource files |
30
- | `multiple-key-usage` | Detect inconsistent usage of translation keys |
31
- | `unused-keys` | Detect unused translation keys in resource files |
32
- | `class-extends-implements-newline` | Ensure `extends` and `implements` are on separate lines in class declarations |
33
- | `_component-documentation` | (WIP) Enforce JSDoc comments for components |
34
-
35
- ---
36
-
37
- ## Installation
38
-
39
- ```sh
23
+ ```bash
40
24
  yarn add -D @breadstone-infrastructure/eslint-rules
41
25
  # or
42
26
  npm install --save-dev @breadstone-infrastructure/eslint-rules
@@ -44,7 +28,7 @@ npm install --save-dev @breadstone-infrastructure/eslint-rules
44
28
 
45
29
  ---
46
30
 
47
- ## Usage
31
+ ## 🔧 Usage
48
32
 
49
33
  Add the rules to your ESLint configuration:
50
34
 
@@ -74,6 +58,24 @@ module.exports = {
74
58
 
75
59
  ---
76
60
 
61
+ ## ⚙️ Available Rules
62
+
63
+ | Rule Name | Description |
64
+ |----------------------------------|----------------------------------------------------------------------------------------------|
65
+ | `region-in-classes` | Require `#region`/`#endregion` tags for Fields, Ctor, Properties, Methods in classes |
66
+ | `region-in-interfaces` | Require `#region`/`#endregion` tags for Properties and Methods in interfaces |
67
+ | `command-naming` | Enforce `[verb][Object]Command` naming for commands |
68
+ | `duplicate-keys` | Detect duplicate translation keys in resource files |
69
+ | `empty-values` | Detect translation keys with empty values |
70
+ | `key-consistency` | Ensure translation keys are consistent across locales |
71
+ | `missing-translations` | Detect missing translations in resource files |
72
+ | `multiple-key-usage` | Detect inconsistent usage of translation keys |
73
+ | `unused-keys` | Detect unused translation keys in resource files |
74
+ | `class-extends-implements-newline` | Ensure `extends` and `implements` are on separate lines in class declarations |
75
+ | `_component-documentation` | (WIP) Enforce JSDoc comments for components |
76
+
77
+ ---
78
+
77
79
  ## Rule Documentation
78
80
 
79
81
  - [region-in-classes](./src/Rules/RegionInClassesRule.md)
@@ -83,45 +85,22 @@ module.exports = {
83
85
 
84
86
  ---
85
87
 
86
- ## Example
87
-
88
- ```typescript
89
- // Good: region tags in class
90
- export class MyClass {
91
- // #region Fields
92
- private _foo: string;
93
- // #endregion
88
+ ## 🛠 Recommendations
94
89
 
95
- // #region Ctor
96
- constructor() { this._foo = 'bar'; }
97
- // #endregion
98
-
99
- // #region Methods
100
- doSomething() {}
101
- // #endregion
102
- }
103
- ```
90
+ - Use these rules in conjunction with `@breadstone-infrastructure/eslint-config` for best results.
91
+ - Integrate into your Nx workspace for consistent linting.
104
92
 
105
93
  ---
106
94
 
107
- ## Nx Workspace
95
+ ## 📦 Publishing
108
96
 
109
- This package is part of the Mosaik Nx monorepo. Use Nx commands for building and testing:
110
-
111
- ```sh
112
- npx nx run eslint-rules:build
113
- npx nx run eslint-rules:test
97
+ ```bash
98
+ yarn nx run eslint-rules:publish
114
99
  ```
115
100
 
116
101
  ---
117
102
 
118
- ## Contributing
119
-
120
- Contributions are welcome! Please open issues or pull requests for new rules, bug fixes, or improvements.
121
-
122
- ---
123
-
124
- ## License
103
+ ## 📄 License
125
104
 
126
105
  MIT © Breadstone
127
106
 
@@ -21,7 +21,7 @@ exports.duplicateKeysRule = {
21
21
  defaultOptions: [],
22
22
  create(context) {
23
23
  const fileSystem = new utilities_1.FileSystem();
24
- const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
24
+ const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.fileGetLocale(context.filename));
25
25
  return {
26
26
  Program(node) {
27
27
  const task = new localizator_core_1.DuplicateKeysTask();
@@ -1 +1 @@
1
- {"version":3,"file":"DuplicateKeysRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/DuplicateKeysRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,yEAA6F;AAC7F,oEAAkE;AAElE,yCAAuD;AAEvD,aAAa;AAEA,QAAA,iBAAiB,GAAwC;IAClE,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACF,WAAW,EAAE,uDAAuD;YACpE,GAAG,EAAE,kEAAkE;SAC1E;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACN,YAAY,EAAE,yEAAyE;SAC1F;KACJ;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAiD;QACpD,MAAM,UAAU,GAAG,IAAI,sBAAU,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,IAAA,oCAAyB,EAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,IAAA,uCAAoB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B,EAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,IAAA,uCAAoB,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE5J,OAAO;YACH,OAAO,CAAC,IAAsB;gBAC1B,MAAM,IAAI,GAAG,IAAI,oCAAiB,EAAE,CAAC;gBACrC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;oBACxB,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,EAAE;iBACjB,CAAC,CAAC;gBAEH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACzB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;wBAC5B,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,cAAc;4BACzB,IAAI,EAAE;gCACF,GAAG;gCACH,MAAM,EAAE,IAAI,CAAC,MAAM;6BACtB;yBACJ,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -21,7 +21,7 @@ exports.emptyValuesRule = {
21
21
  defaultOptions: [],
22
22
  create(context) {
23
23
  const fileSystem = new utilities_1.FileSystem();
24
- const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
24
+ const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.fileGetLocale(context.filename));
25
25
  return {
26
26
  Program(node) {
27
27
  const task = new localizator_core_1.EmptyValuesTask();
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyValuesRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/EmptyValuesRule.ts"],"names":[],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AC;CACJ,CAAC"}
@@ -21,7 +21,7 @@ exports.keyConsistencyRule = {
21
21
  defaultOptions: [],
22
22
  create(context) {
23
23
  const fileSystem = new utilities_1.FileSystem();
24
- const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
24
+ const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.fileGetLocale(context.filename));
25
25
  return {
26
26
  Program(node) {
27
27
  const task = new localizator_core_1.KeyConsistencyTask();
@@ -1 +1 @@
1
- {"version":3,"file":"KeyConsistencyRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/KeyConsistencyRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,yEAA8F;AAC9F,yCAAuD;AACvD,oEAAkE;AAGlE,aAAa;AAEA,QAAA,kBAAkB,GAA2C;IACtE,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACF,WAAW,EAAE,8DAA8D;YAC3E,GAAG,EAAE,mEAAmE;SAC3E;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACN,eAAe,EAAE,iEAAiE;SACrF;KACJ;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAoD;QACvD,MAAM,UAAU,GAAG,IAAI,sBAAU,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,IAAA,oCAAyB,EAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,IAAA,uCAAoB,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAExJ,OAAO;YACH,OAAO,CAAC,IAAsB;gBAC1B,MAAM,IAAI,GAAG,IAAI,qCAAkB,EAAE,CAAC;gBACtC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;oBAC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I,CAAC,OAAO,CAAC;oBACxB,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,EAAE;iBACjB,CAAC,CAAC;gBAEH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACzB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;wBAC7B,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,iBAAiB;4BAC5B,IAAI,EAAE;gCACF,GAAG;6BACN;yBACJ,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -21,7 +21,7 @@ exports.missingTranslationsRule = {
21
21
  defaultOptions: [],
22
22
  create(context) {
23
23
  const fileSystem = new utilities_1.FileSystem();
24
- const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
24
+ const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.fileGetLocale(context.filename));
25
25
  return {
26
26
  Program(node) {
27
27
  const task = new localizator_core_1.MissingTranslationsTask();
@@ -1 +1 @@
1
- {"version":3,"file":"MissingTranslationsRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/MissingTranslationsRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,yEAAmG;AACnG,oEAAkE;AAClE,yCAAuD;AAGvD,aAAa;AAEA,QAAA,uBAAuB,GAA8C;IAC9E,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACF,WAAW,EAAE,iDAAiD;YAC9D,GAAG,EAAE,wEAAwE;SAChF;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACN,kBAAkB,EAAE,sEAAsE;SAC7F;KACJ;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAuD;QAC1D,MAAM,UAAU,GAAG,IAAI,sBAAU,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,IAAA,oCAAyB,EAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,IAAA,uCAAoB,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAExJ,OAAO;YACH,OAAO,CAAC,IAAsB;gBAC1B,MAAM,IAAI,GAAG,IAAI,0CAAuB,EAAE,CAAC;gBAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;oBACxB,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,EAAE;iBACjB,CAAC,CAAC;gBAEH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACzB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;wBAC7B,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,oBAAoB;4BAC/B,IAAI,EAAE;gCACF,GAAG;gCACH,MAAM,EAAE,IAAI,CAAC,MAAM;6BACtB;yBACJ,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
1
+ {"version":3,"file":"MissingTranslationsRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/MissingTranslationsRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,yEAAmG;AACnG,oEAAkE;AAClE,yCAAuD;AAGvD,aAAa;AAEA,QAAA,uBAAuB,GAA8C;IAC9E,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACF,WAAW,EAAE,iDAAiD;YAC9D,GAAG,EAAE,wEAAwE;SAChF;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACN,kBAAkB,EAAE,sEAAsE;SAC7F;KACJ;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAuD;QAC1D,MAAM,UAAU,GAAG,IAAI,sBAAU,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,IAAA,oCAAyB,EAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,IAAA,uCAAoB,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE5J,OAAO;YACH,OAAO,CAAC,IAAsB;gBAC1B,MAAM,IAAI,GAAG,IAAI,0CAAuB,EAAE,CAAC;gBAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;oBACxB,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,EAAE;iBACjB,CAAC,CAAC;gBAEH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACzB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;wBAC7B,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,oBAAoB;4BAC/B,IAAI,EAAE;gCACF,GAAG;gCACH,MAAM,EAAE,IAAI,CAAC,MAAM;6BACtB;yBACJ,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -21,7 +21,7 @@ exports.multipleKeyUsageRule = {
21
21
  defaultOptions: [],
22
22
  create(context) {
23
23
  const fileSystem = new utilities_1.FileSystem();
24
- const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
24
+ const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.fileGetLocale(context.filename));
25
25
  return {
26
26
  Program(node) {
27
27
  const task = new localizator_core_1.MultipleKeyUsageTask();
@@ -1 +1 @@
1
- {"version":3,"file":"MultipleKeyUsageRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/MultipleKeyUsageRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,yEAAgG;AAChG,oEAAkE;AAClE,yCAAuD;AAGvD,aAAa;AAEA,QAAA,oBAAoB,GAA4C;IACzE,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACF,WAAW,EAAE,uDAAuD;YAEpE,GAAG,EAAE,sEAAsE;SAC9E;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACN,gBAAgB,EAAE,yEAAyE;SAC9F;KACJ;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAqD;QACxD,MAAM,UAAU,GAAG,IAAI,sBAAU,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,IAAA,oCAAyB,EAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,IAAA,uCAAoB,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAExJ,OAAO;YACH,OAAO,CAAC,IAAsB;gBAC1B,MAAM,IAAI,GAAG,IAAI,uCAAoB,EAAE,CAAC;gBACxC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;oBACxB,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,EAAE;iBACjB,CAAC,CAAC;gBAEH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACzB,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;wBACnC,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,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;4BACX,IAAI;4BACJ,SAAS,EAAE,kBAAkB;4BAC7B,IAAI,EAAE;gCACF,GAAG;6BACN;yBACJ,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -41,7 +41,7 @@ exports.unusedKeysRule = {
41
41
  const options = context.options[0];
42
42
  const usedKeys = options.usedKeys ?? [];
43
43
  const fileSystem = new utilities_1.FileSystem();
44
- const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
44
+ const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.fileGetLocale(context.filename));
45
45
  return {
46
46
  Program(node) {
47
47
  const task = new localizator_core_1.UnusedKeysTask();
@@ -1 +1 @@
1
- {"version":3,"file":"UnusedKeysRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/UnusedKeysRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,yEAA0F;AAC1F,yCAAuD;AACvD,oEAAkE;AAElE,aAAa;AAEA,QAAA,cAAc,GAAqC;IAC5D,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACF,WAAW,EAAE,oDAAoD;YACjE,GAAG,EAAE,+DAA+D;SACvE;QACD,MAAM,EAAE;YACJ;gBACI,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,QAAQ,EAAE;wBACN,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACH,IAAI,EAAE,QAAQ;yBACjB;wBACD,WAAW,EAAE,kDAAkD;qBAClE;oBACD,IAAI,EAAE;wBACF,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iCAAiC;qBACjD;iBACJ;gBACD,oBAAoB,EAAE,KAAK;aAC9B;SACJ;QACD,QAAQ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,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACzB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;wBAC5B,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI,EAAE,IAAI;4BACV,SAAS,EAAE,WAAW;4BACtB,IAAI,EAAE;gCACF,GAAG;gCACH,MAAM,EAAE,IAAI,CAAC,MAAM;6BACtB;yBACJ,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@breadstone-infrastructure/eslint-rules",
3
3
  "description": "Custom eslint rules for mosaik projects",
4
- "version": "0.0.71",
4
+ "version": "0.0.73",
5
5
  "license": "MIT",
6
6
  "author": "andre.wehlert <awehlert@breadstone.de> (https://www.breadstone.de)",
7
7
  "repository": {
@@ -13,8 +13,8 @@
13
13
  "module": "./Index.js",
14
14
  "types": "./Index.d.ts",
15
15
  "dependencies": {
16
- "@breadstone-infrastructure/utilities": "^0.0.71",
17
- "@breadstone-tools/localizator-core": "^0.0.71"
16
+ "@breadstone-infrastructure/utilities": "^0.0.73",
17
+ "@breadstone-tools/localizator-core": "^0.0.73"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "eslint": "^9.26.0",