@breadstone-infrastructure/eslint-rules 0.0.31 → 0.0.32
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/Rules/ClassExtendsImplementsNewline.js +2 -2
- package/Rules/ClassExtendsImplementsNewline.js.map +1 -1
- package/Rules/Resources/DuplicateKeysRule.d.ts +2 -2
- package/Rules/Resources/DuplicateKeysRule.d.ts.map +1 -1
- package/Rules/Resources/DuplicateKeysRule.js +1 -2
- package/Rules/Resources/DuplicateKeysRule.js.map +1 -1
- package/Rules/Resources/EmptyValuesRule.d.ts +2 -2
- package/Rules/Resources/EmptyValuesRule.d.ts.map +1 -1
- package/Rules/Resources/EmptyValuesRule.js +1 -2
- package/Rules/Resources/EmptyValuesRule.js.map +1 -1
- package/Rules/Resources/KeyConsistencyRule.d.ts +2 -2
- package/Rules/Resources/KeyConsistencyRule.d.ts.map +1 -1
- package/Rules/Resources/KeyConsistencyRule.js +1 -2
- package/Rules/Resources/KeyConsistencyRule.js.map +1 -1
- package/Rules/Resources/MissingTranslationsRule.d.ts +2 -2
- package/Rules/Resources/MissingTranslationsRule.d.ts.map +1 -1
- package/Rules/Resources/MissingTranslationsRule.js +1 -2
- package/Rules/Resources/MissingTranslationsRule.js.map +1 -1
- package/Rules/Resources/MultipleKeyUsageRule.d.ts +2 -2
- package/Rules/Resources/MultipleKeyUsageRule.d.ts.map +1 -1
- package/Rules/Resources/MultipleKeyUsageRule.js +1 -2
- package/Rules/Resources/MultipleKeyUsageRule.js.map +1 -1
- package/Rules/Resources/UnusedKeysRule.d.ts +2 -2
- package/Rules/Resources/UnusedKeysRule.d.ts.map +1 -1
- package/Rules/Resources/UnusedKeysRule.js +2 -3
- package/Rules/Resources/UnusedKeysRule.js.map +1 -1
- package/package.json +3 -3
|
@@ -21,7 +21,7 @@ exports.classExtendsImplementsNewlineRule = {
|
|
|
21
21
|
create(context) {
|
|
22
22
|
return {
|
|
23
23
|
ClassDeclaration(node) {
|
|
24
|
-
const sourceCode = context.
|
|
24
|
+
const sourceCode = context.sourceCode;
|
|
25
25
|
const classLine = node.loc.start.line;
|
|
26
26
|
if (node.superClass) {
|
|
27
27
|
const superClassToken = sourceCode.getTokenBefore(node.superClass);
|
|
@@ -49,6 +49,6 @@ exports.classExtendsImplementsNewlineRule = {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
};
|
|
54
54
|
//# sourceMappingURL=ClassExtendsImplementsNewline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassExtendsImplementsNewline.js","sourceRoot":"","sources":["../../src/Rules/ClassExtendsImplementsNewline.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAIlB,aAAa;AAEA,QAAA,iCAAiC,GAAgE;IAC1G,IAAI,EAAE;QACF,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACF,WAAW,EAAE,0FAA0F;YACvG,GAAG,EAAE,+EAA+E;SACvF;QACD,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACN,cAAc,EAAE,oDAAoD;YACpE,iBAAiB,EAAE,uDAAuD;SAC7E;KACJ;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"ClassExtendsImplementsNewline.js","sourceRoot":"","sources":["../../src/Rules/ClassExtendsImplementsNewline.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAIlB,aAAa;AAEA,QAAA,iCAAiC,GAAgE;IAC1G,IAAI,EAAE;QACF,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACF,WAAW,EAAE,0FAA0F;YACvG,GAAG,EAAE,+EAA+E;SACvF;QACD,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACN,cAAc,EAAE,oDAAoD;YACpE,iBAAiB,EAAE,uDAAuD;SAC7E;KACJ;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|
-
import type {
|
|
2
|
-
export declare const duplicateKeysRule:
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const duplicateKeysRule: TSESLint.RuleModule<'duplicateKey'>;
|
|
3
3
|
//# sourceMappingURL=DuplicateKeysRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DuplicateKeysRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/DuplicateKeysRule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DuplicateKeysRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/DuplicateKeysRule.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAKnE,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAwCjE,CAAC"}
|
|
@@ -11,8 +11,6 @@ exports.duplicateKeysRule = {
|
|
|
11
11
|
type: 'problem',
|
|
12
12
|
docs: {
|
|
13
13
|
description: 'Detects duplicate translation keys in resource files.',
|
|
14
|
-
category: 'Best Practices',
|
|
15
|
-
recommended: true,
|
|
16
14
|
url: 'https://github.com/your-repo/eslint-rules/duplicate-keys-rule.md'
|
|
17
15
|
},
|
|
18
16
|
schema: [],
|
|
@@ -20,6 +18,7 @@ exports.duplicateKeysRule = {
|
|
|
20
18
|
duplicateKey: 'The translation key "{{ key }}" is duplicated in locale "{{ locale }}".'
|
|
21
19
|
}
|
|
22
20
|
},
|
|
21
|
+
defaultOptions: [],
|
|
23
22
|
create(context) {
|
|
24
23
|
const fileSystem = new utilities_1.FileSystem();
|
|
25
24
|
const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DuplicateKeysRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/DuplicateKeysRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;
|
|
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,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,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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const emptyValuesRule:
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const emptyValuesRule: TSESLint.RuleModule<'emptyValue'>;
|
|
3
3
|
//# sourceMappingURL=EmptyValuesRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyValuesRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/EmptyValuesRule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmptyValuesRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/EmptyValuesRule.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAInE,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAwC7D,CAAC"}
|
|
@@ -11,8 +11,6 @@ exports.emptyValuesRule = {
|
|
|
11
11
|
type: 'problem',
|
|
12
12
|
docs: {
|
|
13
13
|
description: 'Detects translation keys with empty values in resource files.',
|
|
14
|
-
category: 'Best Practices',
|
|
15
|
-
recommended: true,
|
|
16
14
|
url: 'https://github.com/your-repo/eslint-rules/empty-values-rule.md'
|
|
17
15
|
},
|
|
18
16
|
schema: [],
|
|
@@ -20,6 +18,7 @@ exports.emptyValuesRule = {
|
|
|
20
18
|
emptyValue: 'The translation key "{{ key }}" has an empty value in locale "{{ locale }}".'
|
|
21
19
|
}
|
|
22
20
|
},
|
|
21
|
+
defaultOptions: [],
|
|
23
22
|
create(context) {
|
|
24
23
|
const fileSystem = new utilities_1.FileSystem();
|
|
25
24
|
const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyValuesRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/EmptyValuesRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;
|
|
1
|
+
{"version":3,"file":"EmptyValuesRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/EmptyValuesRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,yEAA2F;AAC3F,oEAAkE;AAClE,yCAAuD;AAGvD,aAAa;AAEA,QAAA,eAAe,GAAsC;IAC9D,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACF,WAAW,EAAE,+DAA+D;YAC5E,GAAG,EAAE,gEAAgE;SACxE;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACN,UAAU,EAAE,8EAA8E;SAC7F;KACJ;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAA+C;QAClD,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,kCAAe,EAAE,CAAC;gBACnC,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,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;wBACtB,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,YAAY;4BACvB,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,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const keyConsistencyRule:
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const keyConsistencyRule: TSESLint.RuleModule<'inconsistentKey'>;
|
|
3
3
|
//# sourceMappingURL=KeyConsistencyRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyConsistencyRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/KeyConsistencyRule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyConsistencyRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/KeyConsistencyRule.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAInE,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAuCrE,CAAC"}
|
|
@@ -11,8 +11,6 @@ exports.keyConsistencyRule = {
|
|
|
11
11
|
type: 'problem',
|
|
12
12
|
docs: {
|
|
13
13
|
description: 'Ensures that translation keys are consistent across locales.',
|
|
14
|
-
category: 'Best Practices',
|
|
15
|
-
recommended: true,
|
|
16
14
|
url: 'https://github.com/your-repo/eslint-rules/key-consistency-rule.md'
|
|
17
15
|
},
|
|
18
16
|
schema: [],
|
|
@@ -20,6 +18,7 @@ exports.keyConsistencyRule = {
|
|
|
20
18
|
inconsistentKey: 'The translation key "{{ key }}" is inconsistent across locales.'
|
|
21
19
|
}
|
|
22
20
|
},
|
|
21
|
+
defaultOptions: [],
|
|
23
22
|
create(context) {
|
|
24
23
|
const fileSystem = new utilities_1.FileSystem();
|
|
25
24
|
const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyConsistencyRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/KeyConsistencyRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;
|
|
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;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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const missingTranslationsRule:
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const missingTranslationsRule: TSESLint.RuleModule<'missingTranslation'>;
|
|
3
3
|
//# sourceMappingURL=MissingTranslationsRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingTranslationsRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/MissingTranslationsRule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MissingTranslationsRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/MissingTranslationsRule.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAInE,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAwC7E,CAAC"}
|
|
@@ -11,8 +11,6 @@ exports.missingTranslationsRule = {
|
|
|
11
11
|
type: 'problem',
|
|
12
12
|
docs: {
|
|
13
13
|
description: 'Detects missing translations in resource files.',
|
|
14
|
-
category: 'Best Practices',
|
|
15
|
-
recommended: true,
|
|
16
14
|
url: 'https://github.com/your-repo/eslint-rules/missing-translations-rule.md'
|
|
17
15
|
},
|
|
18
16
|
schema: [],
|
|
@@ -20,6 +18,7 @@ exports.missingTranslationsRule = {
|
|
|
20
18
|
missingTranslation: 'The translation key "{{ key }}" is missing in locale "{{ locale }}".'
|
|
21
19
|
}
|
|
22
20
|
},
|
|
21
|
+
defaultOptions: [],
|
|
23
22
|
create(context) {
|
|
24
23
|
const fileSystem = new utilities_1.FileSystem();
|
|
25
24
|
const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingTranslationsRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/MissingTranslationsRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;
|
|
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,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const multipleKeyUsageRule:
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const multipleKeyUsageRule: TSESLint.RuleModule<'multipleKeyUsage'>;
|
|
3
3
|
//# sourceMappingURL=MultipleKeyUsageRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultipleKeyUsageRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/MultipleKeyUsageRule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultipleKeyUsageRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/MultipleKeyUsageRule.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAInE,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAwCxE,CAAC"}
|
|
@@ -11,8 +11,6 @@ exports.multipleKeyUsageRule = {
|
|
|
11
11
|
type: 'problem',
|
|
12
12
|
docs: {
|
|
13
13
|
description: 'Detects incorrect multiple usage of translation keys.',
|
|
14
|
-
category: 'Best Practices',
|
|
15
|
-
recommended: true,
|
|
16
14
|
url: 'https://github.com/your-repo/eslint-rules/multiple-key-usage-rule.md'
|
|
17
15
|
},
|
|
18
16
|
schema: [],
|
|
@@ -20,6 +18,7 @@ exports.multipleKeyUsageRule = {
|
|
|
20
18
|
multipleKeyUsage: 'The translation key "{{ key }}" is used inconsistently across contexts.'
|
|
21
19
|
}
|
|
22
20
|
},
|
|
21
|
+
defaultOptions: [],
|
|
23
22
|
create(context) {
|
|
24
23
|
const fileSystem = new utilities_1.FileSystem();
|
|
25
24
|
const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultipleKeyUsageRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/MultipleKeyUsageRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;
|
|
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,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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const unusedKeysRule:
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const unusedKeysRule: TSESLint.RuleModule<'unusedKey'>;
|
|
3
3
|
//# sourceMappingURL=UnusedKeysRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnusedKeysRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/UnusedKeysRule.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"UnusedKeysRule.d.ts","sourceRoot":"","sources":["../../../src/Rules/Resources/UnusedKeysRule.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAOnE,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAmE3D,CAAC"}
|
|
@@ -11,8 +11,6 @@ exports.unusedKeysRule = {
|
|
|
11
11
|
type: 'problem',
|
|
12
12
|
docs: {
|
|
13
13
|
description: 'Detects unused translation keys in resource files.',
|
|
14
|
-
category: 'Best Practices',
|
|
15
|
-
recommended: false,
|
|
16
14
|
url: 'https://github.com/your-repo/eslint-rules/unused-keys-rule.md'
|
|
17
15
|
},
|
|
18
16
|
schema: [
|
|
@@ -38,8 +36,9 @@ exports.unusedKeysRule = {
|
|
|
38
36
|
unusedKey: 'The translation key "{{ key }}" in locale "{{ locale }}" is unused.'
|
|
39
37
|
}
|
|
40
38
|
},
|
|
39
|
+
defaultOptions: [],
|
|
41
40
|
create(context) {
|
|
42
|
-
const options = context.options[0]
|
|
41
|
+
const options = context.options[0];
|
|
43
42
|
const usedKeys = options.usedKeys ?? [];
|
|
44
43
|
const fileSystem = new utilities_1.FileSystem();
|
|
45
44
|
const resourceInfo = (0, Utils_js_1.createResourceFromContent)(context.sourceCode.text, (0, localizator_core_1.resourceTypeFormFile)(context.filename), fileSystem.getLocale(context.filename));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnusedKeysRule.js","sourceRoot":"","sources":["../../../src/Rules/Resources/UnusedKeysRule.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;
|
|
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,EAA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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.
|
|
4
|
+
"version": "0.0.32",
|
|
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.
|
|
17
|
-
"@breadstone-tools/localizator-core": "^0.0.
|
|
16
|
+
"@breadstone-infrastructure/utilities": "^0.0.32",
|
|
17
|
+
"@breadstone-tools/localizator-core": "^0.0.32"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"eslint": "^9.26.0",
|