@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
package/meta/metaverlist.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"metaList":{"6.0.0":{"version":"6.0.1","date":"Friday Jul 12, 2019","time":"10:58am pdt"},"5.2.0":{"version":"5.2.3","date":"Friday Jul 12, 2019","time":"10:55am pdt"},"6.1.0":{"version":"6.1.3","date":"Friday Jul 12, 2019","time":"11:00am pdt"},"6.2.0":{"version":"6.2.2","date":"Friday Jul 12, 2019","time":"11:02am pdt"},"7.0.0":{"version":"7.0.1","date":"Friday Jul 12, 2019","time":"11:04am pdt"},"7.1.0":{"version":"7.1.0","date":"Friday Jul 12, 2019","time":"11:06am pdt"},"7.2.0":{"version":"7.2.0","date":"Sunday Feb 16, 2020","time":"10:13pm est"},"7.3.0":{"version":"7.3.0","date":"Tuesday May 05, 2020","time":"12:50am edt"},"8.0.0":{"version":"8.0.0","date":"Sunday Feb 16, 2020","time":"10:51pm est"},"8.1.0":{"version":"8.1.0","date":"Sunday Feb 16, 2020","time":"10:20pm est"},"8.2.0":{"version":"8.2.0","date":"Friday Apr 17, 2020","time":"1:08am utc"},"8.3.0":{"version":"8.3.0","date":"Monday May 04, 2020","time":"4:34pm edt"},"9.0.0":{"version":"9.0.0","date":"Friday Jun 12, 2020","time":"1:57am utc"},"9.1.0":{"version":"9.1.0","date":"Thursday Aug 06, 2020","time":"2:13am utc"},"9.2.0":{"version":"9.2.0","date":"Wednesday Oct 07, 2020","time":"5:41pm utc"},"10.0.0":{"version":"10.0.0","date":"Thursday Jan 07, 2021","time":"9:20pm utc"}}}
|
|
1
|
+
{"metaList":{"6.0.0":{"version":"6.0.1","date":"Friday Jul 12, 2019","time":"10:58am pdt"},"5.2.0":{"version":"5.2.3","date":"Friday Jul 12, 2019","time":"10:55am pdt"},"6.1.0":{"version":"6.1.3","date":"Friday Jul 12, 2019","time":"11:00am pdt"},"6.2.0":{"version":"6.2.2","date":"Friday Jul 12, 2019","time":"11:02am pdt"},"7.0.0":{"version":"7.0.1","date":"Friday Jul 12, 2019","time":"11:04am pdt"},"7.1.0":{"version":"7.1.0","date":"Friday Jul 12, 2019","time":"11:06am pdt"},"7.2.0":{"version":"7.2.0","date":"Sunday Feb 16, 2020","time":"10:13pm est"},"7.3.0":{"version":"7.3.0","date":"Tuesday May 05, 2020","time":"12:50am edt"},"8.0.0":{"version":"8.0.0","date":"Sunday Feb 16, 2020","time":"10:51pm est"},"8.1.0":{"version":"8.1.0","date":"Sunday Feb 16, 2020","time":"10:20pm est"},"8.2.0":{"version":"8.2.0","date":"Friday Apr 17, 2020","time":"1:08am utc"},"8.3.0":{"version":"8.3.0","date":"Monday May 04, 2020","time":"4:34pm edt"},"9.0.0":{"version":"9.0.0","date":"Friday Jun 12, 2020","time":"1:57am utc"},"9.1.0":{"version":"9.1.0","date":"Thursday Aug 06, 2020","time":"2:13am utc"},"9.2.0":{"version":"9.2.0","date":"Wednesday Oct 07, 2020","time":"5:41pm utc"},"10.0.0":{"version":"10.0.0","date":"Thursday Jan 07, 2021","time":"9:20pm utc"},"10.1.0":{"version":"10.1.0","date":"Saturday Apr 17, 2021","time":"4:01pm utc"},"11.0.0":{"version":"11.0.0","date":"Friday Jul 02, 2021","time":"3:02am utc"},"11.1.0":{"version":"11.1.3","date":"Friday Dec 10, 2021","time":"9:56pm utc"}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oracle/oraclejet-audit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.1.3",
|
|
4
4
|
"description": "JET AUDIT FRAMEWORK",
|
|
5
5
|
"main": "jaf.js",
|
|
6
6
|
"files": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"lint"
|
|
40
40
|
],
|
|
41
41
|
"Jaf": {
|
|
42
|
-
"version": "2.
|
|
42
|
+
"version": "2.15.12"
|
|
43
43
|
},
|
|
44
44
|
"license": "UPL-1.0",
|
|
45
45
|
"dependencies": {
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"css-tree": "1.0.0-alpha.39",
|
|
50
50
|
"decache": "4.6.0",
|
|
51
51
|
"espree": "7.3.1",
|
|
52
|
-
"estraverse": "5.2.0",
|
|
53
52
|
"glob": "7.1.6",
|
|
54
53
|
"htmlparser2": "3.10.1",
|
|
55
54
|
"md5": "2.3.0",
|
|
@@ -1 +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
|
+
*/
|
|
1
6
|
const RULE_NAME="csp-html-script-unsafe-inline";const LONG_DESCRIPT="CSP-1020:<br>"+"Inline script blocks are considered to be CSP violation. The general solution is to use hashes or a nonce to allow inline scripts to run."+"<p>CSP-1021:<br>"+"The execution of a JS event handler from inline HTML markup is a CSP violation. e.g. onclick onload onmouseover onsubmit, etc.<p>"+"The general solution is to use <b>addEventListener()</b>. e.g.<p>"+" <b><button id=\"btn\" <b>onclick='doSomething()'></b><p>"+"can be replaced with<p>"+" document.getElementById(\"btn\")<b>.addEventListener('click', doSomething)</b>";const SHORT_DESCRIPT=LONG_DESCRIPT;const TYPE="type";const MIME_TEXT_HTML="text/html";const NONCE="nonce";const SRC="src";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){return{"script":_fnScript,"tag":_fnElem}};function _fnScript(context){var o,a,issue;o=context.tagNode.attribs;for(a in o){if(a===SRC||a===NONCE||a===TYPE&&o[a]===MIME_TEXT_HTML){return}}issue=new context.Issue("inline <script> 'nonce' attribute required - CSP violation");issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)};function _fnElem(context,elem){var node,attribs,attrib,issue,attrPos;node=context.node;if(!node||!node.attribs){return}attribs=node.attribs;for(attrib in attribs){if(!attrib.startsWith(":")&&attrib.startsWith("on")&&!attrib.startsWith("on-")){if(context.utils.DomUtils.isCommonEventAttr(attrib)){issue=new context.Issue("inline event handler '"+attrib+"' - CSP violation");attrPos=context.utils.DomUtils.getAttrPosition(context.data,context.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +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
|
+
*/
|
|
1
6
|
const RULE_NAME="csp-html-style-unsafe-inline";const LONG_DESCRIPT="<b>CSP-1030:</b><br>"+"Embedding styles into HTML using <style> tags is a CSP violation.<br>"+"For example, the following implementation will be blocked:<p>"+"<b><style><br>"+" #inline-style { background: red }<br>"+"</style></b><p>"+"The general solution is to extract the styles into a style sheet and reference it in the HTML using <b><link href=\". . .\"></b>"+"<b><p>CSP-1031:</b><br>"+"Setting a style attribute directly on element, e.g.<b><div style=\". . .\"></b> is a CSP violation.<p>"+"The general solution is to set properties directly on the element's style property, e.g.<br><b>element.style.display = \"none\"</b><p>"+"Alternatively, styles can be added by changing to a class and including the class in the HTML element.";const SHORT_DESCRIPT=LONG_DESCRIPT;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){return{"tag":_fnTag,"ojtag":_fnTag}};function _fnTag(context,tag){var attrs,attr,nonce,issue;if(tag==="style"){attrs=context.tagNode.attribs;if(attrs){for(attr in attrs){if(attr==="nonce"){nonce=true;break}}}if(!nonce){issue=new context.Issue("inline <style> element : 'nonce' not specified - CSP violation");issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}}_checkAttrs(context,tag);if(attrs){for(attr in attrs){if(attr==="nonce"){nonce=true;break}}}}function _checkAttrs(context,tag){var attrs,attr,issue,attrPos;attrs=context.tagNode.attribs;if(attrs){for(attr in attrs){if(attr==="style"){issue=new context.Issue("inline 'style' attribute on <"+tag+"> - CSP violation");attrPos=context.utils.DomUtils.getAttrPosition(context.data,context.node,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +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
|
+
*/
|
|
1
6
|
var exprEval;const RULE_NAME="csp-html-unsafe-expr";const LONG_DESCRIPT="Attribute contains an expression that violates the Content Security Policy, and is not supported. Execution of the attribute's expression will be blocked.";const SHORT_DESCRIPT="Expressions of this format are unsupported if the content_security_policy does not have an exception for unsafe eval";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){if(regCtx.runMode==="api"&®Ctx.VsCodeExtHint){if(exprEval){regCtx.decache(exprEval)}}exprEval=require("../../libext/expparser");exprEval=new exprEval;return{"attrexpr":_handle}};function _handle(context,attrName,attrValue){var p,issue,msg;attrValue=attrValue.trim();if(attrName.charAt(0)===":"){attrName=attrName.substring(1)}attrValue=attrValue.substring(2,attrValue.length-2);try{p=exprEval.parse(attrValue)}catch(e){msg=_cleanUp(e.message);issue=new context.Issue("Attribute '"+attrName+"' contains an expression that may not be compatible with all Content Security policies: "+msg);context.reporter.addIssue(issue,context)}};function _cleanUp(msg){msg=msg.replace("character","attribute value position");return msg}module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -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 RULE_NAME="csp-js-script-unsafe-eval";const LONG_DESCRIPT="CSP-1000:<br>Dynamically evaluated code is a security risk. "+"<b>eval()</b> executes the code it is passed with the privileges of the caller. If you run eval() with a string "+"that could be compromised by a malicious party, you may end up running malicious code on a user machine "+"with the permissions of your webpage/extension.<p>"+"CSP-1001:<br>A dynamically evaluated \"Function\" poses a security risk by allowing arbitrary JS execution "+"that can contain untrusted data. Strings passed to Function() may be constructed from user-provided or compromised "+"data. The data could thus contain arbitrary code supplied by an attacker, and used to inject content into the DOM.<p>"+"CSP-1002:<br>Using a string as the first argument to functions such as <b>setTimeout/setInterval</b> poses a security risk "+"by allowing arbitrary JS execution of untrusted data. Variants of the API that take a function as the first argument are permitted. "+"Where possible, remove the argument's delimiting quotes in calls such as<p>"+" <b>setTimeout(STRING, delay)</b><p>"+"and wrap the content in a function e.g.<p>"+" <b>(setTimeout(function() { CODE }, delay) )</b><p>"+"When this is not possible, the code can be wrapped in a function and served in a .js file.";const SHORT_DESCRIPT=LONG_DESCRIPT;const FUNC_EXPR="FunctionExpression";const ARROW_FUNC_EXPR="ArrowFunctionExpression";const IDENTIFIER="Identifier";const LITERAL="Literal";const BLOCK_STMT="BlockStatement";const CALL_EXPR="CallExpression";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{CallExpression:_fn,NewExpression:_fn}};function _fn(context,node){_checkEval(context,node);_checkFunction(context,node);_checkTimer(context,node)};function _checkEval(context,node){var callee,obj,issue;if(node.callee){callee=node.callee;obj=callee.property?callee.property:callee;if(obj.name==="eval"){if(!callee.object){issue=new context.Issue("eval() found - CSP violation");issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}}}};function _checkFunction(context,node){var obj,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;if(obj.type===IDENTIFIER&&obj.name==="Function"){issue=new context.Issue("Use of Function() - CSP violation");issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}};function _checkTimer(context,node){var obj,funcName,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;funcName=obj.name;if(funcName==="setTimeout"||funcName==="setInterval"){issue=_checkTimerFuncs(context,node,funcName);if(issue){issue.setMsgKey(context.ruleName+"_3");context.reporter.addIssue(issue,context)}}}};function _checkTimerFuncs(context,node,funcName){var obj,callee,args,arg,issue;callee=node.callee;obj=callee.property?callee.property:callee;if(obj.type===IDENTIFIER){if(node.arguments){args=node.arguments;if(args.length>=1){arg=args[0];if(arg.type!==FUNC_EXPR&&arg.type!==ARROW_FUNC_EXPR){if(arg.type!==CALL_EXPR&&arg.type!="NewExpression"){if(arg.type===LITERAL||_isIdentAString(node,arg.name)){issue=new context.Issue("function "+funcName+"() - first argument CSP violation")}}}}}}return issue};function _isIdentAString(node,ident){var n,decls,decl,i,j,s,isFunc=false;node=node.parent;while(node){if(!node){break}if(node.type!==BLOCK_STMT){if(node.type!=="Program"){node=node.parent;continue}for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="FunctionDeclaration"){if(n.id&&n.id.type===IDENTIFIER&&n.id.name===ident){return false}}}}if(node.body){for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="VariableDeclaration"){decls=n.declarations;if(decls&&decls.length){for(j=0;j<decls.length;j++){decl=decls[j];if(decl.type==="VariableDeclarator"){if(decl.id&&decl.id.type===IDENTIFIER&&decl.id.name===ident){if(decl.init){if(decl.init.type===LITERAL){s=decl.init.raw.charAt(0);if(s==="\""||s==="'"){return true}}}return false}}}}}}}node=node.parent}return false};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +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
|
+
*/
|
|
1
6
|
const RULE_NAME="csp-js-style-unsafe-inline";const LONG_DESCRIPT="Styles applied in JavaScript by setting the style attribute directly using setAttribute() are a CSP violation. "+"Style properties that are set directly on an element's style property permit safe style manipulation in JavaScript. e.g. in place of<p>"+" elem<b>.setAttribute</b>('style', 'background-color : red;')<p>"+"use<p>"+" elem<b>.style</b>.backgroundColor = 'red';";const SHORT_DESCRIPT=LONG_DESCRIPT;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){return{CallExpression:_fnCall}};function _fnCall(context,node){var callee,meth,args,arg,issue;callee=node.callee;if(callee.property&&callee.property.type==="Identifier"){meth=callee.property.name;if(meth==="setAttribute"||meth==="attr"){args=node.arguments;if(meth==="attr"&&args.length<2){return}arg=args[0];if(arg.type==="Literal"&&arg.value==="style"){if(meth==="setAttribute"||_isKO(node)){issue=new context.Issue("setAttribute('style') - CSP violation");context.reporter.addIssue(issue,context)}}}}};function _isKO(node){var callee=node.callee;var o=callee.object;return o&&o.callee&&o.callee.type==="Identifier"&&o.callee.name==="$"}module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -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 RULE_NAME="csp-ts-script-unsafe-eval";const LONG_DESCRIPT="CSP-1000:<br>Dynamically evaluated code is a security risk. "+"<b>eval()</b> executes the code it is passed with the privileges of the caller. If you run eval() with a string "+"that could be compromised by a malicious party, you may end up running malicious code on a user machine "+"with the permissions of your webpage/extension.<p>"+"CSP-1001:<br>A dynamically evaluated \"Function\" poses a security risk by allowing arbitrary JS execution "+"that can contain untrusted data. Strings passed to Function() may be constructed from user-provided or compromised "+"data. The data could thus contain arbitrary code supplied by an attacker, and used to inject content into the DOM.<p>"+"CSP-1002:<br>Using a string as the first argument to functions such as <b>setTimeout/setInterval</b> poses a security risk "+"by allowing arbitrary JS execution of untrusted data. Variants of the API that take a function as the first argument are permitted. "+"Where possible, remove the argument's delimiting quotes in calls such as<p>"+" <b>setTimeout(STRING, delay)</b><p>"+"and wrap the content in a function e.g.<p>"+" <b>(setTimeout(function() { CODE }, delay) )</b><p>"+"When this is not possible, the code can be wrapped in a function and served in a .js file.";const SHORT_DESCRIPT=LONG_DESCRIPT;const FUNC_EXPR="FunctionExpression";const ARROW_FUNC_EXPR="ArrowFunctionExpression";const IDENTIFIER="Identifier";const LITERAL="Literal";const BLOCK_STMT="BlockStatement";const CALL_EXPR="CallExpression";var _scopes;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{CallExpression:_fn,NewExpression:_fn,endfile:_onEndFile}};function _fn(ruleCtx,node){_checkEval(ruleCtx,node);_checkFunction(ruleCtx,node);_checkTimer(ruleCtx,node)};function _checkEval(ruleCtx,node){var callee,obj,issue;if(node.callee){callee=node.callee;obj=callee.property?callee.property:callee;if(obj.name==="eval"){if(!callee.object){issue=new ruleCtx.Issue("eval() found - CSP violation");issue.setMsgKey(ruleCtx.ruleName+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _checkFunction(ruleCtx,node){var obj,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;if(obj.type===IDENTIFIER&&obj.name==="Function"){issue=new ruleCtx.Issue("Use of Function() - CSP violation");issue.setPosition(null,null,obj.range[0],obj.range[1]);issue.setMsgKey(ruleCtx.ruleName+"_2");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _checkTimer(ruleCtx,node){var obj,funcName,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;funcName=obj.name;if(funcName==="setTimeout"||funcName==="setInterval"){issue=_checkTimerFuncs(ruleCtx,node,funcName);if(issue){issue.setMsgKey(ruleCtx.ruleName+"_3");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _onEndFile(){_scopes=null};function _checkTimerFuncs(ruleCtx,node,funcName){var obj,callee,args,arg,issue;callee=node.callee;obj=callee.property?callee.property:callee;if(obj.type===IDENTIFIER){if(node.arguments){args=node.arguments;if(args.length>=1){arg=args[0];if(arg.type!==FUNC_EXPR&&arg.type!==ARROW_FUNC_EXPR){if(arg.type!==CALL_EXPR&&arg.type!="NewExpression"){if(arg.type===IDENTIFIER){if(!this._scopes){_scopes=ruleCtx.utils.AstUtils.getScopes()}if(_scopes.getVarType(arg)==="TSStringType"){issue=true}}else if(arg.type===LITERAL||_isIdentAString(node,arg.name)){issue=true}if(issue){issue=new ruleCtx.Issue("function "+funcName+"() - first argument CSP violation")}}}}}}return issue};function _isIdentAString(node,ident){var n,decls,decl,i,j,s,isFunc=false;node=node.parent;while(node){if(!node){break}if(node.type!==BLOCK_STMT){if(node.type!=="Program"){node=node.parent;continue}for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="FunctionDeclaration"){if(n.id&&n.id.type===IDENTIFIER&&n.id.name===ident){return false}}}}if(node.body){for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="VariableDeclaration"){decls=n.declarations;if(decls&&decls.length){for(j=0;j<decls.length;j++){decl=decls[j];if(decl.type==="VariableDeclarator"){if(decl.id&&decl.id.type===IDENTIFIER&&decl.id.name===ident){if(decl.init){if(decl.init.type===LITERAL){s=decl.init.raw.charAt(0);if(s==="\""||s==="'"){return true}}}return false}}}}}}}node=node.parent}return false};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -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 RULE_NAME="csp-ts-style-unsafe-inline";const LONG_DESCRIPT="Styles applied in JavaScript by setting the style attribute directly using setAttribute() are a CSP violation. "+"Style properties that are set directly on an element's style property permit safe style manipulation in JavaScript. e.g. in place of<p>"+" elem<b>.setAttribute</b>('style', 'background-color : red;')<p>"+"use<p>"+" elem<b>.style</b>.backgroundColor = 'red';";const SHORT_DESCRIPT=LONG_DESCRIPT;var _scopes;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{CallExpression:_fnCall}};function _fnCall(ruleCtx,node){var callee,meth,args,arg,issue;callee=node.callee;if(callee.property&&callee.property.type==="Identifier"){meth=callee.property.name;if(meth==="setAttribute"||meth==="attr"){args=node.arguments;if(meth==="attr"&&args.length<2){return}arg=args[0];if(arg.value==="style"){if(arg.type==="Literal"){if(meth==="setAttribute"||_isKO(node)){issue=true}}}if(issue){issue=new ruleCtx.Issue("setAttribute('style') - CSP violation");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _isKO(node){var callee=node.callee;var o=callee.object;return o&&o.callee&&o.callee.type==="Identifier"&&o.callee.name==="$"};module.exports={getName,getDescription,getShortDescription,register};
|
package/rulepacks/csp/msgid.json
CHANGED
|
@@ -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
|
+
{"csp-js-script-unsafe-eval_1":"1000","csp-js-script-unsafe-eval_2":"1001","csp-js-script-unsafe-eval_3":"1002","csp-js-style-unsafe-inline":"1010","csp-html-script-unsafe-inline_1":"1020","csp-html-script-unsafe-inline_2":"1021","csp-html-style-unsafe-inline_1":"1030","csp-html-style-unsafe-inline_2":"1031","csp-html-unsafe-expr":"1040","csp-ts-script-unsafe-eval_1":"1100","csp-ts-script-unsafe-eval_2":"1101","csp-ts-script-unsafe-eval_3":"1102","csp-ts-style-unsafe-inline":"1110"}
|
package/rulepacks/csp/rules.json
CHANGED
|
@@ -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
|
+
{"title":"CSP Builtin Rulepack","version":"1.1.0","prefix":"CSP","rules":{"csp-js-script-unsafe-eval":{"severity":"major","filetype":"js","group":["jet-js","jet-html","jet-csp"],"status":"production"},"csp-ts-script-unsafe-eval":{"severity":"major","filetype":["ts","tsx"],"group":["jet-ts","jet-tsx","jet-csp"],"amd":false,"status":"production"},"csp-html-script-unsafe-inline":{"severity":"major","filetype":"html","group":["jet-html","jet-csp"],"status":"production"},"csp-html-style-unsafe-inline":{"severity":"major","filetype":"html","group":["jet-html","jet-csp"],"status":"production"},"csp-js-style-unsafe-inline":{"severity":"major","filetype":"js","group":["jet-js","jet-html","jet-csp"],"status":"production"},"csp-ts-style-unsafe-inline":{"severity":"major","filetype":["ts","tsx"],"group":["jet-js","jet-tsx","jet-csp"],"amd":false,"status":"production"},"csp-html-unsafe-expr":{"severity":"blocker","filetype":"html","group":["jet-html","jet-csp"],"status":"production"}}}
|
|
@@ -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-absolute-jetversion'};ruleDef.prototype.getShortDescription=function(){return'Verify support for some range of JET versions'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not be hard-wired to a specific version of JET - e.g. specifies some form of range at least'};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(context.suppData.obj.jetVersion){if(context.utils.semVerUtils.isValid(meta.jetVersion)){issue=new context.Issue(`Component ${fullName} is hardwired to a specific JET version (${meta.jetVersion}), not a range`);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-aria-redefinition'};ruleDef.prototype.getShortDescription=function(){return'Ensure that the component does not re-define any WAI-ARIA properties'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not overridden or tries to introduce (any custom) WAI-ARIA attributes'};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 ariaDetect=/^aria[A-Z\-].*$/;Object.keys(meta.properties).forEach(propName=>{if(ariaDetect.test(propName)){issue=new context.Issue(`Component ${fullName} defines a WAI-ARIA property ${propName} which is not allowed`);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-bootstrap'};ruleDef.prototype.getShortDescription=function(){return'Bootstrap processing for the JETWC rulset'};ruleDef.prototype.getDescription=function(){return'This rule is for internal use by the ruleset and should not be disabled'};ruleDef.prototype.register=function(context){this.componentRoots=context.config.components;this.auditBase=context.config.base;return{startupRP:this._getAllVisibleComponents,closedownRP:this._reportDiagnostics}};ruleDef.prototype._getAllVisibleComponents=function(context){console.info(`${context.rulePack.getPackInfo().prefix} : ${context.rulePack.getPackInfo().version}`);let masterComponentList=[];const projectPathInfo=Utils.getKeyPathInfoForRulepack(context,this.auditBase);if(projectPathInfo.exchangeCacheFolder){masterComponentList=masterComponentList.concat(this._getComponents(projectPathInfo.exchangeCacheFolder,false,false,context))}if(this.componentRoots&&this.componentRoots.length>0){this.componentRoots.forEach(root=>{masterComponentList=masterComponentList.concat(this._getComponents(root,true,projectPathInfo.isBuiltOutput,context))})}else{masterComponentList=masterComponentList.concat(this._getComponents(projectPathInfo.jsSource,true,projectPathInfo.isBuiltOutput,context));if(projectPathInfo.tsSource){masterComponentList=masterComponentList.concat(this._getComponents(projectPathInfo.tsSource,true,false,context))}}const componentRootFolder=context.rulePack.getRuleOptions().componentRoot||projectPathInfo.componentRootFolder;const allComponentsMap=masterComponentList.reduce((wmap,component)=>{if(!projectPathInfo.isBuiltOutput||projectPathInfo.isBuiltOutput&&!wmap.has(component.fullName)){wmap.set(component.fullName,component)}return wmap},new Map);const referenceComponents=new Map;const componentPaths=new Map;allComponentsMap.forEach(component=>{component.language=Utils.detectComponentSourceType(context,component.rootFolder);switch(component.type){case'reference':referenceComponents.set(component.fullName,component.ba);break;case'composite':case'resource':if(component.local){if(component.dependencies){Object.values(component.dependencies).forEach(dependencyName=>{if(allComponentsMap.has(dependencyName)){const proxyPaths=allComponentsMap.get(dependencyName).requirePaths;proxyPaths.forEach(path=>{component.requirePaths.add(path)})}})}componentPaths.set(component.rootFolder,component.fullName)}break;}});context.rulePack.setExtension({rulepackVersion:context.rulePack.getPackInfo().version,bootStrap:true,platform:Utils.isWindows?'Windows':'Unix-like',componentHome:`/${componentRootFolder}/`,auditBuildOutput:projectPathInfo.isBuiltOutput,discoveredPaths:projectPathInfo,componentRoots:this.componentRoots,allReferenceComponents:referenceComponents,allComponents:allComponentsMap,auditableComponentPaths:componentPaths,allAuditableFilePaths:new Map})};ruleDef.prototype._getComponents=function(rootDir,isLocal,builtOutput,auditContext){let componentArray=[];if(auditContext.utils.fsUtils.pathExistsSync(rootDir)){const compFileStructure=auditContext.utils.fsUtils.readDir(rootDir);compFileStructure.forEach(l1file=>{let componentInfo;if(!l1file.isFile&&l1file.files.length>0){l1file.files.forEach(l2file=>{if(!builtOutput){if(l2file.isFile&&l2file.name==='component.json'){componentInfo=Utils.extractComponentInfoFromJSONFile(auditContext,path.join(rootDir,l1file.name),'component.json',isLocal);componentArray.push(componentInfo);if(componentInfo.type==='pack'){const packMembers=this._getComponents(Utils.toJAFPath(path.join(rootDir,l1file.name)),isLocal,false,auditContext);componentArray=componentArray.concat(packMembers)}}}else{if(!l2file.isFile&&l2file.files.length>0){l2file.files.forEach(l3file=>{if(l3file.isFile&&l3file.name==='component.json'){componentInfo=Utils.extractComponentInfoFromJSONFile(auditContext,path.join(rootDir,l1file.name,l2file.name),'component.json',isLocal);if(!componentInfo.pack){componentArray.push(componentInfo);if(componentInfo.type==='pack'){const packMembers=this._getComponents(Utils.toJAFPath(path.join(rootDir,l1file.name,l2file.name)),isLocal,false,auditContext);componentArray=componentArray.concat(packMembers)}}}})}}})}else{if(l1file.isFile&&l1file.name==='component.json'){componentInfo=Utils.extractComponentInfoFromJSONFile(auditContext,rootDir,'component.json',isLocal);if(componentInfo.type!=='pack'){componentArray.push(componentInfo)}if(componentInfo.pack){console.warn(`Warning: It is recommended that your components list is configured with the pack root rather than individual pack members. This will ensure that the entire pack will be processed correctly (${rootDir})`)}}}})}return componentArray};ruleDef.prototype._reportDiagnostics=function(context){const opts=context.rulePack.getRuleOptions();const diagnostics=context.rulePack.getExtension();if(!opts.testMode){let foundVMMapping=0;let candidateLocal=0;diagnostics.allComponents.forEach((component,compName)=>{if(component.local&&component.type==='composite'){candidateLocal++;if(component.viewModel&&component.viewModel.resolved){foundVMMapping++}}});if(foundVMMapping!==candidateLocal){console.error(`Error: Audit was only able to map ${foundVMMapping} out of ${candidateLocal} components to their viewModels. Some audits will be unable to operate.`)}}if(opts.debug&&opts.diagnosticFile){console.log(`Writing JETWC diagnostics to ${opts.diagnosticFile}.json`);const dFile=Utils.toJAFPath(path.join(path.resolve('.'),opts.diagnosticFile+'.json'));context.utils.fsUtils.writeJsonSync(diagnostics,dFile,{spaces:2,replacer:Utils.diagnosticReplacer})}};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 helperPos=require('../../rules/jet/helpers/json-propname-pos');const helperProp=require('../../rules/jet/helpers/bp-checkPropType');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-compjson-bp-ar'};ruleDef.prototype.getShortDescription=function(){return'Web component component.json metadata should follow best practices and avoid plain \'array\' type properties'};ruleDef.prototype.getDescription=function(){return'For best practices, web components should avoid use of unqualified property type \'array\', and provide a more complete definition of the API using a closure type definition'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-ar','JET')){return false}else{return{compjson:this._doAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const componentName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){const properties=meta.properties;if(properties){const arrayProps=helperProp(properties,'a');if(arrayProps){for(let i=0;i<arrayProps.length;i++){const checkProperty=arrayProps[i];const checkPropertyType=Utils.getPropertyAttributeFromPath(context,componentName,checkProperty,'type');if(checkPropertyType.toLowerCase()==='array'){if(!Utils.shouldIgnoreCheck(context,'jetwc-compjson-bp-ar',componentName,'properties',checkProperty)){const issue=new context.Issue(`property '${checkProperty}' is defined with unqualified type 'array'. Provide a more complete API definition using a closure type definition.`);const pos=helperPos(context,checkProperty);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);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 helperPos=require('../../rules/jet/helpers/json-propname-pos');const helperProp=require('../../rules/jet/helpers/bp-checkPropType');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-compjson-bp-obj'};ruleDef.prototype.getShortDescription=function(){return'Web component component.json metadata should follow best practices and avoid \'object\' type properties'};ruleDef.prototype.getDescription=function(){return'For best practices, web components should avoid use of the property type \'object\' without sub-properties, and provide a more complete definition of the API either using sub-properties or using a closure type definition'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-obj','JET')){return false}else{return{compjson:this._doAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const componentName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){const properties=meta.properties;if(properties){const objectProps=helperProp(properties,'o');if(objectProps){for(let i=0;i<objectProps.length;i++){const checkProperty=objectProps[i];if(!this._hasSub_properties(properties,checkProperty)){if(!Utils.shouldIgnoreCheck(context,'jetwc-compjson-bp-obj',componentName,'properties',checkProperty)){const issue=new context.Issue(`property '${checkProperty}' of type 'object' has no sub-properties. Provide a more complete API definition using sub-properties or a closure type definition`);const pos=helperPos(context,checkProperty);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);context.reporter.addIssue(issue,context,'info')}}}}}}}};ruleDef.prototype._hasSub_properties=function(props,prop){var subprop,a,i;if(!prop.includes('.')){return!!props[prop].properties}a=prop.split('.');for(i=0;i<a.length;i++){subprop=props[a[i]];if(subprop&&subprop.properties){if(a.length-1===i){return true}props=subprop.properties;continue}break}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-component-dependencies'};ruleDef.prototype.getShortDescription=function(){return'Validate the stated dependencies for a component'};ruleDef.prototype.getDescription=function(){return'This rule checks that any dependencies defined for a component actually exist in the context of the project and are correct'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('allComponents')){const componentMetadata=context.suppData.obj;const componentType=Utils.getComponentType(componentMetadata);const allVisibleComponents=context.rulePack.getExtension().allComponents;if(componentMetadata){let issue;if(componentMetadata.dependencies){Object.keys(componentMetadata.dependencies).forEach(dependency=>{const dependentVersion=componentMetadata.dependencies[dependency];if(componentType==='pack'){if(!context.utils.semVerUtils.isValid(dependentVersion)){issue=new context.Issue(`Pack dependency '${dependency}':'${componentMetadata.dependencies[dependency]}' in ${componentMetadata.name} must be an absolute semver version not a range`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'blocker')}}else{if(!context.utils.semVerUtils.isValidRange(dependentVersion)){issue=new context.Issue(`Component dependency '${dependency}':'${componentMetadata.dependencies[dependency]}' in ${componentMetadata.name} is not a valid semver or semver range`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'blocker')}else{if(componentMetadata.type&&componentMetadata.type==='demo'&&context.utils.semVerUtils.isValid(dependentVersion)){issue=new context.Issue(`Demo component ${componentMetadata.name} depends on an absolute version of '${dependency}':'${componentMetadata.dependencies[dependency]}', range support is preferred for demos`);issue.setMsgKey(context.ruleName+'_3');context.reporter.addIssue(issue,context,'info')}}}if(!issue){if(!allVisibleComponents.has(dependency)){issue=new context.Issue(`Component dependency '${dependency}':'${componentMetadata.dependencies[dependency]}' in '${componentMetadata.name}' has no match in the project`);issue.setMsgKey(context.ruleName+'_4');context.reporter.addIssue(issue,context,'blocker')}else{const availableVersion=allVisibleComponents.get(dependency).version;if(!context.utils.semVerUtils.satisfiesRange(availableVersion,dependentVersion)){issue=new context.Issue(`Component dependency '${dependency}' in '${componentMetadata.name}' exists in the project but the versions are mismatched. Requested:'${dependentVersion}', version available in project: '${availableVersion}'`);issue.setMsgKey(context.ruleName+'_5');context.reporter.addIssue(issue,context,'blocker')}}}})}}}else{Utils.reportMissingBootstrapInfo(context,'allComponents')}};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-component-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component has display name defined'};ruleDef.prototype.getDescription=function(){return'This rule checks that the component has a display name supplied to make the user experience in Visual Builder and Exchange 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;if(!meta.hasOwnProperty('displayName')){issue=new context.Issue(`displayName for component 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-component-foldername'};ruleDef.prototype.getShortDescription=function(){return'Ensure components are defined in the correctly named folder'};ruleDef.prototype.getDescription=function(){return'This rule applies to both singleton and JET Pack components and verifies that they are correctly named in the folder structure based on their type'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('auditBuildOutput')){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentName=meta.name;const componentVersion=meta.version;const pathSegments=context.filepath.split('/');const componentFolder=pathSegments[pathSegments.length-2];const componentParentFolder=pathSegments[pathSegments.length-3];let expectedFolder;const processingBuilt=context.rulePack.getExtension().auditBuildOutput;if(!processingBuilt||meta.pack){expectedFolder=componentName}else{expectedFolder=componentVersion}if(componentFolder!==expectedFolder){issue=new context.Issue(`${processingBuilt?'For built output ':''}Component '${fullName}' should be defined in a folder called '${processingBuilt?componentName+path.sep:''}${expectedFolder}' not '${processingBuilt?componentParentFolder+path.sep:''}${componentFolder}' for referencing to work correctly`);context.reporter.addIssue(issue,context,'blocker')}}}else{Utils.reportMissingBootstrapInfo(context,'auditBuildOutput')}};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-component-location'};ruleDef.prototype.getShortDescription=function(){return'Ensure components are defined in the correct folder structure'};ruleDef.prototype.getDescription=function(){return'This rule applies to both singleton and JET Pack components and verifies that they are correctly placed in the folder structure based on their naming'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('auditBuildOutput')){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const componentParentPack=meta.pack;const componentName=meta.name;const fullName=Utils.getComponentFullName(meta);const pathSegments=context.filepath.split('/');const componentRoot=context.rulePack.getExtension().componentHome;const sepStrip=/\//g;const parentFolder=pathSegments[pathSegments.length-3];const grandParentFolder=pathSegments[pathSegments.length-4];let expectedParent;let expectedGrandParent;const processingBuilt=context.rulePack.getExtension().auditBuildOutput;if(processingBuilt){if(componentParentPack){expectedParent=Utils.componentInfo(context,componentParentPack).version;expectedGrandParent=componentParentPack}else{expectedParent=componentName;expectedGrandParent=componentRoot.replace(sepStrip,'');;}}else{if(componentParentPack){expectedParent=componentParentPack;expectedGrandParent=componentRoot.replace(sepStrip,'')}else{expectedParent=componentRoot.replace(sepStrip,'')}}if(parentFolder!==expectedParent){if(!processingBuilt){issue=new context.Issue(`Component '${fullName}' should be defined in a folder which is a child of '${expectedParent}'`);issue.setMsgKey(context.ruleName+'_1')}else{issue=new context.Issue(`Built component '${fullName}' should be present in a folder which is a child of '${expectedGrandParent}${path.sep}${expectedParent}'`);issue.setMsgKey(context.ruleName+'_3')}}if(!issue){if(expectedGrandParent&&grandParentFolder!==expectedGrandParent){issue=new context.Issue(`Parent folder for ${processingBuilt?'built':''} component '${fullName}' should be present in a folder called '${expectedGrandParent}'`);issue.setMsgKey(context.ruleName+'_2')}}if(issue){context.reporter.addIssue(issue,context,'blocker')}}}else{Utils.reportMissingBootstrapInfo(context,'auditBuildOutput')}};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-component-type'};ruleDef.prototype.getShortDescription=function(){return'Check component has an explicit type defined'};ruleDef.prototype.getDescription=function(){return'This rule checks that the component explicitly defines a type attribute rather than relying on the original fallback behavior and assuming composite'};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;if(!meta.hasOwnProperty('type')){issue=new context.Issue(`type for component should be explicitly defined rather than assuming the default`);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-data-property-prefix'};ruleDef.prototype.getShortDescription=function(){return'Ensure that the component does not define properties with a data* prefix'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not defined any property that once translated to an attribute becomes a data-* attribute. This involves checking the property name of top level properties only for the prefix of data followed by an uppercase letter. The property name data on its own is OK'};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 dataDetect=/^data[A-Z\-].*$/;Object.keys(meta.properties).forEach(propName=>{if(dataDetect.test(propName)){issue=new context.Issue(`Component ${fullName} defines a data prefixed property ${propName} which is not allowed`);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-deprecated-lifecycle'};ruleDef.prototype.getShortDescription=function(){return'Checks for deprecated component lifecycle definitions'};ruleDef.prototype.getDescription=function(){return'This rule ensures that the component does not still declare deprecated lifecycle methods such as attached'};ruleDef.prototype.register=function(context){return{FunctionExpression:Utils.setupFileMethodMapping.bind(Utils),ArrowFunctionExpression:Utils.setupFileMethodMapping.bind(Utils),CallExpression:Utils.deriveViewModels.bind(Utils),MethodDefinition:Utils.setupFileMethodMappingFromMethodDefintion.bind(Utils),closedownRP:this._doAudit}};ruleDef.prototype._doAudit=function(context){let issue;context.rulePack.getExtension().allComponents.forEach(compInfo=>{const vmMethods=Utils.getVMMethodsForLocalComposite(context,compInfo);if(vmMethods&&(vmMethods.has('attached')||vmMethods.has('detached')||vmMethods.has('initialize')||vmMethods.has('dispose'))){issue=new context.Issue(`Component '${compInfo.fullName}' still defines one or more of the following deprecated lifecycle methods: attached(), detached(), dispose(), initialize()`);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-disabled-property'};ruleDef.prototype.getShortDescription=function(){return'Check component does not use the problematic disabled property'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component does not define a property called disabled which can cause issues with IE'};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'){if(meta.properties&&meta.properties.hasOwnProperty('disabled')){var deprecated=false;if(meta.properties.disabled.hasOwnProperty('status')){var statusArray=meta.properties.disabled.status;statusArray.forEach(status=>{if(status.hasOwnProperty('type')){if(status.type==='deprecated'){deprecated=true}}})}if(!deprecated){issue=new context.Issue(`Component ${fullName} defines a property called 'disabled' this can cause problems with Internet Explorer and we recommend 'disable' as a replacement property name`);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-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component display name will work with Visual Builder'};ruleDef.prototype.getDescription=function(){return'This rule checks both the length and the number of words of the display name - configurable'};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();let limits;let elimits;let plimits;switch(componentType){case'composite':elimits=ruleOptions.limits.event;plimits=ruleOptions.limits.property;case'vbcs-pattern':limits=ruleOptions.limits.component;break;case'vbcs-template':limits=ruleOptions.limits.template;break;}if(limits){const displayName=meta.displayName;if(displayName){if(displayName.length>limits.length){this._lengthError(context,fullName,componentType,limits.length)}if(displayName.split(' ').length>limits.words){this._wordCountError(context,fullName,componentType,limits.words)}}}this.checkByAttributeType(context,fullName,componentType,plimits,meta,'properties','property');this.checkByAttributeType(context,fullName,componentType,elimits,meta,'events','event')}};ruleDef.prototype._lengthError=function(context,component,type,limit,scope){issue=new context.Issue(`displayName property for Component ${component}${scope?' ('+scope+')':''} exceeds the defined length limit of ${limit} for a ${type}`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'info')};ruleDef.prototype._wordCountError=function(context,component,type,limit,scope){issue=new context.Issue(`displayName property for Component ${component}${scope?' ('+scope+')':''} exceeds the defined word count of ${limit} for a ${type}`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'info')};ruleDef.prototype.checkByAttributeType=function(context,fullName,componentType,limits,meta,attributeType,typeName){if(limits&&meta[attributeType]){Object.keys(meta[attributeType]).forEach(cName=>{const cDN=meta[attributeType][cName].displayName;if(cDN){if(cDN.length>limits.length){this._lengthError(context,fullName,componentType+' '+typeName,limits.length,attributeType+'=>'+cName)}if(cDN.split(' ').length>limits.words){this._wordCountError(context,fullName,componentType+' '+typeName,limits.words,attributeType+'=>'+cName)}}})}};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-dynamic-slot-context'};ruleDef.prototype.getShortDescription=function(){return'Check properties have valid dynamicSlotDef values'};ruleDef.prototype.getDescription=function(){return'Ensures that any property that defines itself as a dynamic slot discriminant using the dynamicSlotDef attribute is using a valid context defined within the dynamicSlots set for the component'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){if(meta.properties){Object.keys(meta.properties).forEach(propName=>{let issueNoticed=false;const prop=meta.properties[propName];if(prop.hasOwnProperty('dynamicSlotDef')){if(meta.dynamicSlots){if(!meta.dynamicSlots.hasOwnProperty(prop.dynamicSlotDef)){issueNoticed=true}}else{issueNoticed=true}}if(issueNoticed){const issue=new context.Issue(`Component ${fullName} property ${propName} references an invalid dynamic-slot`);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-dynamic-slots-naming"};ruleDef.prototype.getShortDescription=function(){return"Verify dynamic slots are named correctly"};ruleDef.prototype.getDescription=function(){return"This rule checks that any dynamic slot contexts have the correct naming convention"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==="composite"){if(meta.dynamicSlots){Object.keys(meta.dynamicSlots).forEach(ctxName=>{if(!ctxName.endsWith("Context")){const issue=new context.Issue(`Component ${fullName} dynamicSlot ${ctxName} is not named according to the standards with a Context suffix`);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-event-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component has display name defined for events'};ruleDef.prototype.getDescription=function(){return'This rule checks that events 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 fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'&&meta.events){Object.keys(meta.events).forEach(eventName=>{if(!meta.events[eventName].displayName){issue=new context.Issue(`displayName for event '${eventName}' 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-events'};ruleDef.prototype.getShortDescription=function(){return'Checks that any events raised are declared'};ruleDef.prototype.getDescription=function(){return'This rule ensures that all events omitted from a component are declared in the metadata'};ruleDef.prototype.register=function(context){return{CallExpression:this._doAudit}};ruleDef.prototype._doAudit=function(context,node){let issue;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 withinComponent=Utils.matchComponentPath(context,path.dirname(context.filepath));const componentInfo=Utils.componentInfo(context,withinComponent);if(withinComponent&&componentInfo.type==='composite'){if(!componentInfo.events||!componentInfo.events.hasOwnProperty(eventName)){issue=new context.Issue(`Event '${eventName}' raised for component ${withinComponent} has not been declared in the component metadata`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'major')}}else{issue=new context.Issue(`Custom event '${eventName}' raised by code outside of a web component and so cannot be verified against any component API`);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 Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-jet-version'};ruleDef.prototype.getShortDescription=function(){return'Verify the JET version range of a component '};ruleDef.prototype.getDescription=function(){return'This rule is configured with your required JET version range for a set of components to make sure that they are all consistent'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){const ruleOptions=context.rulePack.getRuleOptions();if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);let targetJetVersion;if(ruleOptions.hasOwnProperty('jetVersion')){targetJetVersion=ruleOptions.jetVersion}else{targetJetVersion=context.utils.jafLib.getConfig().getJetVer()}if(meta.jetVersion){switch(ruleOptions.versionMatch){case'absolute':if(targetJetVersion!==meta.jetVersion){issue=new context.Issue(`Component ${fullName} does not support the expected JET version range ${targetJetVersion} (found ${meta.jetVersion})`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'blocker')}break;case'upperLimit':if(!context.utils.semVerUtils.satisfiesRange(targetJetVersion,meta.jetVersion)){issue=new context.Issue(`Component ${fullName} does not support the required version of JET ${targetJetVersion} (supported range found ${meta.jetVersion})`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'blocker')}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-loader-file'};ruleDef.prototype.getShortDescription=function(){return'Checks for the existence of the loader.js / ts'};ruleDef.prototype.getDescription=function(){return'This rule ensures that standard loader entry point is available for composites. This looks for a file called loader.js or loader.ts in the same folder as the components component.json file and then checks that the information matches, e.g. the loader registers the correct tag name for the component.'};ruleDef.prototype.register=function(context){return{compjson:this._doAuditPhysical,CallExpression:this._doAuditMapping}};ruleDef.prototype._doAuditPhysical=function(context){const componentMetadata=context.suppData.obj;if(componentMetadata){let issue;const fullName=Utils.getComponentFullName(componentMetadata);const componentType=Utils.getComponentType(componentMetadata);if(componentType==='composite'){const testLoader=Utils.toJAFPath(path.join(path.dirname(context.filepath),'loader.'));if(!context.utils.fsUtils.fileExistsSync(testLoader+'js')&&!context.utils.fsUtils.fileExistsSync(testLoader+'ts')){issue=new context.Issue(`Required loader script for ${fullName} is not present`,'0044');context.reporter.addIssue(issue,context,'critical')}}}};ruleDef.prototype._doAuditMapping=function(context,node){if(this._isCompositeLoader(context)){const candidateTag=this._getLoaderTag(context,node);if(candidateTag){if(candidateTag==='?'){issue=new context.Issue(`Web Component tag registration does not pass a literal for the tag name and so cannot be verified`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'info')}else{const checkFormat=/^[a-zA_Z]\w*-.*$/;if(!candidateTag.match(checkFormat)){issue=new context.Issue(`Tag ${candidateTag} used in Web Component registration does not conform to HTML custom element syntax rules. It must begin with a letter and have at least one hyphen`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context,'critical')}else{const componentDefFile=Utils.toJAFPath(path.join(path.dirname(context.filepath),'component.json'));if(context.utils.fsUtils.fileExistsSync(componentDefFile)){const componentDef=context.utils.fsUtils.readJsonSync(componentDefFile);const expectedTag=componentDef.pack?`${componentDef.pack}-${componentDef.name}`:componentDef.name;if(expectedTag!==candidateTag){issue=new context.Issue(`Tag '${candidateTag}' does not match the full name of the associated component '${expectedTag}'`);issue.setMsgKey(context.ruleName+'_3');context.reporter.addIssue(issue,context,'critical')}}}}}}};ruleDef.prototype._getLoaderTag=function(context,node){let tagName;const registerInfo=Utils.getLoaderRegisterInfo(context,node);if(registerInfo){tagName=registerInfo.tag}return tagName};ruleDef.prototype._isCompositeLoader=function(context){let loaderFound=false;if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('allComponents')){const fileName=context.filepath;const withinComponent=Utils.matchComponentPath(context,path.dirname(fileName));const componentInfo=context.rulePack.getExtension().allComponents.get(withinComponent);if(withinComponent&&componentInfo&&componentInfo.type==='composite'){const targetLoaderExt=componentInfo.language==='tsx'?'.ts':`.${componentInfo.language}`;if(path.basename(fileName,targetLoaderExt)==='loader'){loaderFound=true}}}else{Utils.reportMissingBootstrapInfo(context,'allComponents')}return loaderFound};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-method-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component has display name defined for methods'};ruleDef.prototype.getDescription=function(){return'This rule checks that methods 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 fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'&&meta.methods){Object.keys(meta.methods).forEach(methodName=>{if(!meta.methods[methodName].displayName){issue=new context.Issue(`displayName for method '${methodName}' 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 Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-methods'};ruleDef.prototype.getShortDescription=function(){return'Checks for the existence of declared methods'};ruleDef.prototype.getDescription=function(){return'This rule ensures that any methods declared in the component.json actually have an implementation in the associated viewModel'};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.methods){const vmMethods=Utils.getVMMethodsForLocalComposite(context,compInfo);if(vmMethods){Object.keys(compInfo.methods).forEach(methodName=>{const methodMeta=compInfo.methods[methodName];const testName=methodMeta.internalName?methodMeta.internalName:methodName;if(!vmMethods.has(testName)){issue=new context.Issue(`Component '${compInfo.fullName}' declares a API method '${methodName}' which does not have an implementation in its viewModel file`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context,'major')}else{const implementedParamCount=vmMethods.get(testName).parameters;const declaredParamCount=methodMeta.params?methodMeta.params.length:0;if(implementedParamCount!==declaredParamCount){issue=new context.Issue(`The implementation of Component '${compInfo.fullName}' API method '${testName}' does not match the declared API. The parameter lists differ in length`);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 Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-namespace'};ruleDef.prototype.getShortDescription=function(){return'Verify components are within your registered namespace'};ruleDef.prototype.getDescription=function(){return'This rule is configured with your namespace(s) in the audit configuration file and will match the naming of your component to those namespaces'};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(context.rulePack.getRuleOptions().namespaces.filter(ns=>fullName.startsWith(ns)).length===0){issue=new context.Issue(`Component ${fullName} is not in an assigned namespace`);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-nested-defaults'};ruleDef.prototype.getShortDescription=function(){return'Checks for incorrect definition of default values'};ruleDef.prototype.getDescription=function(){return'This rule checks that for complex properties (those with sub-properties) we do not have conflicting default values set e.g. a default on both a parent and a child.'};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>1){issue=new context.Issue(`Component ${fullName}, nested property ${prop.propertyPath} has multiple defaults defined at different levels`);context.reporter.addIssue(issue,context,'major')}})}}};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];let runningDefault=defaultCount;if(propertyMeta.hasOwnProperty('value')){runningDefault++}const propertyInfo={propertyPath:levelPath+propertyName,defaultCount:runningDefault};if(propertyMeta.hasOwnProperty('properties')){this._propertyDrill(context,propertyMeta,accumulator,propertyInfo)}accumulator.push(propertyInfo)})};module.exports=ruleDef;
|