@oracle/oraclejet-audit 10.1.0 → 12.0.0
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/LICENSE.md +1 -1
- 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/AstMd.js +6 -0
- 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 +6 -1
- 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/Md.js +6 -0
- 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 +6 -1
- package/lib/Registry.js +6 -1
- package/lib/Reporter.js +6 -1
- 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/builtinpacks.js +6 -0
- package/lib/cliStats.js +6 -0
- package/lib/clone.js +6 -1
- package/lib/cmdline.js +6 -1
- package/lib/colors.js +6 -1
- package/lib/defaults.js +6 -0
- package/lib/deflist.js +6 -0
- package/lib/dislist.js +6 -0
- package/lib/exportRules.js +6 -0
- package/lib/extends.js +6 -0
- package/lib/filetypes.js +6 -0
- package/lib/grouplist.js +6 -0
- package/lib/groups.js +6 -0
- package/lib/help.js +6 -1
- package/lib/jetver.js +6 -1
- package/lib/macros.js +6 -0
- package/lib/manual.js +6 -1
- 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 +5 -0
- 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 +6 -1
- package/lib/scopewalker.js +6 -0
- package/lib/spinner.js +6 -1
- package/lib/spinnernoop.js +5 -0
- package/lib/tabs.js +5 -0
- package/libext/expparser.js +6 -1
- package/meta/11.0.0/jetauditmeta.js +9 -0
- package/meta/11.1.0/jetauditmeta.js +9 -0
- package/meta/12.0.0/jetauditmeta.js +9 -0
- package/meta/metaverlist.json +1 -1
- package/package.json +72 -69
- 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-css-oj-complete.js +6 -0
- 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-markdown-link.js +6 -0
- 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-vcomponent-jetversion.js +6 -0
- package/rulepacks/jetwc/jetwc-vcomponent-loader.js +6 -0
- package/rulepacks/jetwc/jetwc-vcomponent-version.js +6 -0
- 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/jetwcutils-auditComponentCacheManager.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +6 -0
- package/rulepacks/jetwco/jetwco-bootstrap.js +6 -1
- package/rulepacks/jetwco/jetwco-cacc-auditConstraints.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-dependencies.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-events.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-helpers.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-jetVer.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodParams.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methods.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packBundle.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packContent.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-properties.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-publicModules.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slots.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +6 -0
- 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-api-controlled-changes.js +6 -0
- package/rulepacks/jetwco/jetwco-component-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-description-standards.js +6 -0
- package/rulepacks/jetwco/jetwco-displayname-standards.js +6 -0
- 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/{tests/rules/oj-js-diagnose/js_FAIL_1.js → rulepacks/wdt/msgid.json} +3 -9
- package/rulepacks/wdt/rules.json +6 -0
- package/rulepacks/wdt/wd-driver-sleep.js +6 -0
- package/rulepacks/wdt/wd-xpath.js +6 -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 +6 -1
- package/rules/jet/oj-acc-avatar-aria-role.js +6 -1
- package/rules/jet/oj-acc-combobox-aria-label.js +6 -1
- package/rules/jet/oj-acc-film-strip-aria-label.js +6 -1
- 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 +6 -1
- package/rules/jet/oj-css-style-bp-color.js +5 -0
- 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 -1
- 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-alta-deprecated.js +6 -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 +6 -1
- package/rules/jet/oj-html-bindif-test.js +6 -1
- package/rules/jet/oj-html-binding-attr.js +6 -1
- 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 +6 -1
- package/rules/jet/oj-html-file-pick-accept.js +6 -1
- package/rules/jet/oj-html-form-bindif.js +6 -1
- package/rules/jet/oj-html-form-layout-maxcols.js +6 -1
- 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 +6 -1
- 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-msgs-cat-text.js +6 -0
- package/rules/jet/oj-html-no-style-tag.js +6 -0
- package/rules/jet/oj-html-notag-style.js +6 -0
- 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 +6 -1
- 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 +6 -1
- 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 +6 -1
- package/rules/jet/oj-html-ojtag-id.js +5 -0
- package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +6 -1
- 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 +6 -1
- 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 +6 -1
- package/rules/jet/oj-html-template-index.js +6 -1
- 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 +6 -1
- package/rules/jet/oj-html-wctag-nested.js +6 -0
- package/rules/jet/oj-html-wctag-packprivate.js +6 -0
- package/rules/jet/oj-js-comp-attr-deprecated.js +6 -1
- package/rules/jet/oj-js-comp-meth-deprecated.js +6 -1
- 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 +5 -0
- package/rules/jet/oj-ts-comp-attr-deprecated.js +6 -1
- package/rules/jet/oj-ts-comp-meth-deprecated.js +6 -1
- 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 +125 -2
- package/src/JafCore.js +6 -1
- package/types/index.d.ts +175 -37
- package/lib/stats.js +0 -1
- package/rulepacks/jetwc-lib/component-audit-utils.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-no-ext-final/noextfinal_FAIL_1.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_2.js +0 -23
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_3.js +0 -22
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_4.js +0 -20
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_5.js +0 -24
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_6.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_7.js +0 -15
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_8.js +0 -16
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_1.js +0 -17
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_2.js +0 -17
- package/tests/rules/oj-js-noconsole/nocons_FAIL_1.js +0 -11
- package/tests/rules/oj-js-ojcomp-deprecated/jscomp_FAIL_1.js +0 -27
- package/tests/rules/oj-json-syntax/json_FAIL_1.json +0 -8
- package/tests/rules/oj-json-syntax/json_FAIL_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_1.json +0 -25
- package/tests/rules/oj-json-syntax/json_PASS_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_3.json +0 -14
- package/tests/rules/ojcompjson/attrreq_FAIL_1/component.json +0 -69
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-view.html +0 -6
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-1/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-1/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-view.html +0 -5
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-2/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-2/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component.json +0 -12
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-view.html +0 -5
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-1/component.json +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/resources/nls/audit-singleton-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-view.html +0 -8
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-2/component.json +0 -15
- package/tests/rules/pack-compjson/audit-singleton-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-2/resources/nls/audit-singleton-2-strings.js +0 -18
- package/tests/rules/parse-html/proc_instr.html +0 -9
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_1.js +0 -113
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_2.js +0 -151
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_1.js +0 -149
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_2.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_3.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_4.js +0 -20
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_5.js +0 -246
- package/tests/rules/tab-tests/tab-test_FAIL_1.html +0 -37
- package/tests/rules/tab-tests/tab-test_FAIL_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/src/JetTest.js +0 -1
- package/tests/src/server.js +0 -1
- package/tests/test.js +0 -1
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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="spoc-dom-manip";const PROP_NAMES=["innerHTML","outerHTML"];const FUNCS_DOM_MANIP=["html","prepend","prependTo","before","after","insertAfter","append","appendTo","wrap","wrapAll","wrapInner","replaceAll","replaceWith","write","writeln","attr","setAttribute"];const FUNCS_OF_INTEREST=["eval","Function","setTimeout","setInterval","random","createElement","write","writeln"];const FUNCS_SPECIAL_CASE=["appendChild"];const FUNCS_AJAX=["XMLHttpRequest","ActiveXObject"];const SAFE_ATTR_NAMES=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","dir","face","height","hspace","id","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","role","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"];const UNSAFE_ATTR_NAMES=["action","allow","async","background","charset","cite","data","formaction","icon","ping","poster","src","srcdoc","srcset","style"];const FUNC_EXPR="FunctionExpression";const ARROW_FUNC_EXPR="ArrowFunctionExpression";const IDENTIFIER="Identifier";const LITERAL="Literal";const BLOCK_STMT="BlockStatement";const CALL_EXPR="CallExpression";const MEMBER_EXPR="MemberExpression";const TAG_OK="@htmlupdateok";const TAG_REVIEW="@htmlupdatereview";const TAG_XSS_F_POS="@xssfalsepositive";const TAG_RANDOM="@randomnumberok";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return"Reports DOM manipulations in JS"};Rule.prototype.getDescription=function(){return"Reports on DOM manipulations and optionally provides the ability to tag with @HTMLUpdateOK."};Rule.prototype.register=function(regContext){this._settings=regContext.ruleOpts.settings;return{AssignmentExpression:this._handleDom,CallExpression:this._handleCall,NewExpression:this._handleNewExpr,MemberExpression:this._handleMemExpr,VariableDeclaration:this._handleVarDecl,VariableDeclarator:this._handleVarDecl}};Rule.prototype._handleDom=function(context,node){if(node.left){this._handleDom2(context,node.left,node.right,true)}};Rule.prototype._handleMemExpr=function(context,node){var obj,funcName;if(node.parent&&node.parent.type==="ConditionalExpression"){obj=node.parent;if(obj.consequent&&obj.consequent.property&&obj.consequent.property.type===IDENTIFIER){obj=obj.consequent.property;if(isDomManip(obj.name)){if(this._settings.new.showGetters){this._checkAndEmit(context,obj,{msg:"DOM manipulation getter '"+obj.name+"'"})}}else if(isDomManipFunc(obj.name)){funcName:obj.property&&obj.property.type===IDENTIFIER?obj.property.name:obj.name;if(funcName){this._checkAndEmit(context,obj,{isFunc:true,funcName:funcName,msg:"DOM manipulation function "+funcName+"()"})}}else if(isFuncOfInterest(obj.name)){this._checkAndEmit(context,obj,{funcName:obj.property&&obj.property.type===IDENTIFIER?obj.property.name:obj.name,isFunc:true,funcName:funcName,msg:"DOM manipulation function "+funcName+"()"})}}if(obj.alternate&&obj.alternate.property&&obj.alternate.property.type===IDENTIFIER){obj=obj.alternate.property;if(isDomManip(obj.name)){if(this._settings.new.showGetters){this._checkAndEmit(context,obj,{msg:"DOM manipulation getter '"+obj.name+"'"})}}else if(isDomManipFunc(obj.name)){funcName=obj.property&&obj.property.type===IDENTIFIER?obj.property.name:obj.name;this._checkAndEmit(context,obj,{isFunc:true,funcName:funcName,msg:"DOM manipulation function "+funcName+"()"})}}}else{this._checkCookie(context,node)}};Rule.prototype._handleCall=function(context,node){var obj,funcOfInterest,funcName;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;funcName=obj.name;funcOfInterest=isFuncOfInterest(funcName);if(isDomManipFunc(funcName)||funcOfInterest){if(this._checkHtmlFunc(context,node)||this._checkDocumentWrite(context,node)||this._checkCreateElement(context,node)||this._checkTimeFuncs(context,node)||this._checkMathRandom(context,node)||this._checkEval(context,node)||this._checkSafeSetAttrName(context,node)){return}this._checkAndEmit(context,obj,{isFunc:true,funcName:funcName,msg:(!funcOfInterest?"DOM manipulation ":"")+"function "+funcName+"()"})}}};Rule.prototype._handleNewExpr=function(context,node){var callee,funcName;if(node.callee){callee=node.callee;if(isFuncAjax(callee.name)){funcName=_getFuncName(callee);this._checkAndEmit(context,callee,{isFunc:true,funcName:funcName,msg:"function "+funcName+"()"})}else{if(callee.type===IDENTIFIER&&callee.name==="Function"){funcName=_getFuncName(callee);this._checkAndEmit(context,callee,{isFunc:true,funcName:funcName,msg:"function "+funcName+"()"})}}}};Rule.prototype._handleDom2=function(context,nodeLeft,nodeRight,isSetter){var node;if(nodeLeft.property){node=nodeLeft.property;if(node.type===IDENTIFIER){if(isDomManip(node.name)){if(!this._checkAssignedValue(context,nodeRight)){if(isSetter||this._settings.new.showGetters){this._checkAndEmit(context,node,{msg:"DOM manipulation "+(isSetter?"setter":"getter")+" '"+node.name+"'"})}}}}}else if(nodeRight.type===LITERAL&&nodeRight.value==="script"){this._checkAndEmit(context,nodeRight,{msg:"var assignment of 'script'"})}};Rule.prototype._handleVarDecl=function(context,node){var i,decl;if(node.declarations){for(i=0;i<node.declarations.length;i++){decl=node.declarations[i];if(!decl.init){continue}if(decl.init.type===LITERAL&&decl.init.value==="script"){this._checkAndEmit(context,decl,{isFunc:false,msg:"var '"+decl.id.name+"' initialized with 'script'"})}}}};Rule.prototype._check=function(context,obj,isFunc,setter,isDomManipFunc,isVar,isScriptAssign,isCookie){var line,tagType,tagged,isTagged,funcName,issue,rowcol;var utils=context.utils.utils;line=isolateLine(context.data,obj.end);tagType=getLineTag(line);tagged=tagType===TAG_OK?"UpdateOK tagged":tagType===TAG_XSS_F_POS?"XSS tagged":tagType===TAG_RANDOM?"RandomOK tagged":"untagged";isTagged=tagged!=="untagged";if(tagType===TAG_REVIEW){issue=new context.Issue("SPOC - obsolete tag '@HTMLUpdateReview' - remove");issue.setSeverity("info");rowcol=utils.getRowColFromIndex(context.data,obj.start);issue.setPosition(rowcol.row,rowcol.col,obj.start,obj.end);context.reporter.addIssue(issue,context);issue=null;tagType=""}if(isFunc){funcName=obj.property&&obj.property.type===IDENTIFIER?obj.property.name:obj.name;if(funcName==="random"&&tagType&&tagType!==TAG_RANDOM){issue=new context.Issue("SPOC - Math.random() is tagged incorrectly (use '@RandomNumberOK')");context.reporter.addIssue(issue,context);return}}if(!tagType&&this._settings.new.show||tagType===TAG_OK&&this._settings.existing.showUpdate||tagType===TAG_XSS_F_POS&&this._settings.existing.showXSS||tagType===TAG_RANDOM&&this._settings.existing.showRandom){issue=null;if(isFunc){issue=new context.Issue("SPOC - "+tagged+(isDomManipFunc?"DOM manipulation":"")+" function "+funcName+"()")}else if(isVar){issue=new context.Issue("SPOC - "+tagged+" var '"+obj.id.name+"' initialized with 'script'")}else if(isScriptAssign){issue=new context.Issue("SPOC - "+tagged+" var assignment of 'script'")}else if(isCookie){issue=new context.Issue("SPOC - "+tagged+" use of 'document.cookie'")}else if(setter||this._settings.new.showGetters){issue=new context.Issue("SPOC - "+tagged+" DOM manipulation "+(setter?"setter":"getter")+" '"+obj.name+"'")}if(issue){rowcol=utils.getRowColFromIndex(context.data,obj.property?obj.property.start:obj.start);issue.setPosition(rowcol.row,rowcol.col,obj.start,obj.end);if(isTagged){issue.setSeverity("info")}context.reporter.addIssue(issue,context)}}};Rule.prototype._checkAndEmit=function(context,obj,info){var line,tagType,tagged,isTagged,issue,rowcol;var utils=context.utils.utils;line=isolateLine(context.data,obj.end);tagType=getLineTag(line);tagged=tagType===TAG_OK?"UpdateOK tagged":tagType===TAG_XSS_F_POS?"XSS tagged":tagType===TAG_RANDOM?"RandomOK tagged":"untagged";isTagged=tagged!=="untagged";if(tagType===TAG_REVIEW){issue=new context.Issue("SPOC - obsolete tag '@HTMLUpdateReview' - remove");issue.setSeverity("info");rowcol=utils.getRowColFromIndex(context.data,obj.start);issue.setPosition(rowcol.row,rowcol.col,obj.start,obj.end);context.reporter.addIssue(issue,context);issue=null;tagType=""}issue=null;if(info.funcName){}if(!tagType&&this._settings.new.show||tagType===TAG_OK&&this._settings.existing.showUpdate||tagType===TAG_XSS_F_POS&&this._settings.existing.showXSS||tagType===TAG_RANDOM&&this._settings.existing.showRandom){issue=new context.Issue("SPOC - "+tagged+" "+info.msg);if(issue){rowcol=utils.getRowColFromIndex(context.data,obj.property?obj.property.start:obj.start);issue.setPosition(rowcol.row,rowcol.col,obj.start,obj.end);if(isTagged){issue.setSeverity("info")}context.reporter.addIssue(issue,context)}}};Rule.prototype._checkFuncOKUntagged=function(context,obj){var line,tagType,issue,rowcol;if(!this._settings.existing.showOkUntagged){return}line=isolateLine(context.data,obj.end);tagType=getLineTag(line);if(!tagType&&this._settings.new.show||tagType!==TAG_OK&&this._settings.existing.showUpdate||tagType!==TAG_XSS_F_POS&&this._settings.existing.showXSS){issue=new context.Issue("SPOC - "+" DOM manipulation function "+obj.name+"() is OK, but untagged");if(issue){rowcol=context.utils.utils.getRowColFromIndex(context.data,obj.start);issue.setPosition(rowcol.row,rowcol.col,obj.start,obj.end);issue.setSeverity("info");context.reporter.addIssue(issue,context)}}};Rule.prototype._checkAssignedValue=function(context,node){var v,ret=false;if(node.type===LITERAL){v=node.value;if(context.utils.utils.getType(v)==="string"){if(v===""){ret=true}}}return ret};Rule.prototype._checkHtmlFunc=function(context,node){var callee,ret=false;callee=node.callee;if(callee.property&&callee.property.type===IDENTIFIER){if(callee.property.name==="html"){if(node.arguments&&node.arguments.length){this._checkAndEmit(context,callee.property,{isFunc:true,funcName:"html",msg:"DOM manipulation function html() used as a setter"})}ret=true}}return ret};Rule.prototype._checkDocumentWrite=function(context,node){var callee,meth,ret=false;callee=node.callee;if(callee.property&&callee.property.type===IDENTIFIER){meth=callee.property.name;if(meth==="write"||meth==="writeln"){if(callee.type===MEMBER_EXPR&&callee.object.type===IDENTIFIER&&callee.object.name==="document"){this._checkAndEmit(context,callee.property,{isFunc:true,funcName:meth,msg:"DOM manipulation function document."+meth+"()"});ret=true}}}return ret};Rule.prototype._checkCreateElement=function(context,node){var callee,meth,args,arg,ret=false;callee=node.callee;if(callee.property&&callee.property.type===IDENTIFIER){meth=callee.property.name;if(meth==="createElement"){if(true){args=node.arguments;if(args.length>=1){arg=args[0];if(arg.type===LITERAL){if(arg.value!=="script"){return true}else{this._checkAndEmit(context,callee.property,{isFunc:true,funcName:"createElement",msg:"function createElement() used to create a 'script' element"})}return true}else if(arg.type==="ConditionalExpression"){if(arg.consequent.type===LITERAL&&arg.consequent.value!=="script"&&arg.alternate.type===LITERAL&&arg.alternate.value!=="script"){return true}}}this._checkAndEmit(context,callee.property,{isFunc:true,funcName:"createElement",msg:"function createElement() may potentially be used to create a 'script' element"});ret=true}}}return ret};Rule.prototype._checkCookie=function(context,node){var obj,prop,ret=false;obj=node.object;if(obj&&obj.type===IDENTIFIER&&obj.name==="document"){prop=node.property;if(prop&&prop.type===IDENTIFIER&&prop.name==="cookie"){this._checkAndEmit(context,prop,{msg:"use of 'document.cookie'"});ret=true}}return ret};Rule.prototype._checkAppendChild=function(context,node){var callee,meth,obj,ret=false;callee=node.callee;if(callee.property&&callee.property.type===IDENTIFIER){meth=callee.property.name;if(meth==="appendChild"){if(callee.type===MEMBER_EXPR&&callee.object.type===IDENTIFIER&&callee.object.name==="document"){obj=callee.object;if(obj.property&&obj.property.type===IDENTIFIER&&obj.name==="head"){this._checkAndEmit(context,callee.property,{isFunc:true,funcName:"appendchild",msg:"DOM manipulation function appendChild()"});ret=true}}else{this._checkAndEmit(context,callee.property,{isFunc:true,funcName:"appendChild",msg:"DOM manipulation function appendChild()"});ret=true}}}return ret};Rule.prototype._checkTimeFuncs=function(context,node){var obj,callee,meth,args,arg,ret=false;callee=node.callee;obj=callee.property?callee.property:callee;if(obj.type===IDENTIFIER){meth=obj.name;if(meth!=="setTimeout"&&meth!=="setInterval"){return false}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===LITERAL||arg.type===CALL_EXPR||!_isIdentAFunc(node,arg.name)){this._checkAndEmit(context,callee,{isFunc:false,funcName:meth,msg:"function "+meth+"()"})}}else{}ret=true}}}return ret};Rule.prototype._checkMathRandom=function(context,node){var obj,callee,meth,ret=false;callee=node.callee;obj=callee.property?callee.property:callee;if(callee.object&&callee.object.type===IDENTIFIER&&callee.object.name==="Math"){meth=obj.name;if(meth==="random"){this._checkAndEmit(context,obj,{isFunc:true,funcName:"Math.random",msg:"function Math.random()"});ret=true}}return ret};Rule.prototype._checkEval=function(context,node){var obj,callee,meth,ret=false;callee=node.callee;obj=callee.property?callee.property:callee;meth=obj.name;if(meth==="eval"){this._checkAndEmit(context,obj,{isfunc:true,funcName:"eval",msg:"function eval()"});ret=true}return ret};Rule.prototype._checkAjax=function(context,node){var obj,callee,meth,ret=false;callee=node.callee;obj=callee.property?callee.property:callee;meth=obj.name;if(meth==="XMLHttpRequest"||meth==="ActiveXObject"){this._checkAndEmit(context,obj,{isFunc:true,funcName:meth,msg:"function "+meth+"()"});ret=true}return ret};Rule.prototype._checkSafeSetAttrName=function(context,node){var callee,meth,args,arg,msg,ret=false;callee=node.callee;if(callee.property&&callee.property.type===IDENTIFIER){meth=callee.property.name;if(meth==="setAttribute"||meth==="attr"){args=node.arguments;if(args.length<2){return true}arg=args[0];if(arg.type===LITERAL){if(isSafeSetAttrName(arg.value,meth==="setAttribute")){return true}if(isUnsafeSetAttrName(arg.value,args[1].value)){if(arg.value.startsWith("on")){if(context.utils.utils.getType(args[1])==="function"){this._checkFuncOKUntagged(context,callee.property)}else{this._checkAndEmit(context,callee.property,{isFunc:true,funcName:meth,msg:"function "+meth+"('"+arg.value+"', ...)"})}}else{this._checkAndEmit(context,callee.property,{isFunc:true,funcName:meth,msg:"function "+meth+"('"+arg.value+"', ...)"})}}ret=true}if(!ret){if(args&&args.length){if(args[0].type===LITERAL){msg=args[0].raw+", ..."}else{msg="expr, ... "}}this._checkAndEmit(context,callee.property,{isFunc:true,funcName:meth,msg:"function "+meth+"("+msg+")"});ret=true}}}return ret};function isDomManip(name){return PROP_NAMES.includes(name)};function isDomManipFunc(name){return FUNCS_DOM_MANIP.includes(name)};function isFuncOfInterest(name){return FUNCS_OF_INTEREST.includes(name)};function isFuncAjax(name){return FUNCS_AJAX.includes(name)};function isSpecialCaseFunc(name){return FUNCS_SPECIAL_CASE.includes(name)};function isSafeSetAttrName(name,isSetAttribute){return name.startsWith("data-")||name.startsWith("aria-")||SAFE_ATTR_NAMES.includes(name)||name==="for"||name.startsWith("oj-")};function isUnsafeSetAttrName(attr,value){value=value||"";if(typeof value==="string"){value=value.trim()}return attr.startsWith("on")||UNSAFE_ATTR_NAMES.includes(attr)||attr==="href"&&value!=="#"&&value!==""};function _getFuncName(obj){return obj.property&&obj.property.type===IDENTIFIER?obj.property.name:obj.name};function _isIdentAFunc(node,funcName){var n,decls,decl,i,j,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"){isFunc=n.id&&n.id.type===IDENTIFIER&&n.id.name===funcName;if(isFunc){return true}}}return false}if(node.body){for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="FunctionDeclaration"){isFunc=n.id&&n.id.type===IDENTIFIER&&n.id.name===funcName;if(isFunc){return true}}}for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="VariableDeclaration"){decls=n.declarations;if(decls){for(j=0;j<decls.length;j++){decl=decls[j];if(decl.type==="VariableDeclarator"){if(decl.id.type===IDENTIFIER&&decl.id.name===funcName){return decl.init&&(decl.init.type===FUNC_EXPR||decl.init.type===ARROW_FUNC_EXPR)}}}}isFunc=n.id&&n.id.type===IDENTIFIER&&n.id.name===funcName;if(isFunc){return true}}}}node=node.parent}return false};function isolateLine(data,endIndex){var i,c,len=data.length;for(i=endIndex;i<len;i++){c=data.charAt(i);if(c==="\n"||c==="\r"){break}}return data.substring(endIndex,i)};function getLineTag(line){var lc=line.toLowerCase();return lc.includes(TAG_OK)?TAG_OK:lc.includes(TAG_REVIEW)?TAG_REVIEW:lc.includes(TAG_XSS_F_POS)?TAG_XSS_F_POS:lc.includes(TAG_RANDOM)?TAG_RANDOM:""};module.exports=Rule;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) , 2021, Oracle and/or its affiliates.
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
4
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
5
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
6
|
-
* @ignore
|
|
7
5
|
*/
|
|
8
|
-
|
|
9
|
-
}) ;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
{"wd-xpath":"0001","wd-driver-sleep":"0005"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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":"WebDriver Test Audit - Placeholder","prefix":"WDT","version":"0.0.1","rules":{"wd-xpath":{"severity":"major","filetype":"ts","status":"beta"},"wd-driver-sleep":{"severity":"critical","filetype":"ts","status":"beta"}}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 RULENAME="wd-driver-sleep";const DESCRIPT="Do not use timed sleeps in tests, WebDriver commands automatically wait on BusyContext. "+"Ensure the application is properly reporting busy states for async activity.";const SHORT="Do not use timed sleeps in tests.";function Rule(){};Rule.prototype.getName=function(){return RULENAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){return{CallExpression:this._onCallExpr}};Rule.prototype._onCallExpr=function(ruleCtx,node){var cn=node.callee;if(cn&&cn.property&&cn.property.type==="Identifier"&&cn.property.name==="sleep"){if(cn.object&&cn.object.type==="Identifier"&&cn.object.name==="driver"){let issue=new ruleCtx.Issue("Do not use timed sleeps in tests. WebDriver commands automatically wait on BusyContext.");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};module.exports=Rule;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 RULENAME="wd-xpath";const DESCRIPT="Do not locate elements by xpath - targeted elements should have static Ids. Use By.id() instead";const SHORT="Do not locate elements by xpath";function Rule(){};Rule.prototype.getName=function(){return RULENAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){return{CallExpression:this._onCallExpr}};Rule.prototype._onCallExpr=function(ruleCtx,node){var cn=node.callee;if(cn&&cn.property&&cn.property.type==="Identifier"&&cn.property.name==="xpath"){let issue=new ruleCtx.Issue(DESCRIPT);ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
function getName(){return"jaf-css-diagnose"};function getShortDescription(){return"Handle CSS syntax exceptions"};function getDescription(){return"While processing CSS, an exception has occurred, and is probably the result of a syntax specification error. Review the CSS for invalid syntax."};module.exports={getName,getDescription,getShortDescription};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
function getName(){return"jaf-html-diagnose"};function getShortDescription(){return"Handle HTML syntax exceptions"};function getDescription(){return"While processing HTML, a syntax specification error was noted. Review the HTML for superfluous characters or invalid syntax."};module.exports={getName,getDescription,getShortDescription};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
function getName(){return"jaf-init-schema"};function getShortDescription(){return"Handle initialization schema exceptions while reading web-component metadata"};function getDescription(){return"While processing user specified web component metadata during startup, schema validation issues were found in the associated component.json.<br>[Note: the line/column repoted is (0,0) because the schema valdator does not currently return this information.]"};module.exports={getName,getDescription,getShortDescription};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
function getName(){return"jaf-js-diagnose"};function getShortDescription(){return"Handle Javascript syntax exceptions"};function getDescription(){return"While processing JavaScript, an exception has occurred, and is probably the result of a syntax specification error. Review the Javascript for invalid syntax."};module.exports={getName,getDescription,getShortDescription};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
+
function getName(){return"jaf-ts-diagnose"};function getShortDescription(){return"Handle TypeScript syntax exceptions"};function getDescription(){return"While processing TypeScript, an exception has occurred, and is probably the result of a syntax specification error. Review the TypeScript for invalid syntax."};module.exports={getName,getDescription,getShortDescription};
|
package/rules/jaf/msgid.json
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
+
{"jaf-js-diagnose":"1000","jaf-ts-diagnose":"1005","jaf-css-diagnose":"1010","jaf-html-diagnose":"1020","jaf-init-schema":"2000","jaf-sys-startup":"9000"}
|
package/rules/jaf/rules.json
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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":"JAF System Rules","version":"1.1.0","prefix":"JAF","rules":{"jaf-js-diagnose":{"severity":"blocker","filetype":["js","html"],"group":["jaf-js"],"status":"production","$internal":true},"jaf-ts-diagnose":{"severity":"blocker","filetype":["ts"],"group":["jaf-ts"],"status":"production","$internal":true},"jaf-html-diagnose":{"severity":"minor","filetype":["html"],"group":["jet-html"],"status":"production","$internal":true},"jaf-css-diagnose":{"severity":"minor","filetype":["css","html"],"group":["jet-css"],"status":"production","$internal":true},"jaf-init-schema":{"severity":"major","filetype":["json"],"group":["jet-json"],"status":"production","$internal":true}}}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
+
module.exports=function(ruleCtx,tagName,theme){var id,issue,label,elem,ledge,ret;var labelHint,hasLabelOrAriaLabel;id=_getAttrib(ruleCtx,"id");if(!id){id=_getDataBindIdAttr(ruleCtx)}if(id){if(_isExpression(id)){return null}elem=_searchPageForFor(ruleCtx,id,-1);if(elem){if(elem.name==="label"){issue=new ruleCtx.Issue(`Accessibility: <${tagName}> 'id' attribute \"${id}\" has matching <label> - <oj-label> preferred`);issue.setMsgKey(ruleCtx.ruleName+"_1");_updateAttrPos(ruleCtx,issue,"id");ret=_addIssue(ret,issue.setSeverity("info"))}return ret}}if(_getAttrib(ruleCtx,"label-hint")){labelHint=true;ledge=_getAttrib(ruleCtx,"label-edge");if(!ledge&&theme!=="none"){ledge=theme==="Redwood"||theme==="Stable"?"inside":"provided"}if(ledge==="none"){hasLabelOrAriaLabel=true}else if(ledge==="inside"){hasLabelOrAriaLabel=true}else if(_isExpression(ledge)){return}else{let form=ruleCtx.utils.DomUtils.isChildOfElemNode("oj-form-layout",ruleCtx.node);if(form){if(ledge!=="none"){hasLabelOrAriaLabel=true}}}if(hasLabelOrAriaLabel){return}}label=_getAttrib(ruleCtx,"aria-label");if(!label){label=_getAttrib(ruleCtx,"aria-labelledby");if(label){return}if(id){if(_forAttrsExpressions(ruleCtx)){issue=new ruleCtx.Issue(`Accessibility: ${tagName}> 'id' attribute \"${id}\" may have no matching <oj-label> - check <oj-label> \"for\" expressions`);_updateAttrPos(ruleCtx,issue,"id");issue.setMsgKey(ruleCtx.ruleName+"_2");issue.setSeverity("info")}else{if(labelHint){issue=new ruleCtx.Issue(`Accessibility: <${tagName}> : 'id' attribute \"${id}\" has no matching <oj-label>, 'id' or 'aria-label attribute. 'label-edge' is '${ledge}' (theme: '${theme}')`);issue.setMsgKey(ruleCtx.ruleName+"_5")}else{issue=new ruleCtx.Issue(`Accessibility: <${tagName}> 'id' attribute \"${id}\" has no matching <oj-label> or 'aria-label'. Set 'label-hint', or associate an 'oj-label'.`);issue.setMsgKey(ruleCtx.ruleName+"_3")}_updateAttrPos(ruleCtx,issue,"id")}}else{if(labelHint){issue=new ruleCtx.Issue(`Accessibility: <${tagName}> : has no 'id' or 'aria-label attribute. 'label-edge' is '${ledge}' (theme: '${theme}')`);issue.setMsgKey(ruleCtx.ruleName+"_6")}else{issue=new ruleCtx.Issue(`Accessibility: <${tagName}> : has no 'id' or 'aria-label attribute!`);issue.setMsgKey(ruleCtx.ruleName+"_4")}}}if(issue){return _addIssue(ret,issue)}};function _getAttrib(ruleCtx,attr){return _getNodeAttrib(ruleCtx,ruleCtx.node,attr)};function _getNodeAttrib(ruleCtx,node,attr){var du=ruleCtx.utils.DomUtils;return du.getAttribValue(node,attr)||du.getAttribValue(node,":"+attr)};function _searchPageForFor(ruleCtx,id){var tags,node,attribs,attrib,lcattr,o,i;tags=ruleCtx.utils.DomUtils.getElemsByName(["oj-label","label"]);if(tags){for(i=0;i<tags.length;i++){node=tags[i];attribs=node.attribs;if(attribs){for(attrib in attribs){lcattr=attrib.toLowerCase();if((lcattr==="for"||lcattr===":for")&&attribs[attrib]===id){return node}else{o=_getDataBindForAttr(ruleCtx,node);if(o===id){return node}}}}}}return null};function _getDataBindIdAttr(ruleCtx){var o=ruleCtx.utils.DomUtils.getDataBindAttrs(ruleCtx);return o&&o["id"]};function _getDataBindForAttr(ruleCtx,node){var o=ruleCtx.utils.DomUtils.getDataBindAttrsFromNode(ruleCtx,node);return o&&o["for"]};function _forAttrsExpressions(ruleCtx){var forAttrs,ret=false,i;forAttrs=_getLabelForValues(ruleCtx);for(i=0;i<forAttrs.length;i++){if(_isExpression(forAttrs[i])){ret=true;break}}return ret};function _getLabelForValues(ruleCtx){var forAttrs=[],tags,node,attribs,attrib,i;tags=ruleCtx.utils.DomUtils.getElemsByName(["oj-label","label"]);if(tags){for(i=0;i<tags.length;i++){node=tags[i];attribs=node.attribs;if(attribs){for(attrib in attribs){if(attrib.toLowerCase()==="for"||attrib.toLowerCase()===":for"){forAttrs.push(attribs[attrib])}else{if(_getDataBindForAttr(ruleCtx,node)){forAttrs.push(attribs[attrib])}}}}}}return forAttrs};function _isExpression(s){return /[\[\]\(\}\{+*\/]/.test(s)};function _addIssue(ret,issue){ret=ret||[];ret.push(issue);return ret};function _updateAttrPos(ruleCtx,issue,attrName){var attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end)};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 ARRAY="array";const OBJECT="object";module.exports=function(obj,type){return _checkPropType(obj,type)};function _checkPropType(obj,type,props,ar,soFar){var test,props,prop,propName,propType,soFar;test=type==="o"?OBJECT:type==="a"?ARRAY:null;props=props?props:obj;soFar=soFar?soFar:"";if(test&&props){for(propName in props){prop=props[propName];if(prop.type&&typeof prop.type==="string"){propType=prop.type.toLowerCase();if(type==="o"&&propType===OBJECT||type==="a"&&propType.includes(ARRAY)){ar=ar?ar:[];ar.push(soFar+propName)}if(prop.properties){ar=_checkPropType(obj,type,prop.properties,ar,soFar+propName+".")}}}}return ar};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 COLOR_PROPS=["color","background-color","border-color","border-bottom-color","border-left-color","border-right-color","border-bottom-color","caret-color","column-rule-color","outline-color","text-decoration-color"];const COLOR_PROPS_MULTI=["background","background-image","border","border-bottom","outline","text-shadow"];const LENGTH_PROP_SET=new Set(["background-size","border","border-bottom","border-bottom-left-radius","border-bottom-right-radius","border-bottom-width","border-left","border-left-width","border-image","border-image-width","border-image-outset","border-radius","border-right","border-right-width","border-spacing","border-top","border-top-left-radius","border-top-right-radius","border-top-width","border-width","bottom","box-shadow","clip","column-gap","column-rule","column-rule-width","column-width","columns","filter","flex","flex-basis","font","font-size","grid","grid-auto-columns","grid-auto-rows","grid-column-gap","grid-gap","grid-row-gap","grid-template","grid-temlate-columns","grid-template-rows","height","min-height","width","min-width","max-width","line-height","left","letter-spacing","margin","margin-top","margin-bottom","margin-left","margin-right","max-height","object-position","outline","outline-offset","padding","padding-left","padding-right","padding-top","padding-bottom","perspective","outline-width","right","tab-size","text-indent","text-shadow","top","vertical-align","width","word-spacing"]);module.exports={COLOR_PROPS,COLOR_PROPS_MULTI,LENGTH_PROP_SET};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 OJPREFIX="oj-";module.exports=function(val){var classes,style,isExpr,i,j;isExpr=val.startsWith("[[")||val.startsWith("{{");val=_cleanStyle(val.toLowerCase());classes=val.split(" ");if(classes.length){for(i=0,j=0;i<classes.length;i++){style=classes[i].trim();if(style&&style.startsWith(OJPREFIX)){if(isExpr&&style.endsWith("-")){continue}classes[j++]=_cleanStyle(style.toLowerCase())}}classes.length=j}return classes};function _cleanStyle(style){return style.replace(/[\'\"\`\[\]\{\}\(\)\?\+:]/g,"").trim()};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 TEMPLATE="template";const OJ_BIND="oj-bind";const OJ_DEFER="oj-defer";const BODY="body";module.exports=function(ruleCtx,slotName){return _getSlotParent(ruleCtx,slotName)};function _getSlotParent(ruleCtx,slotName){var parent,isOjDefer=false,ret=null;parent=ruleCtx.tagNode.parent;isOjDefer=ruleCtx.tag==="oj-defer";if(parent&&parent.name){if(parent.name!==BODY){if(ruleCtx.utils.DomUtils.isSelfClosingTag(parent.name)){ret=_continueUpwards(ruleCtx,parent,slotName)}else{if(ruleCtx.utils.metaLib.isTagSlotName(parent.name,slotName)){ret=parent}}if(!ret){if(isOjDefer&&parent.name===TEMPLATE||parent.name==="oj-switcher"){ret=parent}else if(parent.name===TEMPLATE||parent.name.startsWith(OJ_BIND)||parent.name===OJ_DEFER){ret=_continueUpwards(ruleCtx,parent,slotName)}}}}return ret};function _continueUpwards(ruleCtx,tag,slotName){var ret=null,parent;parent=tag.parent;while(parent){if(parent.name===TEMPLATE||parent.name.startsWith(OJ_BIND)||parent.name===OJ_DEFER){parent=parent.parent;continue}if(parent.name!==BODY){if(ruleCtx.utils.metaLib.isTagSlotName(parent.name,slotName)){ret=parent}}break}return ret};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 SLOT="slot";module.exports=function(context){var node=context.tagNode;if(!context.utils.metaLib.hasTagSlot(context.tag)){node=_checkParentElems(context)}return node};function _checkParentElems(context){var parent,isOjDefer=false,ret=null;parent=context.tagNode.parent;isOjDefer=context.tag==="oj-defer";while(parent){if(parent&&parent.name){if(parent.name==="body"){break}ret=context.utils.metaLib.hasTagSlot(parent.name);if(ret){ret=parent;break}if(isOjDefer&&parent.name==="template"||parent.name==="oj-switcher"){ret=parent;break}}parent=parent.parent}return ret};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
function _find(members,a,index,context){var j,pos,c,data;var member=a[index];for(j=0;j<members.length;j++){if(members[j].name===member){if(index+1>=a.length){pos=members[j].pos;data=context.data;c=data.charAt(pos.index);if(c==="\""||c==="'")pos.index++;return pos}else{return _find(members[j].value.members,a,index+1,context)}}}context.utils.msgLib.assert("helper 'json-prop-pos' failure for '"+a.join(".")+"' <- "+context.filepath)};module.exports=function(context,propName){if(context.suppData.msg){return{line:0,col:0,index:0}}var ast=context.suppData.ast;var members=ast.members;var a,ret;var a=propName.split(".");a.forEach(function(v,index){a[index]=a[index].trim()});ret=_find(members,a,0,context);if(!ret){ret={row:0,col:0,index:0}}return ret};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
function _find(members,a,index,context){var member,props,pos,c,data,i,j;member=a[index];for(i=0;i<members.length;i++){if(members[i].name==="properties"){props=members[i];break}}if(props&&props.value&&props.value.members){props=props.value.members;for(j=0;j<props.length;j++){if(props[j].name===member){if(index+1>=a.length){pos=props[j].pos;data=context.data;c=data.charAt(pos.index);if(c==="\""||c==="'")pos.index++;return pos}else{return _find(props[j].value.members,a,index+1,context)}}}}for(j=0;j<members.length;j++){if(members[j].name===member){return members[j].pos}}context.utils.msgLib.assert("helper 'json-prop-pos' failure for '"+a.join(".")+"' <- "+context.filepath)};module.exports=function(context,propName){if(context.suppData.msg){return{line:0,col:0,index:0}}var members,a,ret;var ast=context.suppData.ast;members=ast.members;if(members){var a=propName.split(".");a.forEach(function(v,index){a[index]=a[index].trim()});ret=_find(members,a,0,context)}if(!ret){ret={row:0,col:0,index:0}}return ret};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 reMs=new RegExp(/\s+/,'g');const reInsertSp=new RegExp(/([\,\>])/,'g');const DOT='.';const COMMA=',';const GT='>';const STAR='*';const COLON_CLASS=':class';const OJ_BIND_FOR_EACH='oj-bind-for-each';const OJ_BIND_IF='oj-bind-if';const TEMPLATE='template';const SCRIPT='script';var _assertMsg;var _breakingTag=null;function match(ruleCtx,ss){var a,isGroup;if(Array.isArray(ss)){ss=ss.join(COMMA)}ss=_prepSS(ss);isGroup=ss.indexOf(COMMA)>0;a=ss.split(' ');if(a.length===0){return true}return a.length>1?_multi(ruleCtx,ss,a,isGroup):_single(ruleCtx,a[0])};function _single(ruleCtx,s){var elem,a,i;elem=ruleCtx.tag;if(s.charAt(0)===DOT){if(s.includes(DOT,1)){a=s.split(DOT);for(i=0;i<a.length;i++){if(!_testStyleOnTag(ruleCtx.tagNode.attribs,a[i])){return false}}return true}return _testStyleOnTag(ruleCtx.tagNode.attribs,s)}else{if(!s.includes(DOT,1)){return s===elem||s===STAR}a=s.split(DOT);if(a.length===2){return(elem===a[0]||elem===STAR)&&_testStyleOnTag(ruleCtx.tagNode.attribs,a[1])}_assertMsg(`UNHANDLED SS1 -> ${s} - '${ruleCtx.filepath}'`);return false}};function _multi(ruleCtx,ss,a,isGroup){if(isGroup){return _handleMultiGroup(ruleCtx,ss)}if(a.length===2){if(!a[0].startsWith(DOT)&&!a[1].startsWith(DOT)){if(a[0].includes(DOT,1)){if(ruleCtx.tag!==a[1]){return false}let s=a[0].split(DOT);return _findTagWithChainStyle(ruleCtx,ss,a)}if(a[1]!==STAR){if(ruleCtx.tag!==a[1]){return false}}return _findChildElem(ruleCtx,a[0]);_assertMsg(`UNHANDLED SS2 MULTI -> ${a.join(' ')} - '${ruleCtx.filepath}'`);return false}if(a[0].startsWith(DOT)&&!a[1].startsWith(DOT)){return(ruleCtx.tag===a[1]||a[1]===STAR)&&_findTagWithStyle(ruleCtx,'*',a[0])}else if(!a[0].startsWith(DOT)&&a[1].startsWith(DOT)){return _testStyleOnTag(ruleCtx.tagNode.attribs,a[1])&&_findParentTag(ruleCtx,a[0])}}if(a.length===3&&a[1]===GT){if(a[0].startsWith(DOT)&&!a[2].startsWith(DOT)){return(ruleCtx.tag===a[2]||a[2]===STAR)&&_findTagWithStyle(ruleCtx,'*',a[0],true)}else if(!a[0].startsWith(DOT)&&a[2].startsWith(DOT)){return _testStyleOnTag(ruleCtx.tagNode.attribs,a[0])&&_findParentTag(ruleCtx,a[2],true)}else if(!a[0].startsWith(DOT)&&!a[2].startsWith(DOT)){if(ruleCtx.tagNode.name===a[2]||a[2]===STAR){return _findChildElem(ruleCtx,a[0],true)}return false}_assertMsg(`UNHANDLED SS3 MULTI -> ${a.join(' ')} - '${ruleCtx.filepath}'`);return false}_assertMsg(`"UNHANDLED SS4 MULTI -> ${a.join(' ')} - '${ruleCtx.filepath}'`)};function _handleMultiGroup(ruleCtx,ss){var a,i;a=ss.split(COMMA);for(i=0;i<a.length;i++){a[i]=a[i].trim();if(match(ruleCtx,a[i])){return true}}return false};function _testStyleOnTag(attribs,style){var a,i;if(attribs){a=attribs.class||attribs[COLON_CLASS];if(!a){return false}if(_isExpr(a)){return true}a=a.replace(reMs,' ');a=a.split(' ');style=style.charAt(0)===DOT?style.substring(1):style;for(i=0;i<a.length;i++){if(a[i]===style){return true}}}return false};function _findTagWithStyle(ruleCtx,tag,style,direct){return _walkElemStackForTag(ruleCtx,tag,function(o){return _testStyleOnTag(o.attribs,style)},direct)};function _findTagWithChainStyle(ruleCtx,ss,a){return _walkElemStackForTag(ruleCtx,a[0],function(o){return _testStyleOnTag(o.attribs,a[1])},false)};function _findParentTag(ruleCtx,tag,direct){return _walkElemStackForTag(ruleCtx,tag,function(o){return true},direct)};function _findChildElem(ruleCtx,elem,direct){return _walkElemStackForTag(ruleCtx,elem,function(o){return o.name===elem||o.name===SCRIPT},direct)};function _walkElemStackForTag(ruleCtx,tag,cb,direct){var i,b,elem,name;var stack=ruleCtx.elemStack;_breakingTag=null;if(stack&&stack.length){b=false;for(i=stack.length-2;i>=0;i--){if(direct&&b){break}elem=stack[i];name=elem.name;if(name===OJ_BIND_IF||name===OJ_BIND_FOR_EACH||name===TEMPLATE){continue}if(elem.name===tag||tag===STAR||elem.name===SCRIPT){if(cb(elem)){_breakingTag=name;return true}}b=true}}return false};function _isExpr(s){var c=s.charAt(0);return c==='['||c==='{'};function _prepSS(ss){ss=ss.replace(reInsertSp,' $1').trim();return ss.replace(reMs,' ')};function setAssertMsg(fn){_assertMsg=fn};module.exports.match=match;module.exports.setAssertMsg=setAssertMsg;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
module.exports=function(attrName){return attrName&&/[a-zA-Z_$]/.test(attrName.charAt(0))};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 NT;const _GLOBAL="_@global";const ANON_FUNC_PREFIX="AnonFunc_";const COMMON=["oj","window","console","parseInt","parseFloat","setInterval","JSON","document","Number","BigInt","Math","Date","String","RegExp","arguments","Array","Promise","Object","Function","Boolean","Symbol","Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","Map","Set","WeakMap","WeakSet","Generator","GeneratorFunction","AsyncFunction","Reflection","Intl","WebAssembly","ArrayBuffer","SharedArrayBuffer","Atomics","DataView"];function VarTrack(){this._funcVarTable={};this._funcParentage={};this._funcStack=[];this._funcBlocks={};this._anonFuncSuffix=0;this._undeclared=null;this._nodeWithParent=[]};VarTrack.prototype.createFuncDeclarations=function(context,node){var args,arg,body,stmt,funcVars,funcName,i,n;NT=NT?NT:context.utils.AstUtils.getNodeTypes();funcName=this._pushFuncName(context,node);if(!funcName){return}if(this._funcVarTable[funcName]){return}funcVars=this._updateTrackingTable(node,false,funcName);args=node.params;for(i=0;i<args.length;i++){arg=args[i];if(arg.type===NT.IDENTIFIER){funcVars[arg.name]={type:"funcarg",pos:arg.start}}}body=node.body.body;for(i=0;i<body.length;i++){stmt=body[i];if(stmt.type===NT.VAR_DECLARATION){this._addVarToTrackingTable(stmt,funcVars)}else if(stmt.type===NT.FUNC_DECLARATION){this.createFuncDeclarations(context,stmt);this._popFuncName()}else if(stmt.type===NT.EXPR_STMT){var expr=stmt.expression;if(expr.type===NT.ASSIGNMENT_EXPR){n=expr.right;if(n.type===NT.FUNC_EXPR){this.createFuncDeclarations(context,n);this._popFuncName()}}}};return{funcVarTable:this._funcVarTable,funcVars:funcVars}};VarTrack.prototype.isFunctionKnown=function(context,node){var n;for(n in this._funcBlocks){n=this._funcBlocks[n];if(n===node){return true}}return false};VarTrack.prototype._addVarToTrackingTable=function(stmt,funcVars,global){var decls,decl,obj,i;decls=stmt.declarations;for(i=0;i<decls.length;i++){decl=decls[i];if(decl.type===NT.VAR_DECLARATOR){funcVars[decl.id.name]=obj={type:global?"globvar":"var"};obj.start=decl.start;if(decl.init){if(decl.init.type===NT.NEW_EXPR){obj.valType="new";if(decl.init.callee.type===NT.MEMBER_EXPR){if(decl.init.callee.object&&decl.init.callee.object.type===NT.IDENTIFIER){obj.obj=decl.init.callee.object.name;obj.class=decl.init.callee.property.name;obj.origClass=obj.class;obj.pos=decl.init.callee.object.start}}}else if(decl.init.type===NT.LITERAL){obj.valType="lit";obj.pos=decl.init.start}else if(decl.init.type===NT.CALL_EXPR){if(decl.init.callee.type===NT.IDENTIFIER){obj.valType="funcret";obj.func=decl.init.callee.name;obj.pos=decl.init.callee.start;if(obj.func==="$"){if(decl.init.arguments&&decl.init.arguments[0].type===NT.IDENTIFIER){if(decl.init.arguments[0].name==="window"){obj.funcarg="window"}}else if(decl.init.arguments&&decl.init.arguments[0].type===NT.LITERAL){if(decl.init.arguments[0].value==="body"){obj.funcarg="body"}}}}}else if(decl.init.type===NT.IDENTIFIER){obj.valType="var";obj.varName=decl.init.name;obj.pos=decl.init.start}}}}};VarTrack.prototype._updateTrackingTable=function(node,global,funcName){var funcVars;if(!funcName){funcName=global?_GLOBAL:node.id?node.id.name:this._makeAnonFuncName()}if(!this._funcVarTable[funcName]){this._funcVarTable[funcName]=funcVars={}}else{funcVars=this._funcVarTable[funcName]}return funcVars};VarTrack.prototype.isVarDefined=function(context,node,useNode,varName){var fnName,fnParent,funcVars;if(this.isCommonVar(context,varName)){return}if(this._funcVarTable[varName]){return}fnName=this.getContainingFunctionName(context,node);if(fnName){funcVars=this._funcVarTable[fnName];if(funcVars&&funcVars[varName]){this.setReferenced(funcVars,varName);return}fnParent=fnName;while(true){if(this._funcParentage[fnParent]){fnParent=this._funcParentage[fnParent];funcVars=this._funcVarTable[fnParent];if(funcVars&&funcVars[varName]){this.setReferenced(funcVars,varName);return}}else{break}}}funcVars=this._funcVarTable[_GLOBAL];if(funcVars&&funcVars[varName]){this.setReferenced(funcVars,varName);return}if(!this._undeclared){this._undeclared={}}if(!this._undeclared[varName+useNode.start]){this._undeclared[varName+"!@#$%"+useNode.start]=useNode}};VarTrack.prototype.setReferenced=function(funcVars,varName){funcVars[varName].used=true};VarTrack.prototype.getGlobalVars=function(context){var funcVars,prog,stmt,i;NT=NT?NT:context.utils.AstUtils.getNodeTypes();funcVars=this._updateTrackingTable(null,true);prog=context.utils.AstUtils.getProgram();if(!prog){return}for(i=0;i<prog.body.length;i++){stmt=prog.body[i];if(stmt.type===NT.FUNC_DECLARATION){continue}if(stmt.type===NT.VAR_DECLARATION){this._addVarToTrackingTable(stmt,funcVars,true)}}};VarTrack.prototype.reset=function(){this._funcVarTable={};this._funcStack=[];this._funcParentage={};this._funcBlocks={};this._anonFuncSuffix=0;this._undeclared=null};VarTrack.prototype._pushFuncName=function(context,node){var funcName=node.id?node.id.name:this._makeAnonFuncName();if(this._funcParentage[funcName])return false;this._funcParentage[funcName]=this.getContainingFunctionName(context,node);this._funcBlocks[funcName]=node;this._funcStack.push(funcName);return funcName};VarTrack.prototype._popFuncName=function(){return this._funcStack.pop()};VarTrack.prototype.getContainingFunctionName=function(context,node){var funcName,n,b;var block=context.utils.AstUtils.getBlock(node);NT=NT?NT:context.utils.AstUtils.getNodeTypes();if(block&&block.type===NT.PROGRAM){return null}if(block&&block.parent){if(block.parent.type===NT.FUNC_DECLARATION||block.parent.type===NT.FUNC_EXPR){if(block.parent.id&&block.parent.id.type===NT.IDENTIFIER){return block.parent.id.name}funcName=this._isAnonymousFunc(block.parent);if(funcName){return funcName}}b=block.parent;while(b){if(b.type===NT.FUNC_DECLARATION||b.type===NT.FUNC_EXPR){if(b.id&&b.id.type===NT.IDENTIFIER){return b.id.name}}b=b.parent}funcName=this._isAnonymousFunc(block);if(funcName){return funcName}}if(node.type===NT.FUNC_EXPR||node.type===NT.FUNC_DECLARATION){if(this._funcStack.length){return this._funcStack[this._funcStack.length-1]}}if(this._nodeWithParent.length){return this.getContainingFunctionName(context,this._nodeWithParent[this._nodeWithParent.length-1])}return null};VarTrack.prototype._makeAnonFuncName=function(){return ANON_FUNC_PREFIX+ ++this._anonFuncSuffix};VarTrack.prototype._isAnonymousFunc=function(block){var funcName,node;if(this._funcBlocks){for(funcName in this._funcBlocks){if(funcName.startsWith(ANON_FUNC_PREFIX)){node=this._funcBlocks[funcName];if(node===block){return funcName}}}}return null};VarTrack.prototype.isCommonVar=function(context,varName){return COMMON.includes(varName)};VarTrack.prototype.pushNodeWithParent=function(node){this._nodeWithParent.push(node)};VarTrack.prototype.popNodeWithParent=function(node){return this._nodeWithParent.pop()};VarTrack.prototype.getUndeclared=function(){return this._undeclared};VarTrack.prototype.dump=function(context){var func;console.log("----------------------VarTrack Dump----------------------------");if(!this._funcVarTable){console.log("* empty");return}if(this._funcVarTable[_GLOBAL]){this._dumpFunc(context,_GLOBAL,true)}for(func in this._funcVarTable){if(func===_GLOBAL){continue}this._dumpFunc(context,func,false)}console.log("--------------------End-VarTrack Dump--------------------------\n")};VarTrack.prototype._dumpFunc=function(context,func,g){var funcVars,v,o,p,loc,rowcol,indent=" ",indent2=" ";var rowcol_unknown={row:"?",col:"?"};var utils=context.utils.utils;if(this._funcParentage){p=this._funcParentage[func];if(!p){p="none"}}if(this._funcBlocks){loc=this._funcBlocks[func];loc=loc?utils.getRowColFromIndex(context.data,loc.start):rowcol_unknown}console.log("\n"+(g?"*global vars":func)+(g?"":"()")+(g?"":" - ("+loc.row+", "+loc.col+")")+(g?"":" parent: "+p));funcVars=this._funcVarTable[func];if(!funcVars||!utils.hasAnyProps(funcVars)){console.log(indent+"- none -");return}for(v in funcVars){o=funcVars[v];rowcol=context.data?utils.getRowColFromIndex(context.data,o.pos):rowcol_unknown;console.log(indent+v);console.log(indent2+"pos : "+"("+rowcol.row+", "+rowcol.col+")");if(o.type){console.log(indent2+"type : "+o.type)}if(o.valType){console.log(indent2+"valType : "+o.valType)}if(o.class){console.log(indent2+"class : "+o.class)}if(o.origClass){console.log(indent2+"origClass: "+o.origClass)}if(o.obj){console.log(indent2+"obj : "+o.obj)}}};module.exports=VarTrack;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 OJ="oj-";const MSG_TEXT="unknown JET CSS selector ";function getName(){return"jet-css-ojselector"};function getShortDescription(){return"JET CSS selector must be a defined JET style"};function getDescription(){return"JET CSS selector must be a defined JET style"};function register(){return{"selector":_handleSelector}};function _handleSelector(context,selectors){var selector,part,i,j;for(i=0;i<selectors.length;i++){selector=selectors[i];for(j=0;j<selector.parts.length;j++){part=selector.parts[j];if(part.type===8){_handleParts(context,part)}}}};function _handleParts(context,part){var auditState,modifier,args,arg,mods,mod,clazz,classNoDot,comment,msg,i,j,k,p;for(i=0;i<part.modifiers.length;i++){modifier=part.modifiers[i];if(modifier.type==="class"){clazz=modifier.text;classNoDot=clazz.substring(1);if(classNoDot.startsWith(OJ)){if(!context.metaLib.isStyle(classNoDot)){msg=MSG_TEXT+clazz;issue=new context.Issue(msg,context,{line:modifier.line,col:modifier.col});context.reporter.addIssue(issue,context);continue}}}else{if(!(modifier.args&&modifier.args.length))continue;args=modifier.args;for(j=0;j<args.length;j++){arg=args[j];if(arg.type===8){if(arg.modifiers&&arg.modifiers.length){mods=arg.modifiers;for(k=0;k<mods.length;k++){mod=mods[k];if(mod.type==="class"){clazz=mod.text;classNoDot=clazz.substring(1);if(classNoDot.startsWith(OJ)){if(!context.metaLib.isStyle(classNoDot)){msg=MSG_TEXT+clazz;issue=new context.Issue(msg,context,{line:modifier.line,col:modifier.col});context.reporter.addIssue(issue,context)}}}}}}}}}};module.exports.getName=getName;module.exports.getDescription=getDescription;module.exports.getShortDescription=getShortDescription;module.exports.register=register;
|
package/rules/jet/msgid.json
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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
|
+
{"oj-html-ojtag-deprecated":"0010","oj-html-ojtag-deprecated_1":"0011","oj-html-attr-json_1":"0020","oj-html-attr-json_2":"0021","oj-html-ojattr":"0040","oj-html-ojattr_1":"0041","oj-html-ojattr-520":"0040","oj-html-ojattr-value":"0060","oj-html-attr-2def":"0070","oj-html-attr-prefix-ro":"0073","oj-html-attr-prefix-expr":"0075","oj-html-attr-req":"0077","oj-html-ojattr-deprecated":"0080","oj-html-ojattr-deprecated_1":"0081","oj-html-ojattr-deprecated_2":"0082","oj-html-ojattr-deprecated_3":"0083","oj-html-ojattr-enum-deprecated":"0085","oj-html-ojevent":"0090","oj-html-jq-databind_1":"0100","oj-html-jq-databind_2":"0110","oj-html-jq-databind_3":"0120","oj-html-databind-all":"0130","oj-html-ojslot":"0140","oj-html-slot-name":"0150","oj-html-slot-pref-content":"0153","oj-html-slot-item-minmax":"0156","oj-html-slot-item-minmax_1":"0157","oj-html-binding-attr":"0160","oj-html-bindif-test":"0163","oj-html-bindforeach-data":"0165","oj-html-dlg-title":"0168","oj-html-attr-$unique_1":"0170","oj-html-attr-$unique_2":"0180","oj-html-tag-attr-noprefix":"0190","oj-html-label-for-prefix":"0195","oj-html-ojtag-globattr-noprefix":"0200","oj-html-ojtag-nonglobattr-prefix":"0210","oj-html-invalid-doctype":"0220","oj-html-invalid-doctype_1":"0221","oj-html-missing-doctype":"0230","oj-html-oj-lib":"0240","oj-html-ko-comment":"0250","oj-html-ko-databind":"0260","oj-html-cca-count":"0270","oj-html-cdn":"0280","oj-html-ojattr-evt-syntax":"0290","oj-html-ojtag-datacmd":"0310","oj-html-ojtag-datacmd_1":"0311","oj-html-ojtag-datacmd_2":"0312","oj-html-ojtag-datacmd_3":"0313","oj-html-ojtag-datactx":"0320","oj-html-wctag-id":"0330","oj-html-wctag-id_1":"0331","oj-html-wctag-id_2":"0332","oj-html-wctag-for":"0340","oj-html-wctag-arialabelledby":"0350","oj-html-wctag-$props":"0360","oj-html-wctag-$props_1":"0361","oj-html-form-bindif":"0370","oj-html-combo-converter":"0380","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","oj-html-ojtag-ns_2":"0387","oj-html-unsup-theme":"0390","oj-html-unsup-theme_1":"0391","oj-html-form-noflex":"0395","oj-html-5-tag-obs":"0400","oj-html-5-attr-obs_1":"0410","oj-html-5-attr-obs_2":"0411","oj-html-redwood-cssvars":"0420","oj-html-redwood-cssnovars":"0421","oj-html-template-index":"0425","oj-form-maxcols":"0430","oj-form-maxcols_1":"0431","oj-form-maxcols_2":"0432","oj-html-form-layout-maxcols":"0435","oj-html-file-pick-accept":"0450","oj-html-file-pick-accept_1":"0451","oj-html-file-pick-accept_2":"0452","oj-html-wctag-packprivate":"0465","oj-html-picker-attrs":"0470","oj-html-wctag-nested":"0480","oj-html-notag-style":"0490","oj-html-notag-style_1":"0491","oj-html-msgs-cat-text":"0495","oj-html-msgs-cat-text_1":"0496","oj-html-msgs-cat-text_2":"0497","oj-html-msgs-cat-text_3":"0498","oj-html-no-style-tag":"0505","oj-html-alta-deprecated":"0510","oj-acc-input-aria-label_1":"2000","oj-acc-input-aria-label_2":"2010","oj-acc-input-aria-label_3":"2020","oj-acc-input-aria-label_4":"2030","oj-acc-input-aria-label_5":"2031","oj-acc-input-aria-label_6":"2032","oj-acc-select-aria-label_1":"2040","oj-acc-select-aria-label_2":"2050","oj-acc-select-aria-label_3":"2060","oj-acc-select-aria-label_4":"2070","oj-acc-select-aria-label_5":"2071","oj-acc-select-aria-label_6":"2072","oj-acc-combobox-aria-label_1":"2080","oj-acc-combobox-aria-label_2":"2090","oj-acc-combobox-aria-label_3":"2100","oj-acc-combobox-aria-label_4":"2120","oj-acc-combobox-aria-label_5":"2121","oj-acc-combobox-aria-label_6":"2122","oj-acc-aria-labelledby":"2130","oj-acc-avatar-aria-role":"2140","oj-acc-film-strip-aria-label":"2150","oj-acc-aria-prop":"2160","oj-html-cca-tagname":"2200","oj-html-cca-tagname_1":"2201","oj-html-cspexpr":"2210","oj-html-cspexpr_1":"2211","oj-js-ojcomp-deprecated":"3000","oj-js-comp-meth-deprecated":"3020","oj-js-comp-meth-deprecated_1":"3022","oj-js-comp-meth-deprecated_2":"3023","oj-js-comp-attr-deprecated":"3025","oj-js-comp-attr-deprecated_1":"3026","oj-js-comp-attr-deprecated_2":"3027","oj-js-ojcomp-new":"3060","oj-js-ojcomp-exist":"3070","oj-js-ojcomp-exist_1":"3071","oj-js-var-undef":"3080","oj-js-var-undef_1":"3082","oj-js-poly-promise":"3090","oj-js-noconsole":"3100","oj-js-no-ext-final":"3200","oj-ts-ojcomp-deprecated":"3400","oj-ts-comp-meth-deprecated":"3420","oj-ts-comp-meth-deprecated_1":"3422","oj-ts-comp-meth-deprecated_2":"3423","oj-ts-comp-attr-deprecated":"3425","oj-ts-comp-attr-deprecated_1":"3426","oj-ts-comp-attr-deprecated_2":"3427","oj-ts-ojcomp-new":"3440","oj-ts-ojcomp-exist":"3445","oj-ts-ojcomp-exist_1":"3450","oj-ts-poly-promise":"3455","oj-ts-noconsole":"3460","oj-ts-no-ext-final":"3465","oj-json-syntax":"4000","oj-cca-comp-json-file":"9000","oj-cca-comp-json-schema":"9005","oj-cca-comp-json-compdeps":"9010","oj-cca-comp-zip":"9015","oj-cca-comp-zip-type":"9020","oj-cca-comp-zip-content":"9025","oj-cca-comp-zip-content-case":"9030","oj-cca-compjson-bp-obj":"9040","oj-cca-compjson-bp-ar":"9043","oj-cca-compjson-ns-reg":"9046","oj-cca-compjson-ns-reg_1":"9047","oj-cca-compjson-bp-jetver":"9049","oj-cca-compjson-bp-dsplyname":"9052","oj-html-style":"5000","oj-html-style_1":"5001","oj-html-style-deprecated":"5010","oj-html-ojstyle":"5015","oj-html-style-bp-color":"5020","oj-html-style-bp-font":"5025","oj-html-style-bp-display":"5030","oj-html-self-close":"5035","oj-html-style-bp-font-family":"5040","oj-html-style-abs-units":"5045","oj-html-style-abs-units_1":"5046","oj-html-style-abs-units_2":"5047","oj-html-stylesel":"5080","oj-html-stylesel_1":"5081","oj-html-stylesel_2":"5082","oj-html-stylesel_3":"5083","oj-html-stylesel_4":"5084","oj-html-stylesel_5":"5085","oj-html-stylesel_6":"5086","oj-html-stylesel_7":"5087","oj-html-input-isodate":"5095","oj-html-input-isodate_1":"5096","oj-html-input-isodate_2":"5097","oj-html-input-isodate_3":"5098","oj-html-input-isodate_4":"5099","oj-html-input-isodate_5":"5100","oj-html-input-isodate_6":"5101","oj-html-input-isodate_7":"5102","oj-html-input-isodate_8":"5103","oj-html-input-isodate_9":"5104","oj-css-style-override_1":"6010","oj-css-style-override_2":"6011","oj-css-style-bp-color":"6015","oj-css-style-deprecated":"6020","oj-css-style-bp-font":"6025","oj-css-style-bp-display":"6030","oj-css-style-bp-font-family":"6035","oj-css-style-abs-units":"6040","oj-css-style-abs-units_1":"6041","oj-css-bp-float":"6045","oj-css-bp-float_1":"6046","oj-css-bp-textalign":"6050","oj-css-bp-textalign_1":"6051","oj-css-bp-border-color":"6060","oj-css-bp-border-color_1":"6061","oj-css-var-override":"6065","oj-css-var-override_1":"6066","oj-css-bp-dir-flow":"6070"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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="oj-acc-aria-labelledby";const ARIA_LABELLEDBY="aria-labelledby";const DATABIND="data-bind";const ATTR="attr";const DESCRIPTION="The <i>'aria-labelledby'</i> attribute contains the element id of another element to provide a relationship between an object and its label. The label ID can be provided by an 'id' or a JET 'label-id' attribute. e.g. <p><oj-label id=\"groupReadonly\" label-id=\"groupReadonly\" class=\"oj-label\">Read Only switches</oj-label><br><oj-switch id=\"switch-1\" readonly aria-labelledby=\"groupReadonly\"></oj-switch><br>";function getName(){return RULE_NAME};function getShortDescription(){return"JET 'aria-labelledby' attribute must refer to an element 'id' or 'label-id' attribute"};function getDescription(){return DESCRIPTION};function register(){return{"attr":_handleAttr}};function _handleAttr(ruleCtx,attrName,attrValue){var attr,node,issue;var ids,i;if(attrName===DATABIND){attr=ruleCtx.utils.DomUtils.extractAttribsFromDataBind(attrValue);if(attr&&attr[ARIA_LABELLEDBY]){attrName=ARIA_LABELLEDBY;attrValue=attr[ARIA_LABELLEDBY]}}if(attrName!==ARIA_LABELLEDBY||_isExpression(attrValue)){return}ids=attrValue.split(" ");for(i=0;i<ids.length;i++){ids[i]=ids[i].trim();if(ids.length){if(_isExpression(ids[i])){continue}node=ruleCtx.utils.DomUtils.getElemById(ids[i],true);if(!node){issue=new ruleCtx.Issue("<"+ruleCtx.tagNode.name+"> 'aria-labelledby' attribute '"+ids[i]+"' has no matching element with same id");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _isExpression(s){return /[(}{}+*\/]/.test(s)};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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="oj-acc-aria-prop";const ARIA="aria-";const DESCRIPTION="Attributes beginning with <i>'aria-'</i> must be valid WAI-ARIA definitions.";const ARIA_LIST=["aria-atomic","aria-busy","aria-controls","aria-describedat","aria-describedby","aria-disabled","aria-dropeffect","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-autocomplete","aria-checked","aria-disabled","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-multiline","aria-multiselectable","aria-orientation","aria-pressed","aria-readonly","aria-required","aria-selected","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-dropeffect","aria-grabbed","aria-activedescendant","aria-flowto","aria-posinset","aria-setsize"];function getName(){return RULE_NAME};function getShortDescription(){return"'aria' attribute must be a valid WAI-ARIA definition."};function getDescription(){return DESCRIPTION};function register(){return{"elem":_handle}};function _handle(ruleCtx){var attribs,attrib,attrPos,issue;attribs=ruleCtx.tagNode.attribs;if(attribs){for(attrib in attribs){if(attrib.startsWith(ARIA)&&!ARIA_LIST.includes(attrib)){issue=new ruleCtx.Issue("<"+ruleCtx.tagNode.name+"> '"+attrib+"' is not a valid WAI-ARIA definition");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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="oj-acc-avatar-aria-role";const ROLE="role";const ARIA_LABEL="aria-label";const ARIA_LABELLEDBY="aria-labelledby";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"<oj-avatar> must have an 'aria-label' or 'aria-labelledby' attribute if role=\"img\" has been specified"};function getDescription(){return"For accessibility, <oj-avatar> must have an <i>'aria-label'</i> or </i>'aria-labelledby'</i> attribute if <i>role='img'</i> has been specified"};function register(){return{"<oj-avatar>":_onTag}};function _onTag(ruleCtx){var attribs,attrib,hasLabel,attr,issue;var DomUtils=ruleCtx.utils.DomUtils;var attrPos;if(!DomUtils.hasAttrib(ruleCtx.node,ROLE)||DomUtils.getAttribValue(ruleCtx.node,ROLE)!=="img"){return}attribs=ruleCtx.node.attribs;if(_hasAttrib(attribs,DATABIND)){attrib=attribs["data-bind"];attr=DomUtils.extractAttribsFromDataBind(attrib);if(attr){hasLabel=attr[ARIA_LABEL]||attr[ARIA_LABELLEDBY]}}else{hasLabel=_hasAttrib(attribs,ARIA_LABEL)||_hasAttrib(attribs,ARIA_LABELLEDBY)}if(!hasLabel){issue=new ruleCtx.Issue("'role' attribute of 'img' specified on <oj-avatar>, but 'aria-label' or 'aria-labelledby' is missing");attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,"role");issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _hasAttrib(attribs,attrName){var attrib,ret=false;for(attrib in attribs){attrib=attrib.charAt(0)===":"?attrib.substr(1):attrib;if(attrib===attrName){ret=true;break}}return ret};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 helper=require("./helpers/acc-aria-label");const RULE_NAME="oj-acc-combobox-aria-label";const DESCRIPTION="For accessibility, a combobox element must have a matching <oj-label> with a <i>'for'</i> matching the input <i>'id'</i>"+", or an <i>aria-label</i> attribute.<p>If 'label-hint' is specified and 'label-edge' is not, the default "+"value for 'label-edge' is theme dependant (refer to configuration property 'theme'), and label generation may be affected.<p>"+"Set 'label-hint' or associate an 'oj-label'. If there is no visible label, then to make this accessible to screen readers, set "+"'label-hint' and label-edge='none' - this will render an 'aria-label' with the 'label-hint' text.";const SHORT_DESCRIPTION="For accessibility, a combobox element must have a matching <oj-label> with a 'for' matching the combobox 'id'";class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._theme=regCtx.config.theme;return{"<oj-combobox-many>":this._onCombo,"<oj-combobox-one>":this._onCombo}}_onCombo(ruleCtx,tagName){var issues;if(issues=helper(ruleCtx,tagName,this._theme)){issues.forEach(issue=>{ruleCtx.reporter.addIssue(issue,ruleCtx)})}}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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="oj-acc-film-strip-aria-label";function getName(){return RULE_NAME};function getShortDescription(){return"<oj-film-strip> must have an 'aria-label' or an 'aria-labelledby' attribute"};function getDescription(){return"For accessibility, <oj-film-strip> must have an <i>'aria-label'</i> or an 'aria-labelledby'</i> attribute."};function register(){return{"<oj-film-strip>":_onTag}};function _onTag(ruleCtx){var attribs,attrib,attrib2,haveAriaLabel,dataBind,issue;if(!(attribs=ruleCtx.node.attribs)){return}for(attrib in attribs){attrib2=attrib.charAt(0)===":"?attrib.substr(1):attrib;if(attrib2==="aria-label"||attrib2==="aria-labelledby"){haveAriaLabel=true;break}else if(attrib2==="data-bind"){dataBind=attrib2}}if(!haveAriaLabel&&dataBind){dataBind=ruleCtx.utils.DomUtils.getAttribValue(ruleCtx.node,dataBind);haveAriaLabel=_inspectDataBind(dataBind)}if(!haveAriaLabel){issue=new ruleCtx.Issue("'aria-label' or 'aria-labelledby' missing on <oj-film-strip>");ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _inspectDataBind(attr){var ret=false,i;attr=attr?attr.trim().toLowerCase():null;if(!attr||!attr.length){return ret}i=attr.indexOf("attr");if(i<0){return ret}attr=attr.substr(i+4).trim();if(attr.length){if(attr.charAt(0)===":"){attr=attr.substr(1).trim();if(attr.charAt(0)==="{"){attr=attr.substr(1).trim().split(":");if(attr.length>1){attr[0]=attr[0].trim();ret=attr[0].indexOf("aria-label")>=0||attr[0].indexOf("aria-labelledby")>=0}}}}return ret};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 helper=require("./helpers/acc-aria-label");const RULE_NAME="oj-acc-input-aria-label";const DESCRIPTION="For accessibility, an input element must have a matching <oj-label> with a <i>'for'</i> matching the input <i>'id'</i>"+", or an <i>aria-label</i> attribute.<br>If 'label-hint' is specified and 'label-edge' is not, the default "+"value for 'label-edge' is theme dependant (refer to configuration property 'theme'), and label generation may be affected.<br>"+"Set 'label-hint' or associate an 'oj-label'. If there is no visible label, then to make this accessible to screen readers, set "+"'label-hint' and label-edge='none' - this will render an 'aria-label' with the 'label-hint' text.";const SHORT_DESCRIPTION="For accessibility, an input element must have a matching <oj-label> with a 'for' matching the input 'id'";class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._theme=regCtx.config.theme;return{"<oj-input-date>":this._onInput,"<oj-input-date-time>":this._onInput,"<oj-input-number>":this._onInput,"<oj-input-password>":this._onInput,"<oj-input-search>":this._onInput,"<oj-input-text>":this._onInput,"<oj-input-time>":this._onInput}}_onInput(ruleCtx,tagName){var issues;if(ruleCtx.utils.DomUtils.isChildOfElem("oj-table",ruleCtx.node)||ruleCtx.utils.DomUtils.isChildOfElem("oj-data-grid",ruleCtx.node)){return}if(issues=helper(ruleCtx,tagName,this._theme)){issues.forEach(issue=>{ruleCtx.reporter.addIssue(issue,ruleCtx)})}}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 helper=require("./helpers/acc-aria-label");const RULE_NAME="oj-acc-select-aria-label";const DESCRIPTION="For accessibility, a select element must have a matching <oj-label> with a <i>'for'</i> matching the input <i>'id'</i>"+", or an <i>aria-label</i> attribute.<br>If 'label-hint' is specified and 'label-edge' is not, the default "+"value for 'label-edge' is theme dependant (refer to configuration property 'theme'), and label generation may be affected.<br>"+"Set 'label-hint' or associate an 'oj-label'. If there is no visible label, then to make this accessible to screen readers, set "+"'label-hint' and label-edge='none' - this will render an 'aria-label' with the 'label-hint' text.";const SHORT_DESCRIPTION="For accessibility, a select element must have a matching <oj-label> with a 'for' matching the select 'id'";class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._theme=regCtx.config.theme;return{"<oj-select-many>":this._onSelect,"<oj-select-single>":this._onSelect,"<oj-select-one>":this._onSelect}}_onSelect(ruleCtx,tagName){var issues;if(issues=helper(ruleCtx,tagName,this._theme)){issues.forEach(issue=>{ruleCtx.reporter.addIssue(issue,ruleCtx)})}}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 helperPos=require('./helpers/json-propname-pos');const helperProp=require('./helpers/bp-checkPropType');const RULE_NAME='oj-cca-compjson-bp-ar';function getName(){return RULE_NAME};function getShortDescription(){return'Web component component.json metadata should follow best practices and avoid \'array\' properties'};function getDescription(){return'For best practices, web component property definitions should avoid use of unqualified property type \'array\', and provide a more complete definition of the API using a closure type definition'};function register(){return{'compjson-composite':_handle}};function _handle(ruleCtx,obj){var json,props,prop,propObj,propType,issue,msg,pos,i;json=obj.obj;if(json.properties){props=helperProp(json.properties,'a');if(props){for(i=0;i<props.length;i++){prop=props[i];propObj=prop.includes('.')?_getPropObject(json.properties,prop):json.properties[prop];propType=propObj.type;if(propType.indexOf('<')>=0){continue}msg='property \''+prop+'\': unqualified type \'array\'. Provide a more complete API definition using a closure type definition';issue=new ruleCtx.Issue(msg);pos=helperPos(ruleCtx,prop);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _getPropObject(properties,propName){var propObj,a,i;a=propName.split('.');for(i=0;i<a.length;i++){propObj=properties[a[i]];if(propObj.properties){properties=propObj.properties}}return propObj}module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 helperPos=require("./helpers/json-propname-pos");const RULE_NAME="oj-cca-compjson-bp-dsplyname";function getName(){return RULE_NAME};function getShortDescription(){return"Best practices for component.json 'displayName'"};function getDescription(){return"Best Practices for component.json metadata require that attribute 'displayName' should be defined for the component, or a property"};function register(regCtx){return{"compjson-composite":_handle,"compjson-pack":_handle}};function _handle(ruleCtx,obj){var o;o=obj&&obj.obj;if(!o){return}_check(ruleCtx,null,o,null,true);_recurseProps(ruleCtx,o)};function _recurseProps(ruleCtx,o,soFar){var propName,prop,propPath;soFar=soFar||"";if(!o.properties){return}for(propName in o.properties){prop=o.properties[propName];propPath=soFar+(soFar?".":"")+propName;_check(ruleCtx,propName,prop,propPath,false);if(prop.properties){_recurseProps(ruleCtx,prop,propPath)}}};function _check(ruleCtx,propName,o,soFar,topLevel){var dsplyName,issue,pos,theProp;dsplyName=o.displayName;if(!dsplyName){if(topLevel){issue=new ruleCtx.Issue("'displayName' should be defined at top level - best practices")}else{issue=new ruleCtx.Issue("'displayName' for property '"+(soFar?soFar:propName)+"' should be defined - best practices");theProp=soFar?soFar:propName;pos=helperPos(ruleCtx,theProp);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+(theProp.length-1):0)}}else if(typeof dsplyName!=="string"){if(!ruleCtx.rulePack.isRuleEnabled("oj-cca-compjson-prop-types","EXCH")){if(topLevel){issue=new ruleCtx.Issue("'displayName' property is invalid")}else{issue=new ruleCtx.Issue("'displayName' for property '"+(soFar?soFar:propName)+"' is invalid")}issue.setSeverity("blocker");pos=helperPos(ruleCtx,(soFar?soFar+".":"")+(dsplyName?"displayName":propName));issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0)}}if(issue){ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 helperPos=require("./helpers/json-propname-pos");const RULE_NAME="oj-cca-compjson-bp-jetver";const SHORT="Best practices for component.json property 'jetVersion'";const LONG="Best Practices for component.json metadata:<br>"+"The 'jetVersion' semver range should be capped. That is, not an open-ended 'jetVersion' "+"property - e.g. '>=7.20'<br>"+"The 'jetVersion' should generally represent some degree of range and not be "+"hard-coded to just one version of JET - e.g. '7.2.0'.<br>"+"The 'jetVersion' semver range in the component metadata should match/include the JAF configuration 'jetVer'.<br>"+"It is recommended that custom component owners re-certify their components at MAJOR version boundaries of JET, and update their metadata accordingly.";function Rule(){this._jetvers=null}Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return LONG};Rule.prototype.register=function(){return{"compjson-composite":this._handle,"compjson-pack":this._handle}};Rule.prototype._handle=function(ruleCtx,obj){var jetver,o,x,actual,keys,keysLC=[],pos,issue,bad;o=obj&&obj.obj;if(!o){return}keys=Object.keys(o);keys.forEach(function(s){keysLC.push(s.toLowerCase())});x=keysLC.indexOf("jetversion");if(x>=0){jetver=o[keys[x]];actual=keys[x]}if(!jetver){issue=new ruleCtx.Issue("'jetVersion' property is missing");issue.setSeverity("blocker");issue.setPosition(0,0,0,0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!ruleCtx.rulePack.isRuleEnabled("oj-cca-compjson-prop-types","EXCH")){if(typeof jetver!=="string"){issue=new ruleCtx.Issue("'jetVersion' property '"+jetver+"' is not a valid range or semver");issue.setSeverity("blocker");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}}bad=typeof jetver!=="string";if(bad||!ruleCtx.utils.semVerUtils.isValidRange(jetver)){if(bad&&ruleCtx.rulePack.isRuleEnabled("oj-cca-compjson-prop-types","EXCH")){return}issue=new ruleCtx.Issue("'jetVersion' property '"+jetver+"' is not a valid range or semver");issue.setSeverity("blocker");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!_isPossibleRange(jetver)){issue=new ruleCtx.Issue("'jetVersion' semver property '"+jetver+"' should not be absolute");issue.setSeverity("minor");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(_isOpenEndedRange(jetver)){issue=new ruleCtx.Issue("'jetVersion' semver property '"+jetver+"' should not be open-ended - best practices");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!this._isMatchVersions(ruleCtx,jetver)){issue=new ruleCtx.Issue("'jetVersion' semver property '"+jetver+"' does not match any supported JET versions");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(ruleCtx.utils.semVerUtils.match(jetver)){return true}{issue=new ruleCtx.Issue("'jetVersion' semver property '"+jetver+"' does not match audit run JET version '"+ruleCtx.utils.semVerUtils.getReference()+"'");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}};function _isPossibleRange(ver){const initRange=["^",">","<","=","~"];const intraRange=["-",">","<"];var s,ret=false;s=ver.charAt(0);if(initRange.includes(s)||intraRange.includes(s)||ver.indexOf("-")>3){ret=true}return ret};function _isOpenEndedRange(ver){var ret=false;const openChars=[">"];if(openChars.includes(ver.charAt(0))){if(ver.indexOf("-")<0&&ver.indexOf("<")<0){ret=true}}return ret};Rule.prototype._isMatchVersions=function(ruleCtx,jetver){var ver;if(!this._jetvers){this._jetvers=ruleCtx.utils.metaLib.getMetaVers();this._jetvers=this._jetvers.versions}for(ver in this._jetvers){if(ruleCtx.utils.semVerUtils.satisfiesRange(ver,jetver)){return true}}return false};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 helperPos=require('./helpers/json-propname-pos');const helperProp=require('./helpers/bp-checkPropType');const RULE_NAME='oj-cca-compjson-bp-obj';function getName(){return RULE_NAME};function getShortDescription(){return'Web component component.json metadata should follow best practices and avoid \'object\' type properties'};function getDescription(){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'};function register(){return{'compjson-composite':_handle}};function _handle(ruleCtx,obj){var json,props,prop,issue,msg,pos,i;json=obj.obj;if(json.properties){props=helperProp(json.properties,'o');if(props){for(i=0;i<props.length;i++){prop=props[i];if(_hasSub_properties(json.properties,prop)){continue}msg='property \''+prop+'\': type \'object\' has no sub-properties. Provide a more complete API definition using sub-properties or a closure type definition';issue=new ruleCtx.Issue(msg);pos=helperPos(ruleCtx,prop);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _hasSub_properties(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={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 RULENAME="oj-cca-compjson-ns-reg";const SHORT="Web component namespaces starting with 'oj-' or 'ns-' must be registered.";const LONG="Web components namespaces starting with prefixes 'oj-' or 'ns-' must be registered. A component must not use an un-registered namespace.";class Rule{getName(){return RULENAME}getShortDescription(){return SHORT}getDescription(){return LONG}register(regCtx){this._nameSpaces=regCtx.config.nameSpaces;return{"compjson":this._onCompJson}}_onCompJson(ruleCtx,suppData){var name,o,compType,a,i,prefix,msg;o=suppData&&suppData.obj?suppData.obj:null;name=o?o.name:null;if(!name){return}if(name.startsWith("demo-")||name.startsWith("my-")){return}name=(o.pack?o.pack+"-":"")+name;compType=o.type||"composite";if(typeof compType!=="string"||typeof name!=="string"){return}a=name.split("-");if(name.startsWith("oj-")||name.startsWith("ns-")){if(a.length>=2){prefix=a[0]+"-"+a[1];if(!ruleCtx.utils.metaLib.isNSRegistered(prefix)){if(!ruleCtx.utils.metaLib.isJetTag(name)){msg=`'${name}' : unregistered use of '${name.substring(0,2)}' namespace`;_emitIssue(ruleCtx,suppData,msg)}}}}}}function _emitIssue(ruleCtx,suppData,msg,id){var issue,pos;issue=new ruleCtx.Issue(msg);pos=_getNamePos(suppData.ast);if(pos){issue.setPosition(pos)}if(id){issue.setMsgKey(RULENAME+"_"+id)}ruleCtx.reporter.addIssue(issue,ruleCtx)};function _getNamePos(ast){var props,name,pos,ret=null,i;if(ast&&ast.members){props=ast.members;for(i=0;i<props.length;i++){name=props[i];if(name.name==="name"){pos=name.pos;ret={line:pos.row,col:pos.col,startIndex:pos.index,endIndex:pos.index+5};break}}}return ret};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, 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 RULENAME="oj-css-bp-border-color";const DESCRIPTION="Use of CSS 'border' color is discouraged - use the JET border classes";const SHORT_DESCRIPTION="Use of CSS 'border' color is discouraged - use the JET border classes";const BORDER_COLOR_PROPS=["border-bottom-color","border-color","border-left-color","border-right-color","border-top-color"];class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._CssUtils=regCtx.utils.CssUtils;return{"css-rule":this._onRule,"style":this._onStyle}}_onRule(ruleCtx,rule){var block,decl,issue,i;block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type==="Declaration"&&_isBorderColorProp(decl.property)&&!_isCssVar(decl)){issue=new ruleCtx.Issue(`Use of CSS '${decl.property}' is discouraged - best practices: replace with JET border classes`);issue.setPosition(this._CssUtils.getPosition(ruleCtx,decl.loc));ruleCtx.reporter.addIssue(issue,ruleCtx)}}}_onStyle(ruleCtx,attr,value){var prop,issue,s,x,i;for(i=0;i<value.length;i++){s=value[i];x=s.indexOf(":");if(x>=0){prop=s.substring(0,x).trimEnd();if(BORDER_COLOR_PROPS.includes(prop)){issue=new ruleCtx.Issue(`use of '${prop}' property ('style' attribute) is discouraged - best practices: replace with JET border classes`);issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}function _isBorderColorProp(prop){return BORDER_COLOR_PROPS.includes(prop)};function _isCssVar(decl){var c,v;c=decl.value.children;if(c){v=c[0];return v.name==="var"}return false};module.exports=Rule;
|