@oracle/oraclejet-audit 10.0.0 → 11.1.3
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/jaf-amd.js +12 -4
- package/jaf.js +6 -1
- package/jafapi.js +6 -1
- package/lib/AST.js +6 -1
- package/lib/AST_Ts.js +6 -1
- package/lib/AstJson.js +6 -1
- package/lib/AstNodeTypes.js +6 -1
- package/lib/Comments.js +6 -1
- package/lib/ComponentSvcs.js +5 -0
- package/lib/Components.js +6 -1
- package/lib/Config.js +6 -1
- package/lib/ConfigLib.js +6 -1
- package/lib/CssLib.js +5 -0
- package/lib/CssUtils.js +5 -0
- package/lib/DomUtils.js +6 -1
- package/lib/FileIndex.js +5 -0
- package/lib/FileSet.js +5 -0
- package/lib/FsUtils.js +6 -1
- package/lib/Histo.js +6 -0
- package/lib/HtmlTree.js +6 -1
- package/lib/HtmlUtils.js +5 -0
- package/lib/Issue.js +5 -0
- package/lib/JafEvents.js +5 -0
- package/lib/JafLib.js +6 -1
- package/lib/Json.js +6 -0
- package/lib/JsonLoader.js +6 -1
- package/lib/MetaLib.js +6 -1
- package/lib/NetUtils.js +5 -0
- package/lib/NodeTypes.js +5 -0
- package/lib/Parser.js +6 -1
- package/lib/RegTypes.js +5 -0
- package/lib/Registry.js +5 -0
- package/lib/Reporter.js +5 -0
- package/lib/RuleContext.js +5 -0
- package/lib/RulePack.js +5 -0
- package/lib/RuleSet.js +6 -1
- package/lib/Rules.js +6 -1
- package/lib/Scope.js +6 -1
- package/lib/SemVer.js +5 -0
- package/lib/Server.js +5 -0
- package/lib/SevLib.js +5 -0
- package/lib/Severity.js +6 -1
- package/lib/Stats.js +6 -0
- package/lib/Ts.js +6 -1
- package/lib/Utils.js +6 -1
- package/lib/Watch.js +5 -0
- package/lib/Writer.js +5 -0
- package/lib/ZipUtils.js +5 -0
- package/lib/api.js +6 -0
- package/lib/cliStats.js +6 -0
- package/lib/clone.js +5 -0
- package/lib/cmdline.js +6 -1
- package/lib/colors.js +5 -0
- package/lib/exportRules.js +6 -0
- package/lib/extends.js +6 -0
- package/lib/filetypes.js +6 -0
- package/lib/groups.js +6 -0
- package/lib/help.js +6 -1
- package/lib/imanual.js +6 -0
- package/lib/jetver.js +6 -1
- package/lib/macros.js +6 -0
- package/lib/metaLoader.js +5 -0
- package/lib/metahist.js +5 -0
- package/lib/msgidLoader.js +6 -1
- package/lib/ns.js +6 -1
- package/lib/nslist.js +6 -1
- package/lib/outFormat.js +6 -0
- package/lib/outfile.js +5 -0
- package/lib/ruleLoader.js +5 -0
- package/lib/scaffold.js +6 -1
- package/lib/scaffoldRule.js +6 -1
- package/lib/schema.js +5 -0
- package/lib/scopewalker.js +6 -0
- package/lib/spinner.js +5 -0
- package/lib/spinnernoop.js +5 -0
- package/lib/tabs.js +5 -0
- package/lib/xmanual.js +6 -0
- package/libext/expparser.js +6 -1
- package/meta/10.1.0/jetauditmeta.js +9 -0
- package/meta/11.0.0/jetauditmeta.js +9 -0
- package/meta/11.1.0/jetauditmeta.js +9 -0
- package/meta/metaverlist.json +1 -1
- package/package.json +2 -3
- package/rulepacks/csp/csp-html-script-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-html-style-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-html-unsafe-expr.js +5 -0
- package/rulepacks/csp/csp-js-script-unsafe-eval.js +6 -1
- package/rulepacks/csp/csp-js-style-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-ts-script-unsafe-eval.js +6 -0
- package/rulepacks/csp/csp-ts-style-unsafe-inline.js +6 -0
- package/rulepacks/csp/msgid.json +6 -1
- package/rulepacks/csp/rules.json +6 -1
- package/rulepacks/jetwc/jetwc-absolute-jetversion.js +6 -1
- package/rulepacks/jetwc/jetwc-aria-redefinition.js +6 -1
- package/rulepacks/jetwc/jetwc-bootstrap.js +6 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +6 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +6 -1
- package/rulepacks/jetwc/jetwc-component-dependencies.js +6 -1
- package/rulepacks/jetwc/jetwc-component-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-component-foldername.js +6 -1
- package/rulepacks/jetwc/jetwc-component-location.js +6 -1
- package/rulepacks/jetwc/jetwc-component-type.js +6 -1
- package/rulepacks/jetwc/jetwc-data-property-prefix.js +6 -1
- package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +6 -1
- package/rulepacks/jetwc/jetwc-disabled-property.js +6 -1
- package/rulepacks/jetwc/jetwc-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +6 -1
- package/rulepacks/jetwc/jetwc-dynamic-slots-naming.js +6 -1
- package/rulepacks/jetwc/jetwc-event-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-events.js +6 -1
- package/rulepacks/jetwc/jetwc-jet-version.js +6 -1
- package/rulepacks/jetwc/jetwc-loader-file.js +6 -1
- package/rulepacks/jetwc/jetwc-method-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-methods.js +6 -1
- package/rulepacks/jetwc/jetwc-namespace.js +6 -1
- package/rulepacks/jetwc/jetwc-nested-defaults.js +6 -1
- package/rulepacks/jetwc/jetwc-nls-languages.js +6 -1
- package/rulepacks/jetwc/jetwc-nls-root.js +6 -1
- package/rulepacks/jetwc/jetwc-oj-register.js +6 -1
- package/rulepacks/jetwc/jetwc-ojcss.js +6 -1
- package/rulepacks/jetwc/jetwc-pack-children.js +6 -1
- package/rulepacks/jetwc/jetwc-packable-components.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-pattern.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-version.js +6 -1
- package/rulepacks/jetwc/jetwc-property-changed.js +6 -1
- package/rulepacks/jetwc/jetwc-property-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-property-nesting.js +6 -1
- package/rulepacks/jetwc/jetwc-public-modules.js +6 -1
- package/rulepacks/jetwc/jetwc-register-css.js +6 -1
- package/rulepacks/jetwc/jetwc-register-with-promises.js +6 -1
- package/rulepacks/jetwc/jetwc-require-paths.js +6 -1
- package/rulepacks/jetwc/jetwc-required-subproperty.js +6 -0
- package/rulepacks/jetwc/jetwc-reserved-property.js +6 -1
- package/rulepacks/jetwc/jetwc-schema.js +6 -1
- package/rulepacks/jetwc/jetwc-semantic-version.js +6 -1
- package/rulepacks/jetwc/jetwc-slot-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-standard-files.js +6 -1
- package/rulepacks/jetwc/jetwc-subproperty-writeback.js +6 -0
- package/rulepacks/jetwc/jetwc-template-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-unused-events.js +6 -1
- package/rulepacks/jetwc/jetwc-unused-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-vb-category.js +6 -1
- package/rulepacks/jetwc/jetwc-vb-icon.js +6 -1
- package/rulepacks/jetwc/jetwc-version-openrange.js +6 -1
- package/rulepacks/jetwc/jetwc-writeback-required.js +6 -1
- package/rulepacks/jetwc/msgid.json +6 -0
- package/rulepacks/jetwc/rules.json +6 -1
- package/rulepacks/jetwc-lib/component-audit-utils.js +6 -1
- package/rulepacks/jetwco/jetwco-bootstrap.js +6 -1
- package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +6 -1
- package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +6 -0
- package/rulepacks/jetwco/jetwco-component-api-changes.js +6 -1
- package/rulepacks/jetwco/jetwco-component-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-exchange-version-check.js +6 -1
- package/rulepacks/jetwco/jetwco-license-info.js +6 -1
- package/rulepacks/jetwco/jetwco-prerelease-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-thirdparty-ba.js +6 -1
- package/rulepacks/jetwco/msgid.json +6 -0
- package/rulepacks/jetwco/rules.json +6 -1
- package/rulepacks/spoc/msgid.json +5 -0
- package/rulepacks/spoc/rules.json +5 -0
- package/rulepacks/spoc/spoc-dom-manip-inv-tag.js +5 -0
- package/rulepacks/spoc/spoc-dom-manip-tag-pos.js +5 -0
- package/rulepacks/spoc/spoc-dom-manip.js +5 -0
- package/rules/jaf/jaf-css-diagnose.js +5 -0
- package/rules/jaf/jaf-html-diagnose.js +5 -0
- package/rules/jaf/jaf-init-schema.js +5 -0
- package/rules/jaf/jaf-js-diagnose.js +5 -0
- package/rules/jaf/jaf-ts-diagnose.js +6 -0
- package/rules/jaf/msgid.json +6 -1
- package/rules/jaf/rules.json +6 -1
- package/rules/jet/helpers/acc-aria-label.js +6 -1
- package/rules/jet/helpers/bp-checkPropType.js +5 -0
- package/rules/jet/helpers/cssHelper.js +6 -1
- package/rules/jet/helpers/extractStylesFromClass.js +6 -1
- package/rules/jet/helpers/has-slot-name.js +6 -1
- package/rules/jet/helpers/has-slot.js +5 -0
- package/rules/jet/helpers/json-prop-pos.js +5 -0
- package/rules/jet/helpers/json-propname-pos.js +5 -0
- package/rules/jet/helpers/style-selector.js +6 -1
- package/rules/jet/helpers/valid-attr.js +5 -0
- package/rules/jet/helpers/vartrack.js +5 -0
- package/rules/jet/jet-css-ojselector.js +5 -0
- package/rules/jet/msgid.json +6 -1
- package/rules/jet/oj-acc-aria-labelledby.js +5 -0
- package/rules/jet/oj-acc-aria-prop.js +5 -0
- package/rules/jet/oj-acc-avatar-aria-role.js +5 -0
- package/rules/jet/oj-acc-combobox-aria-label.js +6 -1
- package/rules/jet/oj-acc-film-strip-aria-label.js +5 -0
- package/rules/jet/oj-acc-input-aria-label.js +6 -1
- package/rules/jet/oj-acc-select-aria-label.js +6 -1
- package/rules/jet/oj-cca-compjson-bp-ar.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-dsplyname.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-jetver.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-obj.js +5 -0
- package/rules/jet/oj-cca-compjson-ns-reg.js +5 -0
- package/rules/jet/oj-css-bp-border-color.js +5 -0
- package/rules/jet/oj-css-bp-dir-flow.js +6 -1
- package/rules/jet/oj-css-bp-float.js +5 -0
- package/rules/jet/oj-css-bp-textalign.js +5 -0
- package/rules/jet/oj-css-style-abs-units.js +5 -0
- package/rules/jet/oj-css-style-bp-color.js +6 -1
- package/rules/jet/oj-css-style-bp-display.js +6 -1
- package/rules/jet/oj-css-style-bp-font-family.js +6 -1
- package/rules/jet/oj-css-style-bp-font.js +5 -0
- package/rules/jet/oj-css-style-deprecated.js +6 -1
- package/rules/jet/oj-css-style-override.js +6 -1
- package/rules/jet/oj-css-var-override.js +5 -0
- package/rules/jet/oj-form-maxcols.js +6 -0
- package/rules/jet/oj-html-5-attr-obs.js +5 -0
- package/rules/jet/oj-html-5-tag-obs.js +5 -0
- package/rules/jet/oj-html-attr-$unique.js +5 -0
- package/rules/jet/oj-html-attr-2def.js +5 -0
- package/rules/jet/oj-html-attr-json.js +6 -1
- package/rules/jet/oj-html-attr-prefix-expr.js +6 -1
- package/rules/jet/oj-html-attr-prefix-ro.js +5 -0
- package/rules/jet/oj-html-attr-req.js +5 -0
- package/rules/jet/oj-html-bindforeach-data.js +5 -0
- package/rules/jet/oj-html-bindif-test.js +5 -0
- package/rules/jet/oj-html-binding-attr.js +5 -0
- package/rules/jet/oj-html-cca-count.js +5 -0
- package/rules/jet/oj-html-cca-tagname.js +6 -1
- package/rules/jet/oj-html-cdn.js +5 -0
- package/rules/jet/oj-html-combo-converter.js +5 -0
- package/rules/jet/oj-html-cspexpr.js +6 -1
- package/rules/jet/oj-html-databind-all.js +5 -0
- package/rules/jet/oj-html-dlg-title.js +5 -0
- package/rules/jet/oj-html-file-pick-accept.js +6 -0
- package/rules/jet/oj-html-form-bindif.js +6 -1
- package/rules/jet/oj-html-form-layout-maxcols.js +6 -0
- package/rules/jet/oj-html-form-noflex.js +5 -0
- package/rules/jet/oj-html-input-isodate.js +6 -0
- package/rules/jet/oj-html-invalid-doctype.js +6 -1
- package/rules/jet/oj-html-jq-databind.js +6 -1
- package/rules/jet/oj-html-ko-comment.js +5 -0
- package/rules/jet/oj-html-ko-databind.js +5 -0
- package/rules/jet/oj-html-label-for-prefix.js +5 -0
- package/rules/jet/oj-html-missing-doctype.js +6 -1
- package/rules/jet/oj-html-oj-lib.js +5 -0
- package/rules/jet/oj-html-ojattr-520.js +6 -1
- package/rules/jet/oj-html-ojattr-deprecated.js +6 -1
- package/rules/jet/oj-html-ojattr-enum-deprecated.js +6 -1
- package/rules/jet/oj-html-ojattr-evt-syntax.js +5 -0
- package/rules/jet/oj-html-ojattr-value.js +6 -1
- package/rules/jet/oj-html-ojattr.js +6 -1
- package/rules/jet/oj-html-ojevent.js +6 -1
- package/rules/jet/oj-html-ojslot.js +5 -0
- package/rules/jet/oj-html-ojstyle.js +5 -0
- package/rules/jet/oj-html-ojtag-datacmd.js +6 -1
- package/rules/jet/oj-html-ojtag-datactx.js +5 -0
- package/rules/jet/oj-html-ojtag-deprecated.js +6 -1
- package/rules/jet/oj-html-ojtag-globattr-noprefix.js +5 -0
- package/rules/jet/oj-html-ojtag-id.js +5 -0
- package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +5 -0
- package/rules/jet/oj-html-ojtag-ns.js +5 -0
- package/rules/jet/oj-html-picker-attrs.js +6 -0
- package/rules/jet/oj-html-redwood-cssnovars.js +6 -0
- package/rules/jet/oj-html-redwood-cssvars.js +6 -0
- package/rules/jet/oj-html-self-close.js +5 -0
- package/rules/jet/oj-html-slot-item-minmax.js +6 -0
- package/rules/jet/oj-html-slot-name.js +6 -1
- package/rules/jet/oj-html-slot-pref-content.js +6 -0
- package/rules/jet/oj-html-style-abs-units.js +5 -0
- package/rules/jet/oj-html-style-bp-color.js +5 -0
- package/rules/jet/oj-html-style-bp-display.js +6 -1
- package/rules/jet/oj-html-style-bp-font-family.js +5 -0
- package/rules/jet/oj-html-style-bp-font.js +5 -0
- package/rules/jet/oj-html-style-deprecated.js +5 -0
- package/rules/jet/oj-html-style.js +6 -1
- package/rules/jet/oj-html-stylesel.js +6 -1
- package/rules/jet/oj-html-tag-attr-noprefix.js +5 -0
- package/rules/jet/oj-html-template-index.js +6 -0
- package/rules/jet/oj-html-unsup-theme.js +6 -1
- package/rules/jet/oj-html-wctag-$props.js +6 -1
- package/rules/jet/oj-html-wctag-arialabelledby.js +5 -0
- package/rules/jet/oj-html-wctag-for.js +5 -0
- package/rules/jet/oj-html-wctag-id.js +5 -0
- package/rules/jet/oj-html-wctag-packprivate.js +6 -0
- package/rules/jet/oj-js-comp-attr-deprecated.js +5 -0
- package/rules/jet/oj-js-comp-meth-deprecated.js +5 -0
- package/rules/jet/oj-js-no-ext-final.js +5 -0
- package/rules/jet/oj-js-noconsole.js +5 -0
- package/rules/jet/oj-js-ojcomp-deprecated.js +6 -1
- package/rules/jet/oj-js-ojcomp-exist.js +5 -0
- package/rules/jet/oj-js-ojcomp-new.js +5 -0
- package/rules/jet/oj-js-poly-promise.js +6 -1
- package/rules/jet/oj-js-var-undef.js +5 -0
- package/rules/jet/oj-json-syntax.js +6 -1
- package/rules/jet/oj-ts-comp-attr-deprecated.js +5 -0
- package/rules/jet/oj-ts-comp-meth-deprecated.js +5 -0
- package/rules/jet/oj-ts-no-ext-final.js +6 -0
- package/rules/jet/oj-ts-noconsole.js +6 -1
- package/rules/jet/oj-ts-ojcomp-deprecated.js +6 -1
- package/rules/jet/oj-ts-ojcomp-exist.js +6 -1
- package/rules/jet/oj-ts-ojcomp-new.js +6 -1
- package/rules/jet/oj-ts-poly-promise.js +6 -1
- package/rules/jet/rules.json +6 -1
- package/schema/component-schema.json +122 -2
- package/src/JafCore.js +6 -1
- package/types/index.d.ts +144 -35
- package/lib/manual.js +0 -1
- package/lib/stats.js +0 -1
- package/rules/exch/helpers/json-prop-pos.js +0 -1
- package/rules/exch/msgid.json +0 -1
- package/rules/exch/oj-cca-comp-zip-content-composite.js +0 -1
- package/rules/exch/oj-cca-comp-zip-content-pack.js +0 -1
- package/rules/exch/oj-cca-comp-zip-expand.js +0 -1
- package/rules/exch/oj-cca-compjson-evnames.js +0 -1
- package/rules/exch/oj-cca-compjson-file.js +0 -1
- package/rules/exch/oj-cca-compjson-prefix.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-compdeps.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-deps.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-jetver.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-obs.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-type.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-types.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-undef.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-version.js +0 -1
- package/rules/exch/oj-cca-compjson-schema.js +0 -1
- package/rules/exch/oj-cca-zip-compjson.js +0 -1
- package/rules/exch/rules.json +0 -1
- package/rules/jet/oj-css-bp-bgcolor.js +0 -1
- package/tests/components/attr-req-test/component.json +0 -1
- package/tests/components/demo-analog-clock/component.json +0 -1
- package/tests/components/demo-analog-clock/demo-analog-clock-viewModel.js +0 -1
- package/tests/components/demo-analog-clock/extension/demo/js/viewModels/demo.js +0 -1
- package/tests/components/demo-analog-clock/loader.js +0 -1
- package/tests/components/demo-card/component.json +0 -1
- package/tests/components/demo-chart-orientation-control/component.json +0 -1
- package/tests/components/demo-chart-stack-control/component.json +0 -1
- package/tests/components/made-up/component.json +0 -1
- package/tests/components/oj-made-up/component.json +0 -1
- package/tests/components/sp-activity-item/component.json +0 -1
- package/tests/config/config_base.json +0 -1
- package/tests/golden/10.0.0/golden_base.json +0 -1
- package/tests/golden/8.1.0/golden_base.json +0 -1
- package/tests/golden/9.0.0/golden_base.json +0 -1
- package/tests/rulepacks/hooks/hook-rpext.js +0 -1
- package/tests/rulepacks/hooks/hook-start-close-rulepack.js +0 -1
- package/tests/rulepacks/hooks/rule-rpext.js +0 -1
- package/tests/rulepacks/hooks/rules.json +0 -1
- package/tests/rulepacks/tags/proc_directive.js +0 -1
- package/tests/rulepacks/tags/rules.json +0 -1
- package/tests/rulepacks/tags/tag-count-setup.js +0 -1
- package/tests/rulepacks/tags/tag-count.js +0 -1
- package/tests/rules/bugs/JET-4770_PASS_1.html +0 -9
- package/tests/rules/comments/com_FAIL_1.js +0 -57
- package/tests/rules/comments/com_FAIL_2.js +0 -96
- package/tests/rules/comments/com_PASS_1.js +0 -42
- package/tests/rules/comments/com_PASS_2.js +0 -63
- package/tests/rules/comments/com_PASS_3.js +0 -40
- package/tests/rules/comments/com_PASS_4.js +0 -36
- package/tests/rules/comments/com_PASS_5.js +0 -19
- package/tests/rules/csp/html-script-unsafe-inline/FAIL_1.html +0 -11
- package/tests/rules/csp/html-script-unsafe-inline/FAIL_2.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_1.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_2.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_3.html +0 -8
- package/tests/rules/csp/html-style-unsafe-inline/FAIL_1.html +0 -11
- package/tests/rules/csp/html-style-unsafe-inline/PASS_1.html +0 -11
- package/tests/rules/csp/html-unsafe-expr/FAIL_1.html +0 -14
- package/tests/rules/csp/html-unsafe-expr/PASS_1.html +0 -23
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_1.js +0 -17
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_2.js +0 -40
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_3.js +0 -22
- package/tests/rules/csp/js-script-unsafe-eval/PASS_1.js +0 -20
- package/tests/rules/csp/js-script-unsafe-eval/PASS_2.js +0 -44
- package/tests/rules/csp/js-script-unsafe-eval/PASS_3.js +0 -16
- package/tests/rules/csp/js-style-unsafe-inline/FAIL_1.js +0 -25
- package/tests/rules/csp/js-style-unsafe-inline/PASS.js +0 -22
- package/tests/rules/demo/noself_FAIL_1.js +0 -101
- package/tests/rules/import/import_FAIL_1.js +0 -11
- package/tests/rules/import/import_PASS_1.js +0 -10
- package/tests/rules/jet-composites/demo-buttonset-enum/component.json +0 -57
- package/tests/rules/jet-composites/demo-buttonset-enum/loader.js +0 -19
- package/tests/rules/jet-composites/demo-buttonset-enum/view.html +0 -48
- package/tests/rules/jet-composites/demo-card/component.json +0 -28
- package/tests/rules/jet-composites/demo-card/loader.js +0 -16
- package/tests/rules/jet-composites/demo-card/view.html +0 -30
- package/tests/rules/jet-composites/demo-card/viewModel.js +0 -46
- package/tests/rules/jet-composites/demo-card/view_PASS_1.html +0 -21
- package/tests/rules/jet-composites/demo-contact-form/component.json +0 -23
- package/tests/rules/jet-composites/demo-contact-form/loader.js +0 -16
- package/tests/rules/jet-composites/demo-contact-form/view.html +0 -9
- package/tests/rules/jet-composites/demo-grocery-list/component.json +0 -18
- package/tests/rules/jet-composites/demo-grocery-list/loader.js +0 -19
- package/tests/rules/jet-composites/demo-grocery-list/view.html +0 -22
- package/tests/rules/jet-composites/demo-grocery-list/viewModel.js +0 -48
- package/tests/rules/jet-composites/dummy-component-1/component.json +0 -82
- package/tests/rules/jet-composites/dummy-component-2/component.json +0 -72
- package/tests/rules/jet-composites/foo-my-cca/component.json +0 -14
- package/tests/rules/jet-composites/foo-unsup-theme/component.json +0 -29
- package/tests/rules/jet-composites/header/component.json +0 -12
- package/tests/rules/jet-composites/oj-cgbu-omc/attribute-selection/component.json +0 -154
- package/tests/rules/jet-composites/oj-cgbu-omc/component.json +0 -11
- package/tests/rules/jet-composites/oj-cgbu-omc/reference/component.json +0 -185
- package/tests/rules/jet-composites/oj-cgbu-omc/wctag_props_FAIL_1.html +0 -34
- package/tests/rules/jet-composites/oj-enum-depr/component.json +0 -69
- package/tests/rules/jet-composites/oj-html-wctag-id/id_FAIL_1.html +0 -10
- package/tests/rules/jet-composites/oj-html-wctag-id/id_PASS_1.html +0 -6
- package/tests/rules/misc/oj.js +0 -12
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_1.html +0 -23
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_1.html +0 -23
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_2.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_3.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_4.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_5.html +0 -22
- package/tests/rules/oj-acc-aria-prop/aria_prop_FAIL_1.html +0 -22
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_1.html +0 -23
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_2.html +0 -24
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_3.html +0 -21
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_4.html +0 -22
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_5.html +0 -22
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_2.html +0 -21
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_PASS_1.html +0 -20
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_1.html +0 -21
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_PASS_1.html +0 -22
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_1.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_2.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_1.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_2.html +0 -19
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_3.html +0 -22
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_1.html +0 -21
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_1.html +0 -16
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_3.html +0 -26
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_PASS_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_2.html +0 -18
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_PASS_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_PASS_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_3_PASS_1.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_2.html +0 -21
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_PASS_2.html +0 -62
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_nolabel_PASS_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_PASS_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_PASS_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_2.html +0 -21
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_1.zip +0 -1
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_2.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_3.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_4.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_5.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_6.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_7.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_8.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_PASS_1.zip +0 -0
- package/tests/rules/oj-cca-ns-reg/oj-cca-ns-FAIL_1/component.json +0 -19
- package/tests/rules/oj-cca-ns-reg/oj-cca-ns-PASS_1/component.json +0 -19
- package/tests/rules/oj-cgbu-omc_tests/html_ojevent_FAIL_1.html +0 -15
- package/tests/rules/oj-cgbu-omc_tests/html_ojevent_PASS_1.html +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_1/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_10/component.json +0 -103
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_11/component.json +0 -24
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_12/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_13/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_14/component.json +0 -40
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_15/component.json +0 -24
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_16/component.json +0 -44
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_17/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_18/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_19/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_2/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_20/component.json +0 -18
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_21/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_22/component.json +0 -19
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_3/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_4/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_5/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_6/component.json +0 -18
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_7/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_8/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_9/component.json +0 -52
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_1/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_2/component.json +0 -88
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_3/component.json +0 -19
- package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_1.html +0 -22
- package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_2.html +0 -22
- package/tests/rules/oj-css-diagnose/css_FAIL_1.html +0 -14
- package/tests/rules/oj-css-diagnose/css_PASS_1.html +0 -14
- package/tests/rules/oj-css-var-override/varovr_FAIL_1.html +0 -8
- package/tests/rules/oj-html-5-attr-depr/attrdepr_FAIL_1.html +0 -16
- package/tests/rules/oj-html-5-attr-depr/attrdepr_PASS_1.html +0 -16
- package/tests/rules/oj-html-5-tag-depr/tagdepr_FAIL_1.html +0 -9
- package/tests/rules/oj-html-attr/attr_FAIL_1.html +0 -27
- package/tests/rules/oj-html-attr-$unique/attr_$unique1_FAIL_1.html +0 -19
- package/tests/rules/oj-html-attr-$unique/attr_$unique_FAIL_2.html +0 -25
- package/tests/rules/oj-html-attr-2def/attr2def_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-2def/attr2def_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_1.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_2.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_3.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_1.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_2.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_3.html +0 -8
- package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_1.html +0 -17
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_2.html +0 -13
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_3.html +0 -8
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_4.html +0 -13
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_5.html +0 -17
- package/tests/rules/oj-html-attr-req/attrreq_PASS_1.html +0 -24
- package/tests/rules/oj-html-attr-req/attrreq_PASS_2.html +0 -24
- package/tests/rules/oj-html-attr-req/attrreq_PASS_3.html +0 -10
- package/tests/rules/oj-html-attr-req/attrreq_PASS_4.html +0 -11
- package/tests/rules/oj-html-bindforeach-data/bindforeach_data_FAIL_1.html +0 -19
- package/tests/rules/oj-html-bindforeach-data/bindforeach_data_PASS_1.html +0 -10
- package/tests/rules/oj-html-bindif-test/bindif_test_FAIL_1.html +0 -22
- package/tests/rules/oj-html-bindif-test/bindif_test_PASS_1.html +0 -11
- package/tests/rules/oj-html-binding-attr/binding-foreach_FAIL_2.html +0 -28
- package/tests/rules/oj-html-binding-attr/binding-if_FAIL_1.html +0 -23
- package/tests/rules/oj-html-binding-attr/binding-if_PASS_1.html +0 -23
- package/tests/rules/oj-html-cca-count/cca-count_FAIL_1.html +0 -119
- package/tests/rules/oj-html-cca-tagname/ccatag_FAIL_1.html +0 -7
- package/tests/rules/oj-html-cca-tagname/ccatag_PASS_1.html +0 -7
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_1.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_2.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_3.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_PASS_1.html +0 -10
- package/tests/rules/oj-html-cdn/html_cdn_FAIL_1.html +0 -18
- package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_1.html +0 -14
- package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_2.html +0 -10
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_1.html +0 -23
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_2.html +0 -10
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_3.html +0 -13
- package/tests/rules/oj-html-dlg-title/dlgtitle_FAIL_1.html +0 -12
- package/tests/rules/oj-html-dlg-title/dlgtitle_PASS_1.html +0 -12
- package/tests/rules/oj-html-form-noflex/noflex_FAIL_1.html +0 -10
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_1.html +0 -20
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_2.html +0 -13
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_3.html +0 -16
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_4.html +0 -13
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_1.html +0 -6
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_2.html +0 -7
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_3.html +0 -7
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_1.html +0 -37
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_2.html +0 -34
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_3.html +0 -27
- package/tests/rules/oj-html-jq-databind/jq-databind_PASS_1.html +0 -30
- package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_1.html +0 -47
- package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_2.html +0 -36
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_1.html +0 -24
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_2.html +0 -36
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_3.html +0 -29
- package/tests/rules/oj-html-label-for-prefix/for_FAIL_1.html +0 -8
- package/tests/rules/oj-html-label-for-prefix/for_PASS_1.html +0 -8
- package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_1.html +0 -12
- package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_2.html +0 -11
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_1.html +0 -14
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_2.html +0 -5
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_3.html +0 -12
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_5.html +0 -6
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_1.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_2.html +0 -14
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_3.html +0 -13
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_5.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_6.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_PASS_1.html +0 -7
- package/tests/rules/oj-html-oj-lib/oj_lib_FAIL_1.html +0 -15
- package/tests/rules/oj-html-ojattr/ojattr_PASS_1.html +0 -8
- package/tests/rules/oj-html-ojattr/ojattr_PASS_2.html +0 -10
- package/tests/rules/oj-html-ojattr/ojattr_PASS_3.html +0 -7
- package/tests/rules/oj-html-ojattr/ojattr_PASS_4.html +0 -7
- package/tests/rules/oj-html-ojattr-deprecated/ojattr-dep_FAIL1.html +0 -156
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_1.html +0 -19
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_2.html +0 -20
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_PASS_1.html +0 -25
- package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_FAIL_1.html +0 -6
- package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_PASS_1.html +0 -6
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_1.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_2.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_3.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_4.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_5.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_1.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_2.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_3.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_6.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_7.html +0 -10
- package/tests/rules/oj-html-ojattr-value/attr_value_PASS_4.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr_value_PASS_5.html +0 -9
- package/tests/rules/oj-html-ojslot/ojslot_FAIL_1.html +0 -11
- package/tests/rules/oj-html-ojslot/ojslot_PASS_1.html +0 -12
- package/tests/rules/oj-html-ojstyle/style_FAIL_1.html +0 -103
- package/tests/rules/oj-html-ojstyle/style_PASS_2.html +0 -7
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_1.html +0 -10
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_2.html +0 -18
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_3.html +0 -10
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_1.html +0 -28
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_2.html +0 -15
- package/tests/rules/oj-html-ojtag-datactx/datactx_FAIL_1.html +0 -14
- package/tests/rules/oj-html-ojtag-datactx/datactx_PASS_1.html +0 -14
- package/tests/rules/oj-html-ojtag-globattr-noprefix/globattr-noprefix_FAIL_1.html +0 -36
- package/tests/rules/oj-html-ojtag-nonglobattr-prefix/nonglobattr-prefix_FAIL_1.html +0 -26
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_1.html +0 -24
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_2.html +0 -46
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_3.html +0 -10
- package/tests/rules/oj-html-slot-name/slot_name.PASS_1.html +0 -24
- package/tests/rules/oj-html-slot-name/slot_name.PASS_2.html +0 -39
- package/tests/rules/oj-html-slot-name/slot_name.PASS_3.html +0 -10
- package/tests/rules/oj-html-slot-name/slot_name_PASS_4.html +0 -16
- package/tests/rules/oj-html-slot-name/slot_name_PASS_5.html +0 -11
- package/tests/rules/oj-html-slot-name/slot_name_PASS_6.html +0 -14
- package/tests/rules/oj-html-slot-name/slot_name_PASS_7.html +0 -10
- package/tests/rules/oj-html-style/style_FAIL_1.html +0 -7
- package/tests/rules/oj-html-style/style_PASS_1.html +0 -12
- package/tests/rules/oj-html-style/style_PASS_2.html +0 -7
- package/tests/rules/oj-html-style-bp-color/color-FAIL_1.html +0 -17
- package/tests/rules/oj-html-style-bp-color/color-FAIL_2.html +0 -15
- package/tests/rules/oj-html-style-bp-color/color-FAIL_3.html +0 -7
- package/tests/rules/oj-html-style-bp-color/color-PASS_1.html +0 -7
- package/tests/rules/oj-html-style-bp-font-family/fam_FAIL_1.html +0 -23
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_1.html +0 -15
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_2.html +0 -9
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_PASS_1.html +0 -9
- package/tests/rules/oj-html-unsup-theme/unsup_FAIL_1.html +0 -8
- package/tests/rules/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/rules/oj-js-comp-attr-deprecated/attr-del_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-attr-deprecated/attr-dep_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-meth-deprecated/meth-del_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-meth-deprecated/meth-dep_FAIL_1.js +0 -20
- package/tests/rules/oj-js-define-promise/def-prom_FAIL_1.js +0 -16
- package/tests/rules/oj-js-define-promise/def-prom_FAIL_2.js +0 -16
- package/tests/rules/oj-js-diagnose/es6_PASS_1.js +0 -24
- package/tests/rules/oj-js-diagnose/js_FAIL_1.js +0 -12
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_1.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_2.js +0 -23
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_3.js +0 -22
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_4.js +0 -20
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_5.js +0 -24
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_6.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_7.js +0 -15
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_8.js +0 -16
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_1.js +0 -17
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_2.js +0 -17
- package/tests/rules/oj-js-noconsole/nocons_FAIL_1.js +0 -11
- package/tests/rules/oj-js-ojcomp-deprecated/jscomp_FAIL_1.js +0 -27
- package/tests/rules/oj-json-syntax/json_FAIL_1.json +0 -8
- package/tests/rules/oj-json-syntax/json_FAIL_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_1.json +0 -25
- package/tests/rules/oj-json-syntax/json_PASS_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_3.json +0 -14
- package/tests/rules/ojcompjson/attrreq_FAIL_1/component.json +0 -69
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-view.html +0 -6
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-1/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-1/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-view.html +0 -5
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-2/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-2/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component.json +0 -12
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-view.html +0 -5
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-1/component.json +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/resources/nls/audit-singleton-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-view.html +0 -8
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-2/component.json +0 -15
- package/tests/rules/pack-compjson/audit-singleton-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-2/resources/nls/audit-singleton-2-strings.js +0 -18
- package/tests/rules/parse-html/proc_instr.html +0 -9
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_1.js +0 -113
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_2.js +0 -151
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_1.js +0 -149
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_2.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_3.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_4.js +0 -20
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_5.js +0 -246
- package/tests/rules/tab-tests/tab-test_FAIL_1.html +0 -37
- package/tests/rules/tab-tests/tab-test_FAIL_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/src/JetTest.js +0 -1
- package/tests/src/server.js +0 -1
- package/tests/test.js +0 -1
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-nls-languages'};ruleDef.prototype.getShortDescription=function(){return'Ensures that the correct language bundles are supplied'};ruleDef.prototype.getDescription=function(){return'This rule ensures that a string bundle both declares and implements locale overrides for each required language'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAudit,TSExportAssignment:this._doAudit}};ruleDef.prototype._doAudit=function(context,node){let issue;const NT=context.utils.AstUtils.getNodeTypes();if(context.filepath.includes('/resources/nls/')){const dirPath=path.dirname(context.filepath);const bundleName=path.basename(context.filepath);const pathSegs=dirPath.split('/').reverse();const ruleOptions=context.rulePack.getRuleOptions();if(pathSegs[0]==='nls'){const withinComponent=Utils.matchComponentPath(context,dirPath);if(withinComponent){let langProps;if(node.callee&&node.callee.type===NT.IDENTIFIER&&node.callee.name==='define'&&node.arguments&&node.arguments.length>0&&node.arguments[0].type===NT.OBJ_EXPR){langProps=node.arguments[0].properties}else if(node.type==='TSExportAssignment'&&node.expression&&node.expression.type===NT.OBJ_EXPR){langProps=node.expression.properties}if(langProps){const languagesSupported=langProps.reduce((langs,langEntry)=>{if(langEntry.type==='Property'&&langEntry.key.type==='Literal'){if(langEntry.value.type==='Literal'){langs.push({locale:langEntry.key.value,verified:false,enabled:langEntry.value.value})}else if(langEntry.value.type==='ObjectExpression'){langs.push({locale:langEntry.key.value,verified:true})}}return langs},[]);const nlsFiles=context.utils.fsUtils.readDir(dirPath);const expectedLocales=ruleOptions.locales.reduce((locs,locale)=>{if(locale.includes('|')){const alternatives=locale.split('|');locs.push({locale:alternatives[0].toLowerCase(),alt:alternatives[1].toLowerCase(),found:false,configured:locale})}else{locs.push({locale:locale.toLowerCase(),alt:locale.toLowerCase(),found:false,configured:locale})}return locs},[]);expectedLocales.push({locale:'root',alt:'root',found:false,configured:'Root Bundle'});languagesSupported.forEach(lang=>{if(lang.verified){issue=new context.Issue(`Component '${withinComponent}' - the recommended pattern for string bundles is for each locale to be defined in its own file in a locale specific subdirectory under /resources/nls/`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'info')}else{if(!lang.enabled){issue=new context.Issue(`Component '${withinComponent}' - locale support declared for '${lang.locale}', but is currently disabled`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'info')}else{let bundleFound=false;const localeFolder=nlsFiles.filter(nlsChild=>{let found=false;if(!nlsChild.isFile){found=this._localeMatch(nlsChild.name,lang.locale,ruleOptions.strict)}return found});if(localeFolder.length===1){const localeSpecificFile=localeFolder[0].files.filter(localeChild=>localeChild.isFile&&localeChild.name===bundleName);if(localeSpecificFile.length===1){bundleFound=true;expectedLocales.forEach(localeRec=>{if(this._localeMatch(localeRec.locale,lang.locale,ruleOptions.strict)||this._localeMatch(localeRec.alt,lang.locale,ruleOptions.strict)){localeRec.found=true}})}}if(!bundleFound){issue=new context.Issue(`Component '${withinComponent}' - locale support declared for '${lang.locale}', but the expected file: '/resources/nls/${lang.locale}/${bundleName}' is missing`);issue.setMsgKey(context.ruleName+'_3');context.reporter.addIssue(issue,context,'major')}}}});if(!issue){expectedLocales.forEach(localeRec=>{if(!localeRec.found){issue=new context.Issue(`Component '${withinComponent}' - required locale support not provided for '${localeRec.configured}'`);issue.setMsgKey(context.ruleName+'_4');context.reporter.addIssue(issue,context,'major')}})}}}}}};ruleDef.prototype._localeMatch=function(test,against,strict){let l1,l2;if(strict){l1=test;l2=against}else{l1=test.toLowerCase().replace('_','-');l2=against.toLowerCase().replace('_','-')}return l1===l2};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-nls-root'};ruleDef.prototype.getShortDescription=function(){return'Checks for the existence of translations in the expected place'};ruleDef.prototype.getDescription=function(){return'This rule ensures that standards are being followed regarding the use of translation bundles'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAudit,TSImportEqualsDeclaration:this._doAuditImportRequire}};ruleDef.prototype._doAudit=function(context,node){const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));if(withinComponent&&(node.callee.name==='define'||node.callee.name==='require')){if(node.arguments[0].type==='ArrayExpression'&&node.arguments[0].elements.length>0){node.arguments[0].elements.forEach(arg=>{if(arg.value){this._checkRequireTarget(context,withinComponent,arg.value)}})}else if(node.arguments[0].type==='Literal'&&node.arguments[0].value){this._checkRequireTarget(context,withinComponent,node.arguments[0].value)}}};ruleDef.prototype._doAuditImportRequire=function(context,node){const NT=context.utils.AstUtils.getNodeTypes();const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));if(withinComponent){if(node.moduleReference&&node.moduleReference.type==='TSExternalModuleReference'&&node.moduleReference.expression){const sourcePath=node.moduleReference.expression.value;this._checkRequireTarget(context,withinComponent,sourcePath)}}};ruleDef.prototype._checkRequireTarget=function(context,withinComponent,sourcePath){if(sourcePath&&sourcePath.startsWith('ojL10n!')){let bundleStdLocation=false;const componentInfo=context.rulePack.getExtension().allComponents.get(withinComponent);const expectedFolderStart=sourcePath.indexOf('/resources/nls/');if(expectedFolderStart>0){const depathed=sourcePath.substring(7).split('/');const resourcesOffset=depathed.indexOf('resources');const nlsOffset=depathed.indexOf('nls');if(nlsOffset===resourcesOffset+1){const requireRoot=depathed.slice(0,nlsOffset-1).join('/');if(componentInfo.requirePaths.has(requireRoot)){bundleStdLocation=true}}}if(!bundleStdLocation){issue=new context.Issue(`String bundle for component ${componentInfo.fullName} is either not in the recommended location of /resources/nls/ relative to the source component or is defined with an unsupported path. Found: ${sourcePath}`);context.reporter.addIssue(issue,context,'info')}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-oj-register'};ruleDef.prototype.getShortDescription=function(){return'Checks for usage of the deprecated oj.Register() syntax'};ruleDef.prototype.getDescription=function(){return'This rule ensures that components have been upgraded to remove references to the deprecated oj.Register() syntax'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAudit}};ruleDef.prototype._doAudit=function(context,node){if(path.basename(context.filepath,'.js')==='loader'||path.basename(context.filepath,'.ts')==='loader'){const registerInfo=Utils.getLoaderRegisterInfo(context,node);if(registerInfo&®isterInfo.oldStyle){issue=new context.Issue(`Loader for Web Component registration uses deprecated oj.Register syntax`);context.reporter.addIssue(issue,context,'minor')}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-ojcss'};ruleDef.prototype.getShortDescription=function(){return'Checks that the requirejs css! plugin is not used'};ruleDef.prototype.getDescription=function(){return'Teams should be using ojcss! in preference to css!'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAudit,ImportDeclaration:this._doAuditImport}};ruleDef.prototype._doAuditImport=function(context,node){const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));if(withinComponent){if(node.importKind==='value'&&node.source&&node.source.type==='Literal'&&node.source.value.startsWith('css!')){const componentInfo=context.rulePack.getExtension().allComponents.get(withinComponent);const issue=new context.Issue(`Component ${componentInfo.fullName} uses the requireJS css! plugin. The ojcss! plugin should be used instead`);context.reporter.addIssue(issue,context,'minor')}}};ruleDef.prototype._doAudit=function(context,node){let issue;const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));if(withinComponent&&(node.callee.name==='define'||node.callee.name==='require')){if(node.arguments[0].type==='ArrayExpression'&&node.arguments[0].elements.length>0){node.arguments[0].elements.forEach(arg=>{this._checkRequireTarget(context,withinComponent,arg)})}else if(node.arguments[0].type==='Literal'){this._checkRequireTarget(context,withinComponent,node.arguments[0])}}};ruleDef.prototype._checkRequireTarget=function(context,withinComponent,node){if(node.type==='Literal'&&node.value.startsWith('css!')){const componentInfo=context.rulePack.getExtension().allComponents.get(withinComponent);if(componentInfo){issue=new context.Issue(`Component ${componentInfo.fullName} uses the requireJS css! plugin. The ojcss! plugin should be used instead`);context.reporter.addIssue(issue,context,'minor')}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-pack-children'};ruleDef.prototype.getShortDescription=function(){return'Ensure that all of the stated children of a pack are actually present and that we do not have any obvious orphans'};ruleDef.prototype.getDescription=function(){return'This rule inspects the physical structure of a pack and ensures that the declared child components are indeed present. We also check for un-registered children'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;if(componentMetadata){let issue;let emptyMembership=false;if(componentMetadata.type&&componentMetadata.type==='pack'){const packName=componentMetadata.name;const packRoot=path.dirname(context.filepath);if(componentMetadata.dependencies){const packMembers=Object.keys(componentMetadata.dependencies);if(packMembers.length>0){const packFileStructure=context.utils.fsUtils.readDir(packRoot);packMembers.forEach(fullName=>{if(!fullName.startsWith(packName)){issue=new context.Issue(`All members of the '${packName}' Pack should be named with the pack name prefix`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'major')}if(!issue){const componentDir=fullName.slice(packName.length+1);const componentFolder=packFileStructure.filter(fileObj=>fileObj.name===componentDir&&!fileObj.file);if(componentFolder.length!==1){issue=new context.Issue(`Pack ${packName} dependency '${fullName}' should be defined in a folder called '${componentDir}' for referencing to work correctly`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'blocker')}}});packFileStructure.map(child=>{if(!child.isFile){const matchesDeclaration=packMembers.filter(childComponent=>childComponent===`${packName}-${child.name}`);if(matchesDeclaration.length===0){if(child.files&&child.files.length>0){const childFolderComponent=child.files.filter(childFolderFile=>childFolderFile.name==='component.json');if(childFolderComponent.length>0){issue=new context.Issue(`Pack ${packName} seems to have a child component '${child.name}' that is not included in the dependencies of the pack`);issue.setMsgKey(context.ruleName+'_3');context.reporter.addIssue(issue,context,'major')}}}}})}else{emptyMembership=true}}else{emptyMembership=true}if(emptyMembership){issue=new context.Issue(`Pack '${componentMetadata.name}' has no defined members`);issue.setMsgKey(context.ruleName+'_4');context.reporter.addIssue(issue,context,'major')}}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-packable-components'};ruleDef.prototype.getShortDescription=function(){return'Validate that components that are, or are not, defined as part of a pack'};ruleDef.prototype.getDescription=function(){return'This rule checks the type of a component and detects, in the case that it is part of a pack, if this should be the case (or not)'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;if(componentMetadata){let issue;const componentType=Utils.getComponentType(componentMetadata);const componentPack=componentMetadata.pack;switch(componentType){case'pack':case'reference':case'vbcs-template':if(componentPack){issue=new context.Issue(`Component '${componentMetadata.name}' (type: ${componentType}), should be defined as a singleton component, not as a member of a pack`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'blocker')}break;case'resource':if(!componentPack){issue=new context.Issue(`Component '${componentMetadata.name}' (type: ${componentType}), should be defined as a member of a pack, not a singleton`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'major')}break;case'demo':if(componentPack){issue=new context.Issue(`Component '${componentMetadata.name}', we advise that demo components are not included in a pack`);issue.setMsgKey(context.ruleName+'_3');context.reporter.addIssue(issue,context,'minor')}break;}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-prerelease-dependencies'};ruleDef.prototype.getShortDescription=function(){return'Issue an info audit for any components that have pre-release dependencies'};ruleDef.prototype.getDescription=function(){return'This rule can be applied before production to ensure that all components depend, in turn, on release ready versions'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const componentMetadata=context.suppData.obj;const fullName=Utils.getComponentFullName(componentMetadata);if(componentMetadata.dependencies){const dependencies=Object.keys(componentMetadata.dependencies);dependencies.forEach(dependency=>{const depRangeMin=context.utils.semVerUtils.minVersion(componentMetadata.dependencies[dependency]);if(depRangeMin.prerelease.length>0){issue=new context.Issue(`Component dependency ${dependency} for ${fullName} has a pre-release version number`);context.reporter.addIssue(issue,context,'info')}})}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-prerelease-pattern'};ruleDef.prototype.getShortDescription=function(){return'Checks pattern of any pre-release version number'};ruleDef.prototype.getDescription=function(){return'This rule ensures that if a component has a pre-release version number it is one that conforms to one of the recommended patterns'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const prereleases=context.utils.semVerUtils.prerelease(meta.version);if(prereleases&&prereleases.length>0){const patterns=[/^alpha|beta|rc$/i,/^\d*$/,/^20\d{6}T\d*$/];if(!(patterns[0].test(prereleases[0])||patterns[1].test(prereleases[0])||patterns[2].test(prereleases[0]))){issue=new context.Issue(`Component ${fullName} has a pre-release version number that does not use a recommended pattern`);context.reporter.addIssue(issue,context,'minor')}}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-prerelease-version'};ruleDef.prototype.getShortDescription=function(){return'Issue an info audit for any components that are flagged with a pre-release version'};ruleDef.prototype.getDescription=function(){return'This rule can be applied before production to ensure that all components have correct release-worthy versions and are not still flagged as pre-releases'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const prereleases=context.utils.semVerUtils.prerelease(meta.version);if(prereleases&&prereleases.length>0){issue=new context.Issue(`Component ${fullName} has a pre-release version number (${meta.version})`);context.reporter.addIssue(issue,context,'info')}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-property-changed'};ruleDef.prototype.getShortDescription=function(){return'Checks for the existence of a propertyChanged function'};ruleDef.prototype.getDescription=function(){return'This rule ensures that any component that has properties also provides a propertyChanged lifecycle listener to handle async updates to those properties'};ruleDef.prototype.register=function(context){return{FunctionExpression:Utils.setupFileMethodMapping.bind(Utils),ArrowFunctionExpression:Utils.setupFileMethodMapping.bind(Utils),MethodDefinition:Utils.setupFileMethodMappingFromMethodDefintion.bind(Utils),CallExpression:Utils.deriveViewModels.bind(Utils),closedownRP:this._doAudit}};ruleDef.prototype._doAudit=function(context){let issue;context.rulePack.getExtension().allComponents.forEach(compInfo=>{if(compInfo.viewModel&&compInfo.viewModel.resolved){if(!Utils.shouldIgnoreCheck(context,'jetwc-property-changed',compInfo.fullName)){if(compInfo.properties){const vmMethods=Utils.getVMMethodsForLocalComposite(context,compInfo);if(vmMethods&&!vmMethods.has('propertyChanged')){issue=new context.Issue(`Component '${compInfo.fullName}' supports properties but does not provide a 'propertyChanged()' lifecycle method to react to async changes to those properties`);context.reporter.addIssue(issue,context,'minor')}}}}})};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const helperPos=require('../../rules/jet/helpers/json-propname-pos');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-property-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component properties have a display name defined'};ruleDef.prototype.getDescription=function(){return'This rule checks that any component properties and sub-properties have a display name supplied to make the user experience in Visual Builder as useful as possible'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-dsplyname','JET')){return false}else{return{compjson:this._doAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const componentName=Utils.getComponentFullName(meta);const propertyList=this._flattenProps(meta);propertyList.forEach(prop=>{if(!Utils.getPropertyAttributeFromPath(context,componentName,prop,'displayName')){issue=new context.Issue(`displayName for property '${prop}' should be defined`);const pos=helperPos(context,prop);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);context.reporter.addIssue(issue,context,'info')}})}};ruleDef.prototype._flattenProps=function(metaDef,parentPath){let flattenedProps=[];if(metaDef.hasOwnProperty('properties')){const propArray=Object.keys(metaDef.properties);propArray.forEach(propertyName=>{let key;if(!parentPath){key=propertyName}else{key=parentPath+'.'+propertyName}flattenedProps.push(key);const subPropsArray=this._flattenProps(metaDef.properties[propertyName],key);flattenedProps=flattenedProps.concat(subPropsArray)})}return flattenedProps};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-property-nesting'};ruleDef.prototype.getShortDescription=function(){return'Checks for correct property nesting depth'};ruleDef.prototype.getDescription=function(){return'This rule determines the depth at which are are happy to see nested properties. The default depth is 3, e.g. parent-child-grandchild. Setting to 1 would catch any use of subProperties'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);const maxDepth=context.rulePack.getRuleOptions().depth?context.rulePack.getRuleOptions().depth:1;if(componentType==='composite'&&meta.properties){this._propertyDrill(context,fullName,meta,0,maxDepth)}}};ruleDef.prototype._propertyDrill=function(context,fullName,metadata,depth,maxDepth,recursion){depth++;const propKeys=Object.keys(metadata.properties);const propDepthCount=new Map;propKeys.forEach(propertyName=>{const checkProperty=metadata.properties[propertyName];if(checkProperty.hasOwnProperty('properties')){propDepthCount.set(propertyName,this._propertyDrill(context,fullName,checkProperty,depth,maxDepth,true))}else{propDepthCount.set(propertyName,depth)}if(!recursion&&propDepthCount.get(propertyName)>maxDepth){issue=new context.Issue(`Property '${propertyName}' in component ${fullName} exceeds the defined maximum level of property nesting. Max: ${maxDepth}, encountered: ${propDepthCount.get(propertyName)}`);context.reporter.addIssue(issue,context,'minor')}});let maxChild=depth;propDepthCount.forEach(depth=>{if(depth>maxChild){maxChild=depth}});return maxChild};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const path=require('path');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-public-modules'};ruleDef.prototype.getShortDescription=function(){return'Ensure the publicModules definition in a resource component is valid'};ruleDef.prototype.getDescription=function(){return'This rule checks that any classes listed in publicModules are correctly specified and exist'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);const componentRoot=path.dirname(context.filepath);if(componentType==='resource'&&meta.publicModules){meta.publicModules.forEach(modulePath=>{let checkPath=Utils.toJAFPath(path.join(componentRoot,modulePath));if(path.extname(modulePath)!==''){issue=new context.Issue(`Resource component ${fullName} publicModule references should not include file extension`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'major')}else{if(!context.utils.fsUtils.fileExistsSync(checkPath+'.js')){if(!context.utils.fsUtils.fileExistsSync(checkPath+'.ts')){issue=new context.Issue(`Resource component ${fullName} publicModule reference '${modulePath}' does not exist as a JS or TS file`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'major')}}}})}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-register-css'};ruleDef.prototype.getShortDescription=function(){return'Checks for usage of the deprecated registration of CSS files '};ruleDef.prototype.getDescription=function(){return'This rule ensures that components have been upgraded to remove any passing of CSS information to the register() API'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAudit}};ruleDef.prototype._doAudit=function(context,node){if(path.basename(context.filepath,'.js')==='loader'||path.basename(context.filepath,'.ts')==='loader'){const registerInfo=Utils.getLoaderRegisterInfo(context,node);if(registerInfo&®isterInfo.registerCSS){issue=new context.Issue(`Loader for Web Component passes CSS information to the registration call. This is deprecated and the CSS! directive in the loader imports should be used instead`);context.reporter.addIssue(issue,context,'minor')}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-register-with-promises'};ruleDef.prototype.getShortDescription=function(){return'Checks for usage of the deprecated promise syntax for registration'};ruleDef.prototype.getDescription=function(){return'This rule ensures that components have been upgraded to remove references to the deprecated oj.Register() syntax'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAudit}};ruleDef.prototype._doAudit=function(context,node){if(path.basename(context.filepath,'.js')==='loader'||path.basename(context.filepath,'.ts')==='loader'){const registerInfo=Utils.getLoaderRegisterInfo(context,node);if(registerInfo&®isterInfo.usesPromises){issue=new context.Issue(`Loader for Web Component registration uses deprecated promise syntax in Register function`);context.reporter.addIssue(issue,context,'minor')}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-require-paths'};ruleDef.prototype.getShortDescription=function(){return'Checks that any import paths used are valid'};ruleDef.prototype.getDescription=function(){return'This rule ensures that all path references (define, require or import) use paths that are valid in the context of the component. This list of valid paths will be constructed based on the declared and implicit dependencies of the component, combined with the standardPaths configuration property of the jetwc-require-paths rule which you can add to if needs be. The path "." is always valid. The path .. should not be used, use the pack root instead.'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAuditRequireStyle,ImportDeclaration:this._doAuditImport,TSImportEqualsDeclaration:this._doAuditImportRequire}};ruleDef.prototype._doAuditRequireStyle=function(context,node){const ruleOptions=context.rulePack.getRuleOptions();let issue;if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('allComponents')){const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));const componentInfo=context.rulePack.getExtension().allComponents.get(withinComponent);if(withinComponent&&node.callee.type==='Identifier'&&(node.callee.name==='define'||node.callee.name==='require')){if(node.arguments[0].type==='ArrayExpression'&&node.arguments[0].elements.length>0){node.arguments[0].elements.forEach(arg=>{if(arg.value){this._verifyPath(context,arg.value,componentInfo,node.callee.name)}})}else if(node.arguments[0].type==='Literal'&&node.arguments[0].value){this._verifyPath(context,node.arguments[0].value,componentInfo,node.callee.name)}}}else{Utils.reportMissingBootstrapInfo(context,'allComponents')}};ruleDef.prototype._doAuditImport=function(context,node){if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('allComponents')){const NT=context.utils.AstUtils.getNodeTypes();const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));const componentInfo=context.rulePack.getExtension().allComponents.get(withinComponent);if(componentInfo){if(node.source&&node.source.type===NT.LITERAL){const sourcePath=node.source.value;this._verifyPath(context,sourcePath,componentInfo,'import')}}}else{Utils.reportMissingBootstrapInfo(context,'allComponents')}};ruleDef.prototype._doAuditImportRequire=function(context,node){if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('allComponents')){const NT=context.utils.AstUtils.getNodeTypes();const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));const componentInfo=context.rulePack.getExtension().allComponents.get(withinComponent);if(componentInfo){if(node.moduleReference&&node.moduleReference.type==='TSExternalModuleReference'&&node.moduleReference.expression){const sourcePath=node.moduleReference.expression.value;this._verifyPath(context,sourcePath,componentInfo,'importRequire')}}}else{Utils.reportMissingBootstrapInfo(context,'allComponents')}};ruleDef.prototype._verifyPath=function(context,pathToCheck,componentInfo,importType){if(pathToCheck&&typeof pathToCheck==='string'){let pathVerified=false;const allValidPaths=context.rulePack.getRuleOptions().standardPaths.slice(0);if(componentInfo.requirePaths){componentInfo.requirePaths.forEach(depPath=>{allValidPaths.push(depPath)})}let targetPath=pathToCheck;const pluginPos=targetPath.indexOf('!');if(pluginPos>=0){targetPath=targetPath.substring(pluginPos+1)}const targetPathParts=targetPath.split('/');if(allValidPaths.includes(targetPathParts[0])){pathVerified=true}else{if(targetPathParts[1]){const packCompPath=targetPathParts[0]+'/'+targetPathParts[1];if(allValidPaths.includes(packCompPath)){pathVerified=true}}}if(!pathVerified){let sourceInfo;switch(importType){case'import':sourceInfo='Import';break;case'importRequire':sourceInfo='Import via require()';break;case'define':sourceInfo='Import via define()';break;case'require':sourceInfo='Import via require()';break;};issue=new context.Issue(`${sourceInfo} for component ${componentInfo.fullName} is not based on a valid path in that component context. Valid paths would be [${allValidPaths.join(',')}] encountered: '${pathToCheck}'`);context.reporter.addIssue(issue,context,'blocker')}}};module.exports=ruleDef;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-required-subproperty'};ruleDef.prototype.getShortDescription=function(){return'Checks for the required attribute setting on component sub-properties'};ruleDef.prototype.getDescription=function(){return'This rule checks that for complex properties (those with sub-properties) we do not have have a situation where the sub-property is defined as required. As a best practice, any required inputs to a component should really be top level properties.'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'&&meta.properties){const expandedProperties=[];this._propertyDrill(context,meta,expandedProperties);expandedProperties.forEach(prop=>{if(prop.defaultCount>0){issue=new context.Issue(`Component ${fullName}, nested property ${prop.propertyPath} has the required attribute set. Best practice dictates that only top-level properties should be marked as required.`);context.reporter.addIssue(issue,context,'minor')}})}}};ruleDef.prototype._propertyDrill=function(context,metadata,accumulator,parentInfo){const levelPath=parentInfo?parentInfo.propertyPath+'.':'';const defaultCount=parentInfo?parentInfo.defaultCount:0;const propKeys=Object.keys(metadata.properties);propKeys.forEach(propertyName=>{const propertyMeta=metadata.properties[propertyName];if(!this._shouldIgnore(propertyMeta)){let runningCount=defaultCount;if(propertyMeta.hasOwnProperty('required')&&propertyMeta.required&&parentInfo){runningCount++}const propertyInfo={propertyPath:levelPath+propertyName,defaultCount:runningCount};if(propertyMeta.hasOwnProperty('properties')){this._propertyDrill(context,propertyMeta,accumulator,propertyInfo)}accumulator.push(propertyInfo)}})};ruleDef.prototype._shouldIgnore=function(metadataNode){if(metadataNode&&metadataNode.extension&&metadataNode.extension.audit&&metadataNode.extension.audit.ignore&&Array.isArray(metadataNode.extension.audit.ignore)&&metadataNode.extension.audit.ignore.includes(this.getName())){return true}return false};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-reserved-property'};ruleDef.prototype.getShortDescription=function(){return'Check component does not a reserved word as a property name'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component does not define a property that is on the list of reserved values e.g. slot, key, ref, children etc.'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);const reservedProperties=context.rulePack.getRuleOptions().reserved;if(componentType==='composite'&&meta.properties){reservedProperties.forEach(reserved=>{if(meta.properties.hasOwnProperty(reserved)){issue=new context.Issue(`Component ${fullName} defines a property which uses a reserved name: '${reserved}'. You must select a different name for this property`);context.reporter.addIssue(issue,context,'major')}})}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-schema'};ruleDef.prototype.getShortDescription=function(){return'Validate component json definition against the schema'};ruleDef.prototype.getDescription=function(){return'This rule checks verifies the component.json file included with the component against the schema supplied for this purpose'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context,obj){let issue;if(context.suppData.obj){const jsonToValidate=obj.obj.component?obj.obj.component:obj.obj;const schemaErrors=context.utils.metaLib.applySchema(jsonToValidate);if(schemaErrors){schemaErrors.forEach(error=>{issue=new context.Issue(`component.json schema violation: ${this._formatViolation(error)}`);context.reporter.addIssue(issue,context)})}}};ruleDef.prototype._formatViolation=function(report){let formattedMsg;switch(report.error.keyword){case'required':const formattedPath=this._transformViolationDataPath(report.error.dataPath);formattedMsg=`${formattedPath} ${report.msg}`;break;default:formattedMsg=report.msg;}return formattedMsg};ruleDef.prototype._transformViolationDataPath=function(dataPath){let formatted=dataPath;;const parser=/\.(\w*)\['(\w*)'\]/g;const segparser=/\.(\w*)\['(\w*)'\]/;const segments=dataPath.match(parser);const deconstructed=segments.map(seg=>{subParts=seg.match(segparser);return{segment:subParts[0],type:subParts[1],context:subParts[2]}});if(deconstructed&&deconstructed.length>0){if(deconstructed[0].type==='properties'){formatted=`Property ${deconstructed[0].context}`;if(deconstructed.length>1){for(let i=1;i<deconstructed.length;i++){if(deconstructed[i].type==='properties'){formatted+=`.${deconstructed[i].context}`}else{formatted+=` ${deconstructed[i].type}:${deconstructed[i].context}`}}}}}return formatted};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-semantic-version'};ruleDef.prototype.getShortDescription=function(){return'Verify the component has a valid Semver'};ruleDef.prototype.getDescription=function(){return'This rule ensures that a valid semantic version has been used for this component'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentVersionValid=context.utils.semVerUtils.isValid(meta.version);if(!componentVersionValid||meta.version.toLowerCase().startsWith('v')){issue=new context.Issue(`Component ${fullName} has version number which is not in strict semantic versioning format (${meta.version})`);context.reporter.addIssue(issue,context,'blocker')}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-slot-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component has display name defined for slots'};ruleDef.prototype.getDescription=function(){return'This rule checks that slots have a display name supplied to make the user experience in Visual Builder as useful as possible'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const componentType=Utils.getComponentType(meta);if(componentType==='composite'&&meta.slots){Object.keys(meta.slots).forEach(slotName=>{if(!meta.slots[slotName].displayName){issue=new context.Issue(`displayName for ${slotName===''?'default slot':'slot \''+slotName+'\''} should be defined`);context.reporter.addIssue(issue,context,'info')}})}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-slots'};ruleDef.prototype.getShortDescription=function(){return'Verify slots are declared'};ruleDef.prototype.getDescription=function(){return'This rule checks that any slots used are declared in the metadata'};ruleDef.prototype.register=function(context){return{ojtag:this._doAudit}};ruleDef.prototype._doAudit=function(context){let issue;if(context.tag==='oj-bind-slot'){const componentName=Utils.matchComponentPath(context,path.dirname(context.filepath));if(componentName){const slotName=context.tagNode.attribs.name;if(!Utils.isExpressionString(slotName)){const componentSlots=Utils.componentInfo(context,componentName).slots;if(!componentSlots||slotName&&!componentSlots.hasOwnProperty(slotName)||!slotName&&!componentSlots.hasOwnProperty('')){issue=new context.Issue(`Slot '${slotName?slotName:'default'}' for component ${componentName} has not been declared in the component metadata`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'major')}else{const slotDetail=componentSlots[slotName?slotName:''];if(slotDetail.data){issue=new context.Issue(`Slot '${slotName?slotName:'default'}' for component ${componentName} has been declared with a data attribute in the component metadata. The data attribute only applies for template slots`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'minor')}}}}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-standard-files'};ruleDef.prototype.getShortDescription=function(){return'Checks for the existence of standard informational files'};ruleDef.prototype.getDescription=function(){return'This rule ensures that standard files such as readmes are included'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;if(componentMetadata){let issue;const fullName=Utils.getComponentFullName(componentMetadata);const componentFiles=context.utils.fsUtils.readDir(Utils.getDirectoryName(context.filepath));const checkForFiles=context.rulePack.getRuleOptions().files;checkForFiles.forEach(requiredFile=>{let exclusion=false;switch(requiredFile.toLowerCase()){case'changelog.md':case'changelog.txt':case'changes.txt':if(componentMetadata.type&&componentMetadata.type==='reference'){exclusion=true}else{if(context.utils.semVerUtils.gt('1.0.1',componentMetadata.version)){exclusion=true}}break;}if(!exclusion){let hits=componentFiles.filter(compFile=>compFile.name===requiredFile&&compFile.isFile);if(hits.length===0){issue=new context.Issue(`Required supporting file ${requiredFile} is not present for component ${fullName}`);context.reporter.addIssue(issue,context,'info')}}})}};module.exports=ruleDef;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require("path");const Utils=require("../jetwc-lib/component-audit-utils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwc-subproperty-writeback"};ruleDef.prototype.getShortDescription=function(){return"Check for direct sub-property binding to writeback properties in HTML"};ruleDef.prototype.getDescription=function(){return"Detects cases where a sub-property is directly bound to a write-back property in the component HTML e.g <oj-input-text value='{{$properties.obj.somevalue}}'>. This will bypass the correct change notification mechanisms and could lead to bugs as a release"};ruleDef.prototype.register=function(context){return{attrexpr:this._doAudit}};ruleDef.prototype._doAudit=function(context,attribute,attributeValue){let issue;const candidateRE=/^\{\{\$properties\.(\w*)\.[\w\.]*\}\}$/i;const checkProperty=attributeValue.match(candidateRE);if(checkProperty&&checkProperty.length===2){const componentName=Utils.matchComponentPath(context,path.dirname(context.filepath));if(componentName){const meta=Utils.componentInfo(context,componentName);if(meta.properties[checkProperty[1]]){if(meta.properties[checkProperty[1]].writeback){issue=new context.Issue(`Complex Properties such as the expression ${attributeValue} in the component ${componentName} should not be bound directly for writeback`);context.reporter.addIssue(issue,context,"major")}}else{issue=new context.Issue(`Property '${checkProperty[1]}' used in the expression ${attributeValue} is not a valid property for the component ${componentName}`);context.reporter.addIssue(issue,context,"major")}}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require("path");const Utils=require("../jetwc-lib/component-audit-utils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwc-template-slots"};ruleDef.prototype.getShortDescription=function(){return"Verify template slots are named correctly"};ruleDef.prototype.getDescription=function(){return"This rule checks that any template slots used have the correct naming convention and have an associated data parameter"};ruleDef.prototype.register=function(context){return{ojtag:this._doAudit}};ruleDef.prototype._doAudit=function(context){let issue;if(context.tag==="oj-bind-template-slot"){const componentName=Utils.matchComponentPath(context,path.dirname(context.filepath));if(componentName){const slotName=context.tagNode.attribs.name;const usesExpression=slotName&&Utils.isExpressionString(slotName);if(slotName&&!slotName.endsWith("Template")&&!usesExpression){issue=new context.Issue(`Template slot '${slotName}' for component ${componentName} does not follow the recommended naming pattern (should use a Template suffix)`);issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context,"minor")}if(!usesExpression){const data=context.tagNode.attribs.data;const componentSlots=Utils.componentInfo(context,componentName).slots;if(!componentSlots||slotName&&!componentSlots.hasOwnProperty(slotName)||!slotName&&!componentSlots.hasOwnProperty("")){issue=new context.Issue(`Template slot '${slotName?slotName:"default"}' for component ${componentName} has not been declared in the component metadata`);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context,"major")}else{const slotDetail=componentSlots[slotName?slotName:""];if(!slotDetail.data){issue=new context.Issue(`Template slot '${slotName?slotName:"default"}' for component ${componentName} has not been declared with a data attribute in the component metadata`);issue.setMsgKey(context.ruleName+"_3");context.reporter.addIssue(issue,context,"minor")}else{if(!data){issue=new context.Issue(`Template slot '${slotName?slotName:"default"}' for component ${componentName} has not been bound into the page with any data context`);issue.setMsgKey(context.ruleName+"_4");context.reporter.addIssue(issue,context,"major")}else if(!Utils.isExpressionString(data)){issue=new context.Issue(`Template slot '${slotName?slotName:"default"}' for component ${componentName} has been bound into the page with an invalid data context - should be an expression`);issue.setMsgKey(context.ruleName+"_5");context.reporter.addIssue(issue,context,"major")}}}}}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require("path");const Utils=require("../jetwc-lib/component-audit-utils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwc-unused-events"};ruleDef.prototype.getShortDescription=function(){return"Verify that all declared events are actually used"};ruleDef.prototype.getDescription=function(){return"This rule checks that any events declared in the metadata are then actually raised in the associated viewModel"};ruleDef.prototype.register=function(context){return{CallExpression:this._flagEventUse,closedownRP:this._doAudit}};ruleDef.prototype._flagEventUse=function(context,node){if(node.callee.type==="MemberExpression"&&node.callee.property.type==="Identifier"&&node.callee.property.name==="dispatchEvent"){if(node.arguments[0].type==="CallExpression"||node.arguments[0].type==="NewExpression"){if(node.arguments[0].callee.name==="CustomEvent"){const eventNameNode=node.arguments[0].arguments[0];if(eventNameNode.type==="Literal"){const eventName=eventNameNode.value;const componentName=Utils.matchComponentPath(context,path.dirname(context.filepath));this._markEventUsed(context,componentName,eventName)}}}}};ruleDef.prototype._doAudit=function(context){const eventUsage=context.rulePack.getExtension().eventUsage;if(eventUsage){eventUsage.forEach(function(value,key){if(!value){const idParts=key.split(":");const componentName=idParts[0];const eventName=idParts[1];if(!Utils.shouldIgnoreCheck(context,"jetwc-unused-events",componentName,"events",eventName)){const issue=new context.Issue(`Event '${eventName}' for component ${componentName} does not appear to be raised`);context.reporter.addIssue(issue,context,"info")}}})}};ruleDef.prototype._markEventUsed=function(context,componentName,eventName){if(componentName){let eventUsage=context.rulePack.getExtension().eventUsage;const eventKey=`${componentName}:${eventName}`;if(!eventUsage){eventUsage=new Map;context.rulePack.getExtension().eventUsage=eventUsage}if(!eventUsage.has(eventKey)){const eventComponentDef=context.rulePack.getExtension().allComponents.get(componentName);if(eventComponentDef){if(eventComponentDef.hasOwnProperty("events")){Object.keys(eventComponentDef.events).forEach(event=>{eventUsage.set(`${componentName}:${event}`,false)})}}else{console.error(`JETWC Error (jetwc-unused-events): component ${componentName} missing from allComponents map`)}}if(eventUsage.has(eventKey)){eventUsage.set(eventKey,true)}}else{console.warn(`JETWC Warning (jetwc-unused-events): component event ${eventName} cannot be mapped to a component due to missing viewModel mapping`)}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require("path");const Utils=require("../jetwc-lib/component-audit-utils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwc-unused-slots"};ruleDef.prototype.getShortDescription=function(){return"Verify that all declared slots are actually used"};ruleDef.prototype.getDescription=function(){return"This rule checks that any slots declared in the metadata are then actually used via an oj-bind-* in the associated html"};ruleDef.prototype.register=function(context){return{ojtag:this._flagSlotUse,closedownRP:this._doAudit}};ruleDef.prototype._flagSlotUse=function(context){if(context.tag==="oj-bind-template-slot"||context.tag==="oj-bind-slot"){const slotName=context.tagNode.attribs.name?context.tagNode.attribs.name:"__default__";if(slotName&&!Utils.isExpressionString(slotName)){const componentName=Utils.matchComponentPath(context,path.dirname(context.filepath));if(componentName){this._markSlotUsed(context,componentName,slotName)}}}};ruleDef.prototype._doAudit=function(context){const slotUsage=context.rulePack.getExtension().slotUsage;if(slotUsage){slotUsage.forEach(function(value,key){if(!value){const idParts=key.split(":");const componentName=idParts[0];const slotName=idParts[1];if(!Utils.shouldIgnoreCheck(context,"jetwc-unused-slots",componentName,"slots",slotName)){const issue=new context.Issue(`Slot '${slotName?slotName:"default"}' for component ${componentName} does not appear to be bound to the UI`);context.reporter.addIssue(issue,context,"info")}}})}};ruleDef.prototype._markSlotUsed=function(context,componentName,slotName){let slotUsage=context.rulePack.getExtension().slotUsage;const slotKey=`${componentName}:${slotName}`;if(!slotUsage){slotUsage=new Map;context.rulePack.getExtension().slotUsage=slotUsage}if(!slotUsage.has(slotKey)){const slotComponentDef=context.rulePack.getExtension().allComponents.get(componentName);if(slotComponentDef.hasOwnProperty("slots")){Object.keys(slotComponentDef.slots).forEach(slot=>{slotUsage.set(`${componentName}:${slot?slot:"__default__"}`,false)})}}if(slotUsage.has(slotKey)){slotUsage.set(slotKey,true)}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-vb-category'};ruleDef.prototype.getShortDescription=function(){return'Verify the category specified '};ruleDef.prototype.getDescription=function(){return'This rule is configured with your preferred Visual Builder component palette category'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);const ruleOptions=context.rulePack.getRuleOptions();if(ruleOptions.categories&&ruleOptions.categories.length>0){switch(componentType){case'composite':case'vbcs-pattern':if(meta.extension&&meta.extension.catalog&&meta.extension.catalog.category){if(ruleOptions.categories.filter(cat=>cat===meta.extension.catalog.category).length===0){issue=new context.Issue(`Component ${fullName} (${componentType}) has an unexpected palette category set of '${meta.extension.catalog.category}'`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'minor')}}else{issue=new context.Issue(`Component ${fullName} (${componentType}) does not have a palette category set`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'minor')}break;default:break;}}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-vb-icon'};ruleDef.prototype.getShortDescription=function(){return'Verify components have icons for Visual Builder'};ruleDef.prototype.getDescription=function(){return'This rule checks that the correct icon variants are supplied for the visual builder component palette'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;let inRedwood=context.utils.jafLib.getConfig().getTheme().toLowerCase()==='redwood';const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);switch(componentType){case'composite':case'vbcs-pattern':case'vbcs-action':if(!meta.icon){issue=new context.Issue(`Component ${fullName} does not have a Visual Builder icon assigned`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'info')}else{if(!meta.icon.iconPath){issue=new context.Issue(`Component ${fullName} does not have a base Visual Builder icon assigned via iconPath`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'info')}else{this._checkIconLocationAndFormat(context,'iconPath',meta.icon.iconPath,fullName)}if(inRedwood){if(meta.icon.hoverIconPath){this._checkIconLocationAndFormat(context,'hoverIconPath',meta.icon.hoverIconPath,fullName)}if(meta.icon.iconPath&&meta.icon.hoverIconPath&&meta.icon.iconPath!==meta.icon.hoverIconPath){issue=new context.Issue(`Component ${fullName} should use the same icon for the base and hover state in the Visual Builder Redwood component palette`);issue.setMsgKey(context.ruleName+'_9');context.reporter.addIssue(issue,context,'info')}}else{if(!meta.icon.hoverIconPath){issue=new context.Issue(`Component ${fullName} does not have a Visual Builder icon assigned for hover (hoverIconPath)`);issue.setMsgKey(context.ruleName+'_3');context.reporter.addIssue(issue,context,'info')}else{this._checkIconLocationAndFormat(context,'hoverIconPath',meta.icon.hoverIconPath,fullName)}if(meta.icon.iconPath&&meta.icon.hoverIconPath&&meta.icon.iconPath===meta.icon.hoverIconPath){issue=new context.Issue(`Component ${fullName} uses identical icons for the base and hover state in the Visual Builder component palette`);issue.setMsgKey(context.ruleName+'_4');context.reporter.addIssue(issue,context,'info')}}}break;case'vbcs-template':if(!meta.icon||!meta.icon.iconPath){issue=new context.Issue(`Template ${fullName} does not have a Visual Builder icon assigned`);issue.setMsgKey(context.ruleName+'_8');context.reporter.addIssue(issue,context,'info')}break;}}};ruleDef.prototype._checkIconLocationAndFormat=function(context,use,iconFile,componentName){const pathSegs=iconFile.split('/');if(pathSegs[0]!=='extension'){issue=new context.Issue(`Design time ${use} icon ${iconFile} for component ${componentName} should be located under the /extension folder`);issue.setMsgKey(context.ruleName+'_5');context.reporter.addIssue(issue,context,'info')}if(path.extname(iconFile).toLowerCase()!=='.svg'){issue=new context.Issue(`Design time ${use} icon ${iconFile} for component ${componentName} should ideally be in SVG format`);issue.setMsgKey(context.ruleName+'_6');context.reporter.addIssue(issue,context,'info')}if(context.rulePack.getExtension().allComponents.has(componentName)){const componentRoot=context.rulePack.getExtension().allComponents.get(componentName).rootFolder;if(!context.utils.fsUtils.fileExists(path.join(componentRoot,iconFile))){issue=new context.Issue(`Design time ${use} icon ${iconFile} for component ${componentName} does not exist or is outside of the component distribution`);issue.setMsgKey(context.ruleName+'_7');context.reporter.addIssue(issue,context,'major')}}};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-version-openrange'};ruleDef.prototype.getShortDescription=function(){return'Verify that any version ranges for dependencies have an upper bound'};ruleDef.prototype.getDescription=function(){return'This rule checks that the component is not promising to support all future JET versions or unknown future versions of dependent components'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);if(this._hasNoUpper(context,meta.jetVersion)){issue=new context.Issue(`Component ${fullName} specifies a JET Range that has no upper limit '${meta.jetVersion}'`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'major')}if(meta.dependencies){const deps=Object.keys(meta.dependencies);deps.forEach(dependency=>{const checkVersion=meta.dependencies[dependency];if(this._hasNoUpper(context,checkVersion)){issue=new context.Issue(`Component ${fullName} specifies a dependency range for ${dependency} that has no upper limit '${checkVersion}'`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'major')}})}}};ruleDef.prototype._hasNoUpper=function(auditContext,rangeString){let noUpper=false;if(rangeString){if(!auditContext.utils.semVerUtils.isValid(rangeString)&&auditContext.utils.semVerUtils.isValidRange(rangeString)){noUpper=auditContext.utils.semVerUtils.satisfiesRange('99999.0.0',rangeString)}}return noUpper};module.exports=ruleDef;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-writeback-required'};ruleDef.prototype.getShortDescription=function(){return'Verifies that properties are marked with writeback if needed'};ruleDef.prototype.getDescription=function(){return'This rule attempts to match up calls to the setProperty() api, or direct assignments to this.properties, with the properties being addressed and then verifies that they are set to writeback:true. (The properties object should not be used as a private cache for component state)'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAuditOnSetProperty,AssignmentExpression:this._doAuditOnPropertyAssignment,attrexpr:this._doAuditOnPropertyHTMLRef}};ruleDef.prototype._doAuditOnSetProperty=function(context,node){let issue;const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));if(withinComponent&&node.callee.property&&node.callee.property.type==='Identifier'&&node.callee.property.name==='setProperty'){let isStyle=false;if(node.callee.object&&node.callee.object.property&&node.callee.object.property.type==='Identifier'&&node.callee.object.property.name==='style'){isStyle=true}let compRef=false;if(node.callee.object&&node.callee.object.object&&node.callee.object.property&&node.callee.object.property.type==='Identifier'){if(node.callee.object.object.type==='ThisExpression'||node.callee.object.object.type==='Identifier'&&node.callee.object.object.name==='self'){compRef=true}}if(!isStyle&&compRef&&node.arguments&&node.arguments.length===2){if(node.arguments[0].type='Literal'&&node.arguments[0].value){let potentialProperty=node.arguments[0].value;if(potentialProperty.includes('.')){potentialProperty=potentialProperty.split('.')[0]}const componentInfo=Utils.componentInfo(context,withinComponent);if(componentInfo.properties&&componentInfo.properties.hasOwnProperty(potentialProperty)){if(!componentInfo.properties[potentialProperty].hasOwnProperty('writeback')||!componentInfo.properties[potentialProperty].writeback){issue=new context.Issue(`Component '${withinComponent}' makes a call to setProperty() for the property ${potentialProperty} but this is not marked as writeback in the metadata`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'blocker')}}else{this._reportUndclProp(context,withinComponent,potentialProperty)}}}}};ruleDef.prototype._doAuditOnPropertyAssignment=function(context,node){let issue;const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));if(withinComponent&&node.left.type==='MemberExpression'&&node.left.object.type==='MemberExpression'&&node.left.object.property.name==='properties'){const setProperty=this._isContextProperties(node);if(setProperty){const componentInfo=Utils.componentInfo(context,withinComponent);if(componentInfo.properties&&componentInfo.properties.hasOwnProperty(setProperty)){if(!componentInfo.properties[setProperty].hasOwnProperty('writeback')||!componentInfo.properties[setProperty].writeback){issue=new context.Issue(`Component '${withinComponent}' assigns a value to the property ${setProperty} but this is not marked as writeback in the metadata`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'major')}}else{this._reportUndclProp(context,withinComponent,setProperty)}}}};ruleDef.prototype._doAuditOnPropertyHTMLRef=function(context,attribName,attribValue,rawAttribValue){let issue;const withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));if(withinComponent){const parser=/^(?:\{\{\$props\.|\{\{\$properties\.)(.*)(?:\}\})$/;if(attribValue.match(parser)){const expressionParts=attribValue.split(parser);const checkProperty=expressionParts[1];const componentInfo=Utils.componentInfo(context,withinComponent);if(componentInfo.properties&&componentInfo.properties.hasOwnProperty(checkProperty)){if(!componentInfo.properties[checkProperty].hasOwnProperty('writeback')||!componentInfo.properties[checkProperty].writeback){issue=new context.Issue(`Component '${withinComponent}' assigns the property '${checkProperty}' using a read-write binding to the <${context.tag}> attribute '${attribName}', however, the property is not marked as writeback in the metadata`);issue.setMsgKey(context.ruleName+'_3');context.reporter.addIssue(issue,context,'major')}}else{this._reportUndclProp(context,withinComponent,checkProperty)}}}};ruleDef.prototype._reportUndclProp=function(context,component,property){issue=new context.Issue(`Component '${component}' makes a call to setProperty() or cached context.properties for an undeclared property ${property}`);issue.setMsgKey(context.ruleName+'_4');context.reporter.addIssue(issue,context,'blocker')};ruleDef.prototype._isContextProperties=function(node){let assignedProperty;let assignmentChain=Utils.decomposeAssignment(node);const assignmentRoot=assignmentChain.pop();const assignmentSecondary=assignmentChain.pop();if(assignmentRoot==='this'||assignmentRoot==='<parameter>'&&assignmentSecondary==='context'){assignedProperty=assignmentChain[0]}return assignedProperty};module.exports=ruleDef;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
{"jetwc-component-foldername":"0010","jetwc-component-location_1":"0011","jetwc-component-location_2":"0012","jetwc-pack-children_1":"0013","jetwc-pack-children_2":"0014","jetwc-pack-children_3":"0015","jetwc-pack-children_4":"0016","jetwc-packable-components_1":"0017","jetwc-packable-components_2":"0018","jetwc-packable-components_3":"0019","jetwc-component-dependencies_1":"0021","jetwc-component-dependencies_2":"0022","jetwc-component-dependencies_3":"0023","jetwc-component-dependencies_4":"0024","jetwc-component-dependencies_5":"0025","jetwc-prerelease-version":"0026","jetwc-prerelease-dependencies":"0027","jetwc-namespace":"0029","jetwc-vb-category_1":"0030","jetwc-vb-category_2":"0031","jetwc-jet-version_1":"0033","jetwc-jet-version_2":"0034","jetwc-absolute-jetversion":"0035","jetwc-semantic-version":"0040","jetwc-standard-files":"0041","jetwc-loader-file_1":"0045","jetwc-loader-file_2":"0046","jetwc-loader-file_3":"0047","jetwc-version-openrange_1":"0048","jetwc-version-openrange_2":"0049","jetwc-displayname_1":"0050","jetwc-displayname_2":"0051","jetwc-nls-root":"0052","jetwc-require-paths":"0053","jetwc-vb-icon_1":"0054","jetwc-vb-icon_2":"0055","jetwc-vb-icon_3":"0056","jetwc-vb-icon_4":"0057","jetwc-vb-icon_5":"0058","jetwc-vb-icon_6":"0059","jetwc-vb-icon_7":"0060","jetwc-vb-icon_8":"0061","jetwc-template-slots_1":"0062","jetwc-template-slots_2":"0063","jetwc-template-slots_3":"0064","jetwc-template-slots_4":"0065","jetwc-template-slots_5":"0066","jetwc-slots_1":"0067","jetwc-slots_2":"0068","jetwc-events_1":"0069","jetwc-events_2":"0070","jetwc-property-nesting":"0071","jetwc-nls-languages_1":"0072","jetwc-nls-languages_2":"0073","jetwc-nls-languages_3":"0074","jetwc-nls-languages_4":"0075","jetwc-event-displayname":"0076","jetwc-methods_1":"0077","jetwc-methods_2":"0078","jetwc-property-changed":"0079","jetwc-writeback-required_1":"0080","jetwc-writeback-required_2":"0081","jetwc-writeback-required_3":"0082","jetwc-writeback-required_4":"0083","jetwc-oj-register":"0084","jetwc-register-with-promises":"0085","jetwc-register-css":"0086","jetwc-deprecated-lifecycle":"0087","jetwc-aria-redefinition":"0088","jetwc-public-modules_1":"0089","jetwc-public-modules_2":"0090","jetwc-disabled-property":"0091","jetwc-reserved-property":"0092","jetwc-prerelease-pattern":"0093","jetwc-ojcss":"0094","jetwc-vb-icon_9":"0095","jetwc-component-location_3":"0096","jetwc-dynamic-slot-context":"0097","jetwc-dynamic-slots-naming":"0098","jetwc-unused-slots":"0099","jetwc-unused-events":"0100","jetwc-compjson-bp-obj":"0101","jetwc-compjson-bp-ar":"0102","jetwc-method-displayname":"0103","jetwc-slot-displayname":"0104","jetwc-component-displayname":"0105","jetwc-property-displayname":"0106","jetwc-data-property-prefix":"0107","jetwc-schema":"0108","jetwc-component-type":"0109","jetwc-subproperty-writeback":"0111","jetwc-nested-defaults":"0112","jetwc-required-subproperty":"0113"}
|