@webpieces/eslint-rules 0.4.843 → 0.4.845
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/package.json +5 -3
- package/src/lint-rule-config.d.ts +6 -0
- package/src/lint-rule-config.js +13 -0
- package/src/lint-rule-config.js.map +1 -0
- package/src/rule-pack.d.ts +2 -0
- package/src/rule-pack.js +22 -0
- package/src/rule-pack.js.map +1 -0
- package/src/rule-settings.d.ts +5 -0
- package/src/rule-settings.js +34 -0
- package/src/rule-settings.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/eslint-rules",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.845",
|
|
4
4
|
"description": "ESLint rules for WebPieces code patterns and architecture enforcement",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./src/index.js",
|
|
9
9
|
"./recommended": "./recommended.mjs",
|
|
10
|
-
"./package.json": "./package.json"
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
"./rule-pack": "./src/rule-pack.js"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"src/**/*",
|
|
@@ -22,7 +23,8 @@
|
|
|
22
23
|
"directory": "packages/tooling/eslint-rules"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@webpieces/rules-config": "0.4.
|
|
26
|
+
"@webpieces/rules-config": "0.4.845",
|
|
27
|
+
"@webpieces/rules-sdk": "0.4.845"
|
|
26
28
|
},
|
|
27
29
|
"peerDependencies": {
|
|
28
30
|
"eslint": ">=8.0.0"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseRuleConfig, SchemaShape, OnOffMode } from '@webpieces/rules-sdk';
|
|
2
|
+
/** Explicit lint-policy settings; plugin implementation options remain in their owning rule. */
|
|
3
|
+
export declare class LintRuleConfig extends BaseRuleConfig {
|
|
4
|
+
mode?: OnOffMode;
|
|
5
|
+
static readonly SCHEMA: SchemaShape<LintRuleConfig>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LintRuleConfig = void 0;
|
|
4
|
+
const rules_sdk_1 = require("@webpieces/rules-sdk");
|
|
5
|
+
/** Explicit lint-policy settings; plugin implementation options remain in their owning rule. */
|
|
6
|
+
class LintRuleConfig extends rules_sdk_1.BaseRuleConfig {
|
|
7
|
+
static SCHEMA = {
|
|
8
|
+
mode: new rules_sdk_1.FieldDef('string', rules_sdk_1.ON_OFF_MODES),
|
|
9
|
+
...rules_sdk_1.BASE_RULE_SCHEMA,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
exports.LintRuleConfig = LintRuleConfig;
|
|
13
|
+
//# sourceMappingURL=lint-rule-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-rule-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/eslint-rules/src/lint-rule-config.ts"],"names":[],"mappings":";;;AAAA,oDAAwH;AAExH,gGAAgG;AAChG,MAAa,cAAe,SAAQ,0BAAc;IAG9C,MAAM,CAAU,MAAM,GAAgC;QAClD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,wBAAY,CAAC;QAC1C,GAAG,4BAAgB;KACtB,CAAC;;AANN,wCAOC","sourcesContent":["import { BaseRuleConfig, BASE_RULE_SCHEMA, FieldDef, SchemaShape, ON_OFF_MODES, OnOffMode } from '@webpieces/rules-sdk';\n\n/** Explicit lint-policy settings; plugin implementation options remain in their owning rule. */\nexport class LintRuleConfig extends BaseRuleConfig {\n declare mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<LintRuleConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n ...BASE_RULE_SCHEMA,\n };\n}\n"]}
|
package/src/rule-pack.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rulePackManifest = void 0;
|
|
4
|
+
const rule_settings_1 = require("./rule-settings");
|
|
5
|
+
const rules_sdk_1 = require("@webpieces/rules-sdk");
|
|
6
|
+
const package_json_1 = require("../package.json");
|
|
7
|
+
const lint_rule_config_1 = require("./lint-rule-config");
|
|
8
|
+
/** Lint-only policies own their explicit schema and contribute to the code-owned policies. */
|
|
9
|
+
const ownedRuleIds = [
|
|
10
|
+
"enforce-architecture",
|
|
11
|
+
"no-json-property-primitive-type",
|
|
12
|
+
"require-typed-template",
|
|
13
|
+
"no-mat-cell-def"
|
|
14
|
+
];
|
|
15
|
+
exports.rulePackManifest = new rules_sdk_1.RulePackManifest('@webpieces/eslint-rules', package_json_1.version, rules_sdk_1.RULE_PACK_API_VERSION, ownedRuleIds.map(id => new rules_sdk_1.OwnedRuleDefinition(id, lint_rule_config_1.LintRuleConfig.SCHEMA, rules_sdk_1.RULE_SCHEMA_API_VERSION, rule_settings_1.optionalTuning[id], rule_settings_1.recommendedSeeds[id], 'lint')), [
|
|
16
|
+
...ownedRuleIds.map(id => new rules_sdk_1.RuleContribution(id, '@webpieces/eslint-rules', 'lint')),
|
|
17
|
+
new rules_sdk_1.RuleContribution('catch-error-pattern', '@webpieces/code-rules', 'lint'),
|
|
18
|
+
new rules_sdk_1.RuleContribution('no-unmanaged-exceptions', '@webpieces/code-rules', 'lint'),
|
|
19
|
+
new rules_sdk_1.RuleContribution('max-method-lines', '@webpieces/code-rules', 'lint'),
|
|
20
|
+
new rules_sdk_1.RuleContribution('max-file-lines', '@webpieces/code-rules', 'lint'),
|
|
21
|
+
], [], []);
|
|
22
|
+
//# sourceMappingURL=rule-pack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-pack.js","sourceRoot":"","sources":["../../../../../packages/tooling/eslint-rules/src/rule-pack.ts"],"names":[],"mappings":";;;AAAA,mDAAmE;AACnE,oDAA+I;AAC/I,kDAA0C;AAC1C,yDAAoD;AAEpD,8FAA8F;AAC9F,MAAM,YAAY,GAAG;IACjB,sBAAsB;IACtB,iCAAiC;IACjC,wBAAwB;IACxB,iBAAiB;CACX,CAAC;AAEE,QAAA,gBAAgB,GAAG,IAAI,4BAAgB,CAChD,yBAAyB,EACzB,sBAAO,EACP,iCAAqB,EACrB,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,+BAAmB,CAAC,EAAE,EAAE,iCAAc,CAAC,MAAM,EAAE,mCAAuB,EAAE,8BAAc,CAAC,EAAE,CAAC,EAAE,gCAAgB,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EACrJ;IACI,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,4BAAgB,CAAC,EAAE,EAAE,yBAAyB,EAAE,MAAM,CAAC,CAAC;IACtF,IAAI,4BAAgB,CAAC,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,CAAC;IAC5E,IAAI,4BAAgB,CAAC,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,CAAC;IAChF,IAAI,4BAAgB,CAAC,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,CAAC;IACzE,IAAI,4BAAgB,CAAC,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,CAAC;CAC1E,EACD,EAAE,EACF,EAAE,CACL,CAAC","sourcesContent":["import { optionalTuning, recommendedSeeds } from './rule-settings';\nimport { OwnedRuleDefinition, RuleContribution, RulePackManifest, RULE_PACK_API_VERSION, RULE_SCHEMA_API_VERSION } from '@webpieces/rules-sdk';\nimport { version } from '../package.json';\nimport { LintRuleConfig } from './lint-rule-config';\n\n/** Lint-only policies own their explicit schema and contribute to the code-owned policies. */\nconst ownedRuleIds = [\n \"enforce-architecture\",\n \"no-json-property-primitive-type\",\n \"require-typed-template\",\n \"no-mat-cell-def\"\n] as const;\n\nexport const rulePackManifest = new RulePackManifest(\n '@webpieces/eslint-rules',\n version,\n RULE_PACK_API_VERSION,\n ownedRuleIds.map(id => new OwnedRuleDefinition(id, LintRuleConfig.SCHEMA, RULE_SCHEMA_API_VERSION, optionalTuning[id], recommendedSeeds[id], 'lint')),\n [\n ...ownedRuleIds.map(id => new RuleContribution(id, '@webpieces/eslint-rules', 'lint')),\n new RuleContribution('catch-error-pattern', '@webpieces/code-rules', 'lint'),\n new RuleContribution('no-unmanaged-exceptions', '@webpieces/code-rules', 'lint'),\n new RuleContribution('max-method-lines', '@webpieces/code-rules', 'lint'),\n new RuleContribution('max-file-lines', '@webpieces/code-rules', 'lint'),\n ],\n [],\n [],\n);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConfigObject } from '@webpieces/rules-sdk';
|
|
2
|
+
/** Optional knobs only. Required behaviour is always supplied by the repository. */
|
|
3
|
+
export declare const optionalTuning: Readonly<Record<string, ConfigObject>>;
|
|
4
|
+
/** Written for review by setup/sync; never used as a loader fallback. */
|
|
5
|
+
export declare const recommendedSeeds: Readonly<Record<string, ConfigObject>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recommendedSeeds = exports.optionalTuning = void 0;
|
|
4
|
+
/** Optional knobs only. Required behaviour is always supplied by the repository. */
|
|
5
|
+
exports.optionalTuning = {
|
|
6
|
+
"enforce-architecture": {},
|
|
7
|
+
"no-json-property-primitive-type": {},
|
|
8
|
+
"require-typed-template": {},
|
|
9
|
+
"no-mat-cell-def": {}
|
|
10
|
+
};
|
|
11
|
+
/** Written for review by setup/sync; never used as a loader fallback. */
|
|
12
|
+
exports.recommendedSeeds = {
|
|
13
|
+
"enforce-architecture": {
|
|
14
|
+
"mode": "ON",
|
|
15
|
+
"turnOffRuleUntilEpoch": 0,
|
|
16
|
+
"turnOffRuleWhileOnBranch": null
|
|
17
|
+
},
|
|
18
|
+
"no-json-property-primitive-type": {
|
|
19
|
+
"mode": "ON",
|
|
20
|
+
"turnOffRuleUntilEpoch": 0,
|
|
21
|
+
"turnOffRuleWhileOnBranch": null
|
|
22
|
+
},
|
|
23
|
+
"require-typed-template": {
|
|
24
|
+
"mode": "ON",
|
|
25
|
+
"turnOffRuleUntilEpoch": 0,
|
|
26
|
+
"turnOffRuleWhileOnBranch": null
|
|
27
|
+
},
|
|
28
|
+
"no-mat-cell-def": {
|
|
29
|
+
"mode": "ON",
|
|
30
|
+
"turnOffRuleUntilEpoch": 0,
|
|
31
|
+
"turnOffRuleWhileOnBranch": null
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=rule-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-settings.js","sourceRoot":"","sources":["../../../../../packages/tooling/eslint-rules/src/rule-settings.ts"],"names":[],"mappings":";;;AAEA,oFAAoF;AACvE,QAAA,cAAc,GAA2C;IAClE,sBAAsB,EAAE,EAAE;IAC1B,iCAAiC,EAAE,EAAE;IACrC,wBAAwB,EAAE,EAAE;IAC5B,iBAAiB,EAAE,EAAE;CACxB,CAAC;AAEF,yEAAyE;AAC5D,QAAA,gBAAgB,GAA2C;IACpE,sBAAsB,EAAE;QACpB,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE,CAAC;QAC1B,0BAA0B,EAAE,IAAI;KACnC;IACD,iCAAiC,EAAE;QAC/B,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE,CAAC;QAC1B,0BAA0B,EAAE,IAAI;KACnC;IACD,wBAAwB,EAAE;QACtB,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE,CAAC;QAC1B,0BAA0B,EAAE,IAAI;KACnC;IACD,iBAAiB,EAAE;QACf,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE,CAAC;QAC1B,0BAA0B,EAAE,IAAI;KACnC;CACJ,CAAC","sourcesContent":["import { ConfigObject } from '@webpieces/rules-sdk';\n\n/** Optional knobs only. Required behaviour is always supplied by the repository. */\nexport const optionalTuning: Readonly<Record<string, ConfigObject>> = {\n \"enforce-architecture\": {},\n \"no-json-property-primitive-type\": {},\n \"require-typed-template\": {},\n \"no-mat-cell-def\": {}\n};\n\n/** Written for review by setup/sync; never used as a loader fallback. */\nexport const recommendedSeeds: Readonly<Record<string, ConfigObject>> = {\n \"enforce-architecture\": {\n \"mode\": \"ON\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-json-property-primitive-type\": {\n \"mode\": \"ON\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"require-typed-template\": {\n \"mode\": \"ON\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-mat-cell-def\": {\n \"mode\": \"ON\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n }\n};\n"]}
|