@oracle/oraclejet-audit 10.0.0 → 11.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jaf-amd.js +12 -4
- package/jaf.js +6 -1
- package/jafapi.js +6 -1
- package/lib/AST.js +6 -1
- package/lib/AST_Ts.js +6 -1
- package/lib/AstJson.js +6 -1
- package/lib/AstNodeTypes.js +6 -1
- package/lib/Comments.js +6 -1
- package/lib/ComponentSvcs.js +5 -0
- package/lib/Components.js +6 -1
- package/lib/Config.js +6 -1
- package/lib/ConfigLib.js +6 -1
- package/lib/CssLib.js +5 -0
- package/lib/CssUtils.js +5 -0
- package/lib/DomUtils.js +6 -1
- package/lib/FileIndex.js +5 -0
- package/lib/FileSet.js +5 -0
- package/lib/FsUtils.js +6 -1
- package/lib/Histo.js +6 -0
- package/lib/HtmlTree.js +6 -1
- package/lib/HtmlUtils.js +5 -0
- package/lib/Issue.js +5 -0
- package/lib/JafEvents.js +5 -0
- package/lib/JafLib.js +6 -1
- package/lib/Json.js +6 -0
- package/lib/JsonLoader.js +6 -1
- package/lib/MetaLib.js +6 -1
- package/lib/NetUtils.js +5 -0
- package/lib/NodeTypes.js +5 -0
- package/lib/Parser.js +6 -1
- package/lib/RegTypes.js +5 -0
- package/lib/Registry.js +5 -0
- package/lib/Reporter.js +5 -0
- package/lib/RuleContext.js +5 -0
- package/lib/RulePack.js +5 -0
- package/lib/RuleSet.js +6 -1
- package/lib/Rules.js +6 -1
- package/lib/Scope.js +6 -1
- package/lib/SemVer.js +5 -0
- package/lib/Server.js +5 -0
- package/lib/SevLib.js +5 -0
- package/lib/Severity.js +6 -1
- package/lib/Stats.js +6 -0
- package/lib/Ts.js +6 -1
- package/lib/Utils.js +6 -1
- package/lib/Watch.js +5 -0
- package/lib/Writer.js +5 -0
- package/lib/ZipUtils.js +5 -0
- package/lib/api.js +6 -0
- package/lib/cliStats.js +6 -0
- package/lib/clone.js +5 -0
- package/lib/cmdline.js +6 -1
- package/lib/colors.js +5 -0
- package/lib/exportRules.js +6 -0
- package/lib/extends.js +6 -0
- package/lib/filetypes.js +6 -0
- package/lib/groups.js +6 -0
- package/lib/help.js +6 -1
- package/lib/imanual.js +6 -0
- package/lib/jetver.js +6 -1
- package/lib/macros.js +6 -0
- package/lib/metaLoader.js +5 -0
- package/lib/metahist.js +5 -0
- package/lib/msgidLoader.js +6 -1
- package/lib/ns.js +6 -1
- package/lib/nslist.js +6 -1
- package/lib/outFormat.js +6 -0
- package/lib/outfile.js +5 -0
- package/lib/ruleLoader.js +5 -0
- package/lib/scaffold.js +6 -1
- package/lib/scaffoldRule.js +6 -1
- package/lib/schema.js +5 -0
- package/lib/scopewalker.js +6 -0
- package/lib/spinner.js +5 -0
- package/lib/spinnernoop.js +5 -0
- package/lib/tabs.js +5 -0
- package/lib/xmanual.js +6 -0
- package/libext/expparser.js +6 -1
- package/meta/10.1.0/jetauditmeta.js +9 -0
- package/meta/11.0.0/jetauditmeta.js +9 -0
- package/meta/11.1.0/jetauditmeta.js +9 -0
- package/meta/metaverlist.json +1 -1
- package/package.json +2 -3
- package/rulepacks/csp/csp-html-script-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-html-style-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-html-unsafe-expr.js +5 -0
- package/rulepacks/csp/csp-js-script-unsafe-eval.js +6 -1
- package/rulepacks/csp/csp-js-style-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-ts-script-unsafe-eval.js +6 -0
- package/rulepacks/csp/csp-ts-style-unsafe-inline.js +6 -0
- package/rulepacks/csp/msgid.json +6 -1
- package/rulepacks/csp/rules.json +6 -1
- package/rulepacks/jetwc/jetwc-absolute-jetversion.js +6 -1
- package/rulepacks/jetwc/jetwc-aria-redefinition.js +6 -1
- package/rulepacks/jetwc/jetwc-bootstrap.js +6 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +6 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +6 -1
- package/rulepacks/jetwc/jetwc-component-dependencies.js +6 -1
- package/rulepacks/jetwc/jetwc-component-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-component-foldername.js +6 -1
- package/rulepacks/jetwc/jetwc-component-location.js +6 -1
- package/rulepacks/jetwc/jetwc-component-type.js +6 -1
- package/rulepacks/jetwc/jetwc-data-property-prefix.js +6 -1
- package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +6 -1
- package/rulepacks/jetwc/jetwc-disabled-property.js +6 -1
- package/rulepacks/jetwc/jetwc-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +6 -1
- package/rulepacks/jetwc/jetwc-dynamic-slots-naming.js +6 -1
- package/rulepacks/jetwc/jetwc-event-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-events.js +6 -1
- package/rulepacks/jetwc/jetwc-jet-version.js +6 -1
- package/rulepacks/jetwc/jetwc-loader-file.js +6 -1
- package/rulepacks/jetwc/jetwc-method-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-methods.js +6 -1
- package/rulepacks/jetwc/jetwc-namespace.js +6 -1
- package/rulepacks/jetwc/jetwc-nested-defaults.js +6 -1
- package/rulepacks/jetwc/jetwc-nls-languages.js +6 -1
- package/rulepacks/jetwc/jetwc-nls-root.js +6 -1
- package/rulepacks/jetwc/jetwc-oj-register.js +6 -1
- package/rulepacks/jetwc/jetwc-ojcss.js +6 -1
- package/rulepacks/jetwc/jetwc-pack-children.js +6 -1
- package/rulepacks/jetwc/jetwc-packable-components.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-pattern.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-version.js +6 -1
- package/rulepacks/jetwc/jetwc-property-changed.js +6 -1
- package/rulepacks/jetwc/jetwc-property-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-property-nesting.js +6 -1
- package/rulepacks/jetwc/jetwc-public-modules.js +6 -1
- package/rulepacks/jetwc/jetwc-register-css.js +6 -1
- package/rulepacks/jetwc/jetwc-register-with-promises.js +6 -1
- package/rulepacks/jetwc/jetwc-require-paths.js +6 -1
- package/rulepacks/jetwc/jetwc-required-subproperty.js +6 -0
- package/rulepacks/jetwc/jetwc-reserved-property.js +6 -1
- package/rulepacks/jetwc/jetwc-schema.js +6 -1
- package/rulepacks/jetwc/jetwc-semantic-version.js +6 -1
- package/rulepacks/jetwc/jetwc-slot-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-standard-files.js +6 -1
- package/rulepacks/jetwc/jetwc-subproperty-writeback.js +6 -0
- package/rulepacks/jetwc/jetwc-template-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-unused-events.js +6 -1
- package/rulepacks/jetwc/jetwc-unused-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-vb-category.js +6 -1
- package/rulepacks/jetwc/jetwc-vb-icon.js +6 -1
- package/rulepacks/jetwc/jetwc-version-openrange.js +6 -1
- package/rulepacks/jetwc/jetwc-writeback-required.js +6 -1
- package/rulepacks/jetwc/msgid.json +6 -0
- package/rulepacks/jetwc/rules.json +6 -1
- package/rulepacks/jetwc-lib/component-audit-utils.js +6 -1
- package/rulepacks/jetwco/jetwco-bootstrap.js +6 -1
- package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +6 -1
- package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +6 -0
- package/rulepacks/jetwco/jetwco-component-api-changes.js +6 -1
- package/rulepacks/jetwco/jetwco-component-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-exchange-version-check.js +6 -1
- package/rulepacks/jetwco/jetwco-license-info.js +6 -1
- package/rulepacks/jetwco/jetwco-prerelease-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-thirdparty-ba.js +6 -1
- package/rulepacks/jetwco/msgid.json +6 -0
- package/rulepacks/jetwco/rules.json +6 -1
- package/rulepacks/spoc/msgid.json +5 -0
- package/rulepacks/spoc/rules.json +5 -0
- package/rulepacks/spoc/spoc-dom-manip-inv-tag.js +5 -0
- package/rulepacks/spoc/spoc-dom-manip-tag-pos.js +5 -0
- package/rulepacks/spoc/spoc-dom-manip.js +5 -0
- package/rules/jaf/jaf-css-diagnose.js +5 -0
- package/rules/jaf/jaf-html-diagnose.js +5 -0
- package/rules/jaf/jaf-init-schema.js +5 -0
- package/rules/jaf/jaf-js-diagnose.js +5 -0
- package/rules/jaf/jaf-ts-diagnose.js +6 -0
- package/rules/jaf/msgid.json +6 -1
- package/rules/jaf/rules.json +6 -1
- package/rules/jet/helpers/acc-aria-label.js +6 -1
- package/rules/jet/helpers/bp-checkPropType.js +5 -0
- package/rules/jet/helpers/cssHelper.js +6 -1
- package/rules/jet/helpers/extractStylesFromClass.js +6 -1
- package/rules/jet/helpers/has-slot-name.js +6 -1
- package/rules/jet/helpers/has-slot.js +5 -0
- package/rules/jet/helpers/json-prop-pos.js +5 -0
- package/rules/jet/helpers/json-propname-pos.js +5 -0
- package/rules/jet/helpers/style-selector.js +6 -1
- package/rules/jet/helpers/valid-attr.js +5 -0
- package/rules/jet/helpers/vartrack.js +5 -0
- package/rules/jet/jet-css-ojselector.js +5 -0
- package/rules/jet/msgid.json +6 -1
- package/rules/jet/oj-acc-aria-labelledby.js +5 -0
- package/rules/jet/oj-acc-aria-prop.js +5 -0
- package/rules/jet/oj-acc-avatar-aria-role.js +5 -0
- package/rules/jet/oj-acc-combobox-aria-label.js +6 -1
- package/rules/jet/oj-acc-film-strip-aria-label.js +5 -0
- package/rules/jet/oj-acc-input-aria-label.js +6 -1
- package/rules/jet/oj-acc-select-aria-label.js +6 -1
- package/rules/jet/oj-cca-compjson-bp-ar.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-dsplyname.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-jetver.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-obj.js +5 -0
- package/rules/jet/oj-cca-compjson-ns-reg.js +5 -0
- package/rules/jet/oj-css-bp-border-color.js +5 -0
- package/rules/jet/oj-css-bp-dir-flow.js +6 -1
- package/rules/jet/oj-css-bp-float.js +5 -0
- package/rules/jet/oj-css-bp-textalign.js +5 -0
- package/rules/jet/oj-css-style-abs-units.js +5 -0
- package/rules/jet/oj-css-style-bp-color.js +6 -1
- package/rules/jet/oj-css-style-bp-display.js +6 -1
- package/rules/jet/oj-css-style-bp-font-family.js +6 -1
- package/rules/jet/oj-css-style-bp-font.js +5 -0
- package/rules/jet/oj-css-style-deprecated.js +6 -1
- package/rules/jet/oj-css-style-override.js +6 -1
- package/rules/jet/oj-css-var-override.js +5 -0
- package/rules/jet/oj-form-maxcols.js +6 -0
- package/rules/jet/oj-html-5-attr-obs.js +5 -0
- package/rules/jet/oj-html-5-tag-obs.js +5 -0
- package/rules/jet/oj-html-attr-$unique.js +5 -0
- package/rules/jet/oj-html-attr-2def.js +5 -0
- package/rules/jet/oj-html-attr-json.js +6 -1
- package/rules/jet/oj-html-attr-prefix-expr.js +6 -1
- package/rules/jet/oj-html-attr-prefix-ro.js +5 -0
- package/rules/jet/oj-html-attr-req.js +5 -0
- package/rules/jet/oj-html-bindforeach-data.js +5 -0
- package/rules/jet/oj-html-bindif-test.js +5 -0
- package/rules/jet/oj-html-binding-attr.js +5 -0
- package/rules/jet/oj-html-cca-count.js +5 -0
- package/rules/jet/oj-html-cca-tagname.js +6 -1
- package/rules/jet/oj-html-cdn.js +5 -0
- package/rules/jet/oj-html-combo-converter.js +5 -0
- package/rules/jet/oj-html-cspexpr.js +6 -1
- package/rules/jet/oj-html-databind-all.js +5 -0
- package/rules/jet/oj-html-dlg-title.js +5 -0
- package/rules/jet/oj-html-file-pick-accept.js +6 -0
- package/rules/jet/oj-html-form-bindif.js +6 -1
- package/rules/jet/oj-html-form-layout-maxcols.js +6 -0
- package/rules/jet/oj-html-form-noflex.js +5 -0
- package/rules/jet/oj-html-input-isodate.js +6 -0
- package/rules/jet/oj-html-invalid-doctype.js +6 -1
- package/rules/jet/oj-html-jq-databind.js +6 -1
- package/rules/jet/oj-html-ko-comment.js +5 -0
- package/rules/jet/oj-html-ko-databind.js +5 -0
- package/rules/jet/oj-html-label-for-prefix.js +5 -0
- package/rules/jet/oj-html-missing-doctype.js +6 -1
- package/rules/jet/oj-html-oj-lib.js +5 -0
- package/rules/jet/oj-html-ojattr-520.js +6 -1
- package/rules/jet/oj-html-ojattr-deprecated.js +6 -1
- package/rules/jet/oj-html-ojattr-enum-deprecated.js +6 -1
- package/rules/jet/oj-html-ojattr-evt-syntax.js +5 -0
- package/rules/jet/oj-html-ojattr-value.js +6 -1
- package/rules/jet/oj-html-ojattr.js +6 -1
- package/rules/jet/oj-html-ojevent.js +6 -1
- package/rules/jet/oj-html-ojslot.js +5 -0
- package/rules/jet/oj-html-ojstyle.js +5 -0
- package/rules/jet/oj-html-ojtag-datacmd.js +6 -1
- package/rules/jet/oj-html-ojtag-datactx.js +5 -0
- package/rules/jet/oj-html-ojtag-deprecated.js +6 -1
- package/rules/jet/oj-html-ojtag-globattr-noprefix.js +5 -0
- package/rules/jet/oj-html-ojtag-id.js +5 -0
- package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +5 -0
- package/rules/jet/oj-html-ojtag-ns.js +5 -0
- package/rules/jet/oj-html-picker-attrs.js +6 -0
- package/rules/jet/oj-html-redwood-cssnovars.js +6 -0
- package/rules/jet/oj-html-redwood-cssvars.js +6 -0
- package/rules/jet/oj-html-self-close.js +5 -0
- package/rules/jet/oj-html-slot-item-minmax.js +6 -0
- package/rules/jet/oj-html-slot-name.js +6 -1
- package/rules/jet/oj-html-slot-pref-content.js +6 -0
- package/rules/jet/oj-html-style-abs-units.js +5 -0
- package/rules/jet/oj-html-style-bp-color.js +5 -0
- package/rules/jet/oj-html-style-bp-display.js +6 -1
- package/rules/jet/oj-html-style-bp-font-family.js +5 -0
- package/rules/jet/oj-html-style-bp-font.js +5 -0
- package/rules/jet/oj-html-style-deprecated.js +5 -0
- package/rules/jet/oj-html-style.js +6 -1
- package/rules/jet/oj-html-stylesel.js +6 -1
- package/rules/jet/oj-html-tag-attr-noprefix.js +5 -0
- package/rules/jet/oj-html-template-index.js +6 -0
- package/rules/jet/oj-html-unsup-theme.js +6 -1
- package/rules/jet/oj-html-wctag-$props.js +6 -1
- package/rules/jet/oj-html-wctag-arialabelledby.js +5 -0
- package/rules/jet/oj-html-wctag-for.js +5 -0
- package/rules/jet/oj-html-wctag-id.js +5 -0
- package/rules/jet/oj-html-wctag-packprivate.js +6 -0
- package/rules/jet/oj-js-comp-attr-deprecated.js +5 -0
- package/rules/jet/oj-js-comp-meth-deprecated.js +5 -0
- package/rules/jet/oj-js-no-ext-final.js +5 -0
- package/rules/jet/oj-js-noconsole.js +5 -0
- package/rules/jet/oj-js-ojcomp-deprecated.js +6 -1
- package/rules/jet/oj-js-ojcomp-exist.js +5 -0
- package/rules/jet/oj-js-ojcomp-new.js +5 -0
- package/rules/jet/oj-js-poly-promise.js +6 -1
- package/rules/jet/oj-js-var-undef.js +5 -0
- package/rules/jet/oj-json-syntax.js +6 -1
- package/rules/jet/oj-ts-comp-attr-deprecated.js +5 -0
- package/rules/jet/oj-ts-comp-meth-deprecated.js +5 -0
- package/rules/jet/oj-ts-no-ext-final.js +6 -0
- package/rules/jet/oj-ts-noconsole.js +6 -1
- package/rules/jet/oj-ts-ojcomp-deprecated.js +6 -1
- package/rules/jet/oj-ts-ojcomp-exist.js +6 -1
- package/rules/jet/oj-ts-ojcomp-new.js +6 -1
- package/rules/jet/oj-ts-poly-promise.js +6 -1
- package/rules/jet/rules.json +6 -1
- package/schema/component-schema.json +122 -2
- package/src/JafCore.js +6 -1
- package/types/index.d.ts +144 -35
- package/lib/manual.js +0 -1
- package/lib/stats.js +0 -1
- package/rules/exch/helpers/json-prop-pos.js +0 -1
- package/rules/exch/msgid.json +0 -1
- package/rules/exch/oj-cca-comp-zip-content-composite.js +0 -1
- package/rules/exch/oj-cca-comp-zip-content-pack.js +0 -1
- package/rules/exch/oj-cca-comp-zip-expand.js +0 -1
- package/rules/exch/oj-cca-compjson-evnames.js +0 -1
- package/rules/exch/oj-cca-compjson-file.js +0 -1
- package/rules/exch/oj-cca-compjson-prefix.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-compdeps.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-deps.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-jetver.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-obs.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-type.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-types.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-undef.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-version.js +0 -1
- package/rules/exch/oj-cca-compjson-schema.js +0 -1
- package/rules/exch/oj-cca-zip-compjson.js +0 -1
- package/rules/exch/rules.json +0 -1
- package/rules/jet/oj-css-bp-bgcolor.js +0 -1
- package/tests/components/attr-req-test/component.json +0 -1
- package/tests/components/demo-analog-clock/component.json +0 -1
- package/tests/components/demo-analog-clock/demo-analog-clock-viewModel.js +0 -1
- package/tests/components/demo-analog-clock/extension/demo/js/viewModels/demo.js +0 -1
- package/tests/components/demo-analog-clock/loader.js +0 -1
- package/tests/components/demo-card/component.json +0 -1
- package/tests/components/demo-chart-orientation-control/component.json +0 -1
- package/tests/components/demo-chart-stack-control/component.json +0 -1
- package/tests/components/made-up/component.json +0 -1
- package/tests/components/oj-made-up/component.json +0 -1
- package/tests/components/sp-activity-item/component.json +0 -1
- package/tests/config/config_base.json +0 -1
- package/tests/golden/10.0.0/golden_base.json +0 -1
- package/tests/golden/8.1.0/golden_base.json +0 -1
- package/tests/golden/9.0.0/golden_base.json +0 -1
- package/tests/rulepacks/hooks/hook-rpext.js +0 -1
- package/tests/rulepacks/hooks/hook-start-close-rulepack.js +0 -1
- package/tests/rulepacks/hooks/rule-rpext.js +0 -1
- package/tests/rulepacks/hooks/rules.json +0 -1
- package/tests/rulepacks/tags/proc_directive.js +0 -1
- package/tests/rulepacks/tags/rules.json +0 -1
- package/tests/rulepacks/tags/tag-count-setup.js +0 -1
- package/tests/rulepacks/tags/tag-count.js +0 -1
- package/tests/rules/bugs/JET-4770_PASS_1.html +0 -9
- package/tests/rules/comments/com_FAIL_1.js +0 -57
- package/tests/rules/comments/com_FAIL_2.js +0 -96
- package/tests/rules/comments/com_PASS_1.js +0 -42
- package/tests/rules/comments/com_PASS_2.js +0 -63
- package/tests/rules/comments/com_PASS_3.js +0 -40
- package/tests/rules/comments/com_PASS_4.js +0 -36
- package/tests/rules/comments/com_PASS_5.js +0 -19
- package/tests/rules/csp/html-script-unsafe-inline/FAIL_1.html +0 -11
- package/tests/rules/csp/html-script-unsafe-inline/FAIL_2.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_1.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_2.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_3.html +0 -8
- package/tests/rules/csp/html-style-unsafe-inline/FAIL_1.html +0 -11
- package/tests/rules/csp/html-style-unsafe-inline/PASS_1.html +0 -11
- package/tests/rules/csp/html-unsafe-expr/FAIL_1.html +0 -14
- package/tests/rules/csp/html-unsafe-expr/PASS_1.html +0 -23
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_1.js +0 -17
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_2.js +0 -40
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_3.js +0 -22
- package/tests/rules/csp/js-script-unsafe-eval/PASS_1.js +0 -20
- package/tests/rules/csp/js-script-unsafe-eval/PASS_2.js +0 -44
- package/tests/rules/csp/js-script-unsafe-eval/PASS_3.js +0 -16
- package/tests/rules/csp/js-style-unsafe-inline/FAIL_1.js +0 -25
- package/tests/rules/csp/js-style-unsafe-inline/PASS.js +0 -22
- package/tests/rules/demo/noself_FAIL_1.js +0 -101
- package/tests/rules/import/import_FAIL_1.js +0 -11
- package/tests/rules/import/import_PASS_1.js +0 -10
- package/tests/rules/jet-composites/demo-buttonset-enum/component.json +0 -57
- package/tests/rules/jet-composites/demo-buttonset-enum/loader.js +0 -19
- package/tests/rules/jet-composites/demo-buttonset-enum/view.html +0 -48
- package/tests/rules/jet-composites/demo-card/component.json +0 -28
- package/tests/rules/jet-composites/demo-card/loader.js +0 -16
- package/tests/rules/jet-composites/demo-card/view.html +0 -30
- package/tests/rules/jet-composites/demo-card/viewModel.js +0 -46
- package/tests/rules/jet-composites/demo-card/view_PASS_1.html +0 -21
- package/tests/rules/jet-composites/demo-contact-form/component.json +0 -23
- package/tests/rules/jet-composites/demo-contact-form/loader.js +0 -16
- package/tests/rules/jet-composites/demo-contact-form/view.html +0 -9
- package/tests/rules/jet-composites/demo-grocery-list/component.json +0 -18
- package/tests/rules/jet-composites/demo-grocery-list/loader.js +0 -19
- package/tests/rules/jet-composites/demo-grocery-list/view.html +0 -22
- package/tests/rules/jet-composites/demo-grocery-list/viewModel.js +0 -48
- package/tests/rules/jet-composites/dummy-component-1/component.json +0 -82
- package/tests/rules/jet-composites/dummy-component-2/component.json +0 -72
- package/tests/rules/jet-composites/foo-my-cca/component.json +0 -14
- package/tests/rules/jet-composites/foo-unsup-theme/component.json +0 -29
- package/tests/rules/jet-composites/header/component.json +0 -12
- package/tests/rules/jet-composites/oj-cgbu-omc/attribute-selection/component.json +0 -154
- package/tests/rules/jet-composites/oj-cgbu-omc/component.json +0 -11
- package/tests/rules/jet-composites/oj-cgbu-omc/reference/component.json +0 -185
- package/tests/rules/jet-composites/oj-cgbu-omc/wctag_props_FAIL_1.html +0 -34
- package/tests/rules/jet-composites/oj-enum-depr/component.json +0 -69
- package/tests/rules/jet-composites/oj-html-wctag-id/id_FAIL_1.html +0 -10
- package/tests/rules/jet-composites/oj-html-wctag-id/id_PASS_1.html +0 -6
- package/tests/rules/misc/oj.js +0 -12
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_1.html +0 -23
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_1.html +0 -23
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_2.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_3.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_4.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_5.html +0 -22
- package/tests/rules/oj-acc-aria-prop/aria_prop_FAIL_1.html +0 -22
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_1.html +0 -23
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_2.html +0 -24
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_3.html +0 -21
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_4.html +0 -22
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_5.html +0 -22
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_2.html +0 -21
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_PASS_1.html +0 -20
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_1.html +0 -21
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_PASS_1.html +0 -22
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_1.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_2.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_1.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_2.html +0 -19
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_3.html +0 -22
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_1.html +0 -21
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_1.html +0 -16
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_3.html +0 -26
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_PASS_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_2.html +0 -18
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_PASS_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_PASS_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_3_PASS_1.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_2.html +0 -21
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_PASS_2.html +0 -62
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_nolabel_PASS_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_PASS_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_PASS_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_2.html +0 -21
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_1.zip +0 -1
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_2.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_3.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_4.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_5.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_6.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_7.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_8.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_PASS_1.zip +0 -0
- package/tests/rules/oj-cca-ns-reg/oj-cca-ns-FAIL_1/component.json +0 -19
- package/tests/rules/oj-cca-ns-reg/oj-cca-ns-PASS_1/component.json +0 -19
- package/tests/rules/oj-cgbu-omc_tests/html_ojevent_FAIL_1.html +0 -15
- package/tests/rules/oj-cgbu-omc_tests/html_ojevent_PASS_1.html +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_1/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_10/component.json +0 -103
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_11/component.json +0 -24
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_12/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_13/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_14/component.json +0 -40
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_15/component.json +0 -24
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_16/component.json +0 -44
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_17/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_18/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_19/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_2/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_20/component.json +0 -18
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_21/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_22/component.json +0 -19
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_3/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_4/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_5/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_6/component.json +0 -18
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_7/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_8/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_9/component.json +0 -52
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_1/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_2/component.json +0 -88
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_3/component.json +0 -19
- package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_1.html +0 -22
- package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_2.html +0 -22
- package/tests/rules/oj-css-diagnose/css_FAIL_1.html +0 -14
- package/tests/rules/oj-css-diagnose/css_PASS_1.html +0 -14
- package/tests/rules/oj-css-var-override/varovr_FAIL_1.html +0 -8
- package/tests/rules/oj-html-5-attr-depr/attrdepr_FAIL_1.html +0 -16
- package/tests/rules/oj-html-5-attr-depr/attrdepr_PASS_1.html +0 -16
- package/tests/rules/oj-html-5-tag-depr/tagdepr_FAIL_1.html +0 -9
- package/tests/rules/oj-html-attr/attr_FAIL_1.html +0 -27
- package/tests/rules/oj-html-attr-$unique/attr_$unique1_FAIL_1.html +0 -19
- package/tests/rules/oj-html-attr-$unique/attr_$unique_FAIL_2.html +0 -25
- package/tests/rules/oj-html-attr-2def/attr2def_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-2def/attr2def_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_1.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_2.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_3.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_1.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_2.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_3.html +0 -8
- package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_1.html +0 -17
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_2.html +0 -13
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_3.html +0 -8
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_4.html +0 -13
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_5.html +0 -17
- package/tests/rules/oj-html-attr-req/attrreq_PASS_1.html +0 -24
- package/tests/rules/oj-html-attr-req/attrreq_PASS_2.html +0 -24
- package/tests/rules/oj-html-attr-req/attrreq_PASS_3.html +0 -10
- package/tests/rules/oj-html-attr-req/attrreq_PASS_4.html +0 -11
- package/tests/rules/oj-html-bindforeach-data/bindforeach_data_FAIL_1.html +0 -19
- package/tests/rules/oj-html-bindforeach-data/bindforeach_data_PASS_1.html +0 -10
- package/tests/rules/oj-html-bindif-test/bindif_test_FAIL_1.html +0 -22
- package/tests/rules/oj-html-bindif-test/bindif_test_PASS_1.html +0 -11
- package/tests/rules/oj-html-binding-attr/binding-foreach_FAIL_2.html +0 -28
- package/tests/rules/oj-html-binding-attr/binding-if_FAIL_1.html +0 -23
- package/tests/rules/oj-html-binding-attr/binding-if_PASS_1.html +0 -23
- package/tests/rules/oj-html-cca-count/cca-count_FAIL_1.html +0 -119
- package/tests/rules/oj-html-cca-tagname/ccatag_FAIL_1.html +0 -7
- package/tests/rules/oj-html-cca-tagname/ccatag_PASS_1.html +0 -7
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_1.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_2.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_3.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_PASS_1.html +0 -10
- package/tests/rules/oj-html-cdn/html_cdn_FAIL_1.html +0 -18
- package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_1.html +0 -14
- package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_2.html +0 -10
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_1.html +0 -23
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_2.html +0 -10
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_3.html +0 -13
- package/tests/rules/oj-html-dlg-title/dlgtitle_FAIL_1.html +0 -12
- package/tests/rules/oj-html-dlg-title/dlgtitle_PASS_1.html +0 -12
- package/tests/rules/oj-html-form-noflex/noflex_FAIL_1.html +0 -10
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_1.html +0 -20
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_2.html +0 -13
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_3.html +0 -16
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_4.html +0 -13
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_1.html +0 -6
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_2.html +0 -7
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_3.html +0 -7
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_1.html +0 -37
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_2.html +0 -34
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_3.html +0 -27
- package/tests/rules/oj-html-jq-databind/jq-databind_PASS_1.html +0 -30
- package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_1.html +0 -47
- package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_2.html +0 -36
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_1.html +0 -24
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_2.html +0 -36
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_3.html +0 -29
- package/tests/rules/oj-html-label-for-prefix/for_FAIL_1.html +0 -8
- package/tests/rules/oj-html-label-for-prefix/for_PASS_1.html +0 -8
- package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_1.html +0 -12
- package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_2.html +0 -11
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_1.html +0 -14
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_2.html +0 -5
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_3.html +0 -12
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_5.html +0 -6
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_1.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_2.html +0 -14
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_3.html +0 -13
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_5.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_6.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_PASS_1.html +0 -7
- package/tests/rules/oj-html-oj-lib/oj_lib_FAIL_1.html +0 -15
- package/tests/rules/oj-html-ojattr/ojattr_PASS_1.html +0 -8
- package/tests/rules/oj-html-ojattr/ojattr_PASS_2.html +0 -10
- package/tests/rules/oj-html-ojattr/ojattr_PASS_3.html +0 -7
- package/tests/rules/oj-html-ojattr/ojattr_PASS_4.html +0 -7
- package/tests/rules/oj-html-ojattr-deprecated/ojattr-dep_FAIL1.html +0 -156
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_1.html +0 -19
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_2.html +0 -20
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_PASS_1.html +0 -25
- package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_FAIL_1.html +0 -6
- package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_PASS_1.html +0 -6
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_1.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_2.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_3.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_4.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_5.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_1.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_2.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_3.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_6.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_7.html +0 -10
- package/tests/rules/oj-html-ojattr-value/attr_value_PASS_4.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr_value_PASS_5.html +0 -9
- package/tests/rules/oj-html-ojslot/ojslot_FAIL_1.html +0 -11
- package/tests/rules/oj-html-ojslot/ojslot_PASS_1.html +0 -12
- package/tests/rules/oj-html-ojstyle/style_FAIL_1.html +0 -103
- package/tests/rules/oj-html-ojstyle/style_PASS_2.html +0 -7
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_1.html +0 -10
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_2.html +0 -18
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_3.html +0 -10
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_1.html +0 -28
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_2.html +0 -15
- package/tests/rules/oj-html-ojtag-datactx/datactx_FAIL_1.html +0 -14
- package/tests/rules/oj-html-ojtag-datactx/datactx_PASS_1.html +0 -14
- package/tests/rules/oj-html-ojtag-globattr-noprefix/globattr-noprefix_FAIL_1.html +0 -36
- package/tests/rules/oj-html-ojtag-nonglobattr-prefix/nonglobattr-prefix_FAIL_1.html +0 -26
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_1.html +0 -24
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_2.html +0 -46
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_3.html +0 -10
- package/tests/rules/oj-html-slot-name/slot_name.PASS_1.html +0 -24
- package/tests/rules/oj-html-slot-name/slot_name.PASS_2.html +0 -39
- package/tests/rules/oj-html-slot-name/slot_name.PASS_3.html +0 -10
- package/tests/rules/oj-html-slot-name/slot_name_PASS_4.html +0 -16
- package/tests/rules/oj-html-slot-name/slot_name_PASS_5.html +0 -11
- package/tests/rules/oj-html-slot-name/slot_name_PASS_6.html +0 -14
- package/tests/rules/oj-html-slot-name/slot_name_PASS_7.html +0 -10
- package/tests/rules/oj-html-style/style_FAIL_1.html +0 -7
- package/tests/rules/oj-html-style/style_PASS_1.html +0 -12
- package/tests/rules/oj-html-style/style_PASS_2.html +0 -7
- package/tests/rules/oj-html-style-bp-color/color-FAIL_1.html +0 -17
- package/tests/rules/oj-html-style-bp-color/color-FAIL_2.html +0 -15
- package/tests/rules/oj-html-style-bp-color/color-FAIL_3.html +0 -7
- package/tests/rules/oj-html-style-bp-color/color-PASS_1.html +0 -7
- package/tests/rules/oj-html-style-bp-font-family/fam_FAIL_1.html +0 -23
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_1.html +0 -15
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_2.html +0 -9
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_PASS_1.html +0 -9
- package/tests/rules/oj-html-unsup-theme/unsup_FAIL_1.html +0 -8
- package/tests/rules/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/rules/oj-js-comp-attr-deprecated/attr-del_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-attr-deprecated/attr-dep_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-meth-deprecated/meth-del_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-meth-deprecated/meth-dep_FAIL_1.js +0 -20
- package/tests/rules/oj-js-define-promise/def-prom_FAIL_1.js +0 -16
- package/tests/rules/oj-js-define-promise/def-prom_FAIL_2.js +0 -16
- package/tests/rules/oj-js-diagnose/es6_PASS_1.js +0 -24
- package/tests/rules/oj-js-diagnose/js_FAIL_1.js +0 -12
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_1.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_2.js +0 -23
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_3.js +0 -22
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_4.js +0 -20
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_5.js +0 -24
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_6.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_7.js +0 -15
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_8.js +0 -16
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_1.js +0 -17
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_2.js +0 -17
- package/tests/rules/oj-js-noconsole/nocons_FAIL_1.js +0 -11
- package/tests/rules/oj-js-ojcomp-deprecated/jscomp_FAIL_1.js +0 -27
- package/tests/rules/oj-json-syntax/json_FAIL_1.json +0 -8
- package/tests/rules/oj-json-syntax/json_FAIL_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_1.json +0 -25
- package/tests/rules/oj-json-syntax/json_PASS_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_3.json +0 -14
- package/tests/rules/ojcompjson/attrreq_FAIL_1/component.json +0 -69
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-view.html +0 -6
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-1/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-1/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-view.html +0 -5
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-2/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-2/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component.json +0 -12
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-view.html +0 -5
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-1/component.json +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/resources/nls/audit-singleton-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-view.html +0 -8
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-2/component.json +0 -15
- package/tests/rules/pack-compjson/audit-singleton-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-2/resources/nls/audit-singleton-2-strings.js +0 -18
- package/tests/rules/parse-html/proc_instr.html +0 -9
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_1.js +0 -113
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_2.js +0 -151
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_1.js +0 -149
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_2.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_3.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_4.js +0 -20
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_5.js +0 -246
- package/tests/rules/tab-tests/tab-test_FAIL_1.html +0 -37
- package/tests/rules/tab-tests/tab-test_FAIL_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/src/JetTest.js +0 -1
- package/tests/src/server.js +0 -1
- package/tests/test.js +0 -1
package/rules/jaf/msgid.json
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
{"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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
{"title":"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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const TEMPLATE="template";const OJ_BIND="oj-bind";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.isTagSlotValue(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)){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=parent.parent;continue}if(parent.name!==BODY){if(ruleCtx.utils.metaLib.isTagSlotValue(parent.name,slotName)){ret=parent}}break}return ret};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
module.exports=function(attrName){return attrName&&/[a-zA-Z_$]/.test(attrName.charAt(0))};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
{"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-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-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-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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="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
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-acc-aria-prop";const ARIA="aria-";const DATABIND="data-bind";const ATTR="attr";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
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="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{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,hasLabel,attr,issue;var DomUtils=ruleCtx.utils.DomUtils;var attrPos;if(tagName!=="oj-avatar"){return}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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const 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{"ojtag":this._onTag}}_onTag(ruleCtx,tagName){var issues,i;if(!tagName.startsWith("oj-combobox")){return}issues=helper(ruleCtx,tagName,this._theme);if(issues){for(i=0;i<issues.length;i++){ruleCtx.reporter.addIssue(issues[i],ruleCtx)}}}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="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{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrib2,haveAriaLabel,dataBind,issue;if(tagName!=="oj-film-strip"){return}attribs=ruleCtx.node.attribs;if(!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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const 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{"ojtag":this._onTag}}_onTag(ruleCtx,tagName){var issues,i;if(!tagName.startsWith("oj-input")){return}issues=helper(ruleCtx,tagName,this._theme);if(ruleCtx.utils.DomUtils.isChildOfElem("oj-table",ruleCtx.node)||ruleCtx.utils.DomUtils.isChildOfElem("oj-data-grid",ruleCtx.node)){return}if(issues){for(i=0;i<issues.length;i++){ruleCtx.reporter.addIssue(issues[i],ruleCtx)}}}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const 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{"ojtag":this._onTag}}_onTag(ruleCtx,tagName){var issues,i;if(!tagName.startsWith("oj-select")){return}issues=helper(ruleCtx,tagName,this._theme);if(issues){for(i=0;i<issues.length;i++){ruleCtx.reporter.addIssue(issues[i],ruleCtx)}}}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULENAME='oj-css-bp-dir-flow';const DESCRIPTION='For best practices, checking for [dir="rtl"] may not be needed on '+'<a href="https://www.oracle.com/middleware/technologies/browser-policy.html">Oracle supported browsers</a>. '+'Try using logical properties where possible - see <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties">CSS_Logical_Properties</a>.';const SHORT_DESCRIPTION='[dir="rtl"] may not be needed on Oracle supported browsers, try using logical properties instead';const SELECTOR='Selector';const SELECTOR_LIST='SelectorList';const TYPE_SELECTOR='TypeSelector';const PSEUDO_CLASS_SELECTOR='PseudoClassSelector';const ATTRIB_SELECTOR='AttributeSelector';const IDENTIFIER='Identifier';const STRING='String';const HTML='html';const NOT='not';const DIR='dir';const RTL='rtl';const RE=/['"]/g;const HTML_LEN=HTML.length-1;class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{'css-rule':this._onRule}}_onRule(ruleCtx,rule){if(!(rule.prelude&&rule.prelude.children)||rule.prelude.type!==SELECTOR_LIST){return}var a,sels,sel,ch,attr,startIndex,i,j;a=rule.prelude.children;for(i=0;i<a.length;i++){sels=a[i];if(sels.type!=='Selector'){continue}ch=sels.children;for(j=0;j<ch.length;j++){sel=ch[j];if(sel.type===TYPE_SELECTOR&&sel.name==HTML){startIndex=sel.loc.start.offset;attr=this._getAttribSelector(j,ch);if(attr){if(this._checkDir(attr)){this._emit(ruleCtx,attr,startIndex)}}break}}}}_getAttribSelector(x,a){var attr,k;for(k=x+1;k<a.length;k++){attr=a[k];if(attr.type===PSEUDO_CLASS_SELECTOR){if(attr.name===NOT){attr=this._getAttrSelFromPseudo(attr)}else{attr=null}}else if(attr.type!==ATTRIB_SELECTOR){attr=null}break}return attr}_checkDir(attr){var val,name,ret=false;if(attr.name){name=attr.name;if(name.type===IDENTIFIER&&name.name===DIR){val=attr.value;ret=val.type===STRING&&_deQuote(val.value)===RTL}}return ret}_getAttrSelFromPseudo(sel){var ch,n,attr;ch=sel.children;if(ch&&ch.length){n=ch[0];if(n.type===SELECTOR_LIST){n=n.children;if(n&&n.length){n=n[0];if(n.type===SELECTOR){n=n.children;if(n&&n.length){n=n[0];if(n.type===ATTRIB_SELECTOR){attr=n}}}}}}return attr}_emit(ruleCtx,sel,startIndex){var issue=new ruleCtx.Issue(`[dir=${sel.value.value}] : try using logical properties when possible - see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties`);issue.setPosition(null,null,startIndex+ruleCtx.offset.index,startIndex+ruleCtx.offset.index+HTML_LEN);ruleCtx.reporter.addIssue(issue,ruleCtx)}}function _deQuote(s){return s.replace(RE,'')}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULENAME="oj-css-bp-float";const DESCRIPTION="Use of CSS 'float' is discouraged - use the JET float utility classes. For example - see the "+"<a href='https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=display&demo=floatstart'>start</a> and "+"<a href='https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=display&demo=floatend'>end</a> classes.";const SHORT_DESCRIPTION="Use of CSS 'float' is discouraged - use the JET float utility classes";const DECLARATION="Declaration";const FLOAT="float";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&&decl.property===FLOAT&&!_isCssVar(decl)){issue=new ruleCtx.Issue("CSS 'float' - best practices: use the JET float classes");issue.setPosition(this._CssUtils.getPosition(ruleCtx,decl.loc));issue.setSeverity("minor");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(prop===FLOAT){issue=new ruleCtx.Issue("'float' property in 'style' attribute. Best practices: use the JET float classes");issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}function _isCssVar(decl){var c,v;c=decl.value.children;if(c){v=c[0];return v.name==="var"}return false};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULENAME="oj-css-bp-textalign";const DESCRIPTION="Use of CSS 'text-align' is discouraged - use the JET text-align classes. For example: for <b>text-align:right</b> "+"use the "+"<a href='https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=display&demo=textend'>text align end</a> "+"utility classes.";const SHORT_DESCRIPTION="Use of CSS 'text-align' is discouraged - use the JET text-align classes";const DECLARATION="Declaration";const TEXT_ALIGN="text-align";const VAR="var";const COLON=":";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&&decl.property===TEXT_ALIGN&&!_isCssVar(decl)){issue=new ruleCtx.Issue("CSS 'text-align' - best practices: use the JET text-align classes");issue.setPosition(this._CssUtils.getPosition(ruleCtx,decl.loc));issue.setSeverity("minor");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(COLON);if(x>=0){prop=s.substring(0,x).trimEnd();if(prop===TEXT_ALIGN){issue=new ruleCtx.Issue("'text-align' property in 'style' attribute. Best practices: use the JET text-align classes");issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}function _isCssVar(decl){var c,v;c=decl.value.children;if(c){v=c[0];return v.name===VAR}return false};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const{LENGTH_PROP_SET}=require("./helpers/cssHelper");const RULENAME="oj-css-style-abs-units";const DESCRIPTION="In general it is preferable to use relative length units in place of absolute units. "+"Specifically, 'rem' units are recommended because they proportionately adjust to the root "+"font size. 'rem' can be used for anything that takes a length unit - e.g. font-size, line-height, "+"width, height, padding, margin, etc. However, there are cases where absolute units are "+"required. To ignore certain selectors, use the 'ignore'/'accept' sub-properties of the "+"configuration property 'ruleMods'.<br><br>"+"e.g. <em>\"ruleMods\" : { \"ignore\" : [\"-image$\"] }</em><br><br>"+"this will ignore all selectors ending with <em>\"-image$\"</em>";const SHORT_DESCRIPTION="In general it is preferable to use relative length units in place of absolute units.";const ABS_UNITS=["px","cm","mm","in","pt","pc","all"];const SELECTORLIST="SelectorList";const SELECTOR="Selector";const CLASS_SELECTOR="ClassSelector";const ID_SELECTOR="IdSelector";const FUNCTION="Function";const DIMENSION="Dimension";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){if(!this._checkRuleOptions(regCtx)){return false}this._CssUtils=regCtx.utils.CssUtils;return{"css-rule":this._onRule}}_onRule(ruleCtx,rule){var block,decl,i;block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type==="Declaration"&&LENGTH_PROP_SET.has(decl.property)){if(!_isCssVar(decl)){this._prop(ruleCtx,rule,decl)}}}}_prop(ruleCtx,rule,decl){if(decl.value&&decl.value.type==="Value"&&decl.value.children){this._children(ruleCtx,rule,decl.property,decl.value.children)}}_children(ruleCtx,rule,prop,childs){var ch,i;for(i=0;i<childs.length;i++){ch=childs[i];if(ch.type===DIMENSION&&ABS_UNITS.includes(ch.unit)&&this._okPropFail(rule,ch)){this._emitIssue(ruleCtx,prop,ch)}else if(ch.type===FUNCTION&&!_isColorFunc(ch.name)){this._func(ruleCtx,rule,prop,ch)}}}_func(ruleCtx,rule,prop,fnNode){var a,decl,i;a=fnNode.children;for(i=0;i<a.length;i++){decl=a[i];if(decl.type===DIMENSION&&ABS_UNITS.includes(decl.unit)&&this._okPropFail(rule,decl)){this._emitIssue(ruleCtx,prop,decl)}}}_emitIssue(ruleCtx,prop,dim){var val,issue;val=parseInt(dim.value);if(val){issue=new ruleCtx.Issue(`CSS value '${val}${dim.unit}' (${prop}) : - best practices: replace absolute unit '${dim.unit}' with a relative unit (e.g. 'rem' or '%')`)}else{issue=new ruleCtx.Issue(`CSS value '0${dim.unit}' (${prop}) : - best practices: remove '${dim.unit}' for zero quantity`);issue.setMsgKey(RULENAME+"_1");issue.setSeverity("minor")}issue.setPosition(this._CssUtils.getPosition(ruleCtx,dim.loc));ruleCtx.reporter.addIssue(issue,ruleCtx)}_okPropFail(rule,decl){var unit,val,sels,list,b,i,j;val=typeof decl.value==="string"?parseInt(decl.value):val;if(this._unitOpts){unit=this._unitOpts[decl.unit];if(unit===undefined){unit=this._unitOpts["all"]}b=typeof unit==="number"?val===0?true:Math.abs(val)>unit:false}else{b=true}if(b&&(this._ignore||this._accept)){sels=_getSelectors(rule);if(sels){list=this._ignore||this._accept;for(i=0;i<list.length;i++){for(j=0;j<sels.length;j++){if(list[i].test(sels[j])){return this._accept?b:false}}}}return!this._accept}return b}_checkRuleOptions(regCtx){var units,sels,accept,ign,unit,th,b;units=regCtx.ruleOpts["absunits"];if(units){if(!regCtx.utils.utils.isObject(units)){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'absunits' is not an object`);this._fail=true;return false}for(unit in units){if(!ABS_UNITS.includes(unit)){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'absunits' value '${unit}' is not absolute`);b=true;continue}if(units.hasOwnProperty(unit)){th=units[unit];if(typeof th!=="number"){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'absunits' threshold '${th}' is not a number`);b=true}}}this._unitOpts=units}sels=regCtx.ruleOpts["selectors"];if(sels){if(!regCtx.utils.utils.isObject(sels)){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'selectors' is not an object`);this._fail=true;return false}accept=sels.accept;ign=sels.ignore;if(accept&&ign){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'selectors' - sub-properties 'accept' and 'ignore are mutually exclusive`);b=true}if(!b){if(accept){this._selAccept=this._getOptionSels(regCtx,"accept",accept)}else if(ign){this._ignore=this._getOptionSels(regCtx,"ignore",ign)}}}return this._fail?false:!b}_getOptionSels(regCtx,prop,val){var i;if(typeof val==="string"){val=[val]}else if(!Array.isArray(val)){return null}for(i=0;i<val.length;i++){if(typeof val[i]==="string"){try{val[i]=new RegExp(val[i])}catch(e){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} '${prop}' : invalid reg. expression '${val[i]}' at position ${i}`);this._fail=true}}}return this._fail?null:val}}function _getSelectors(rule){var sels,sel,ch,selch,prel,i,j;prel=rule.prelude;if(prel&&prel.type===SELECTORLIST&&prel.children){ch=prel.children;for(i=0;i<ch.length;i++){sel=ch[i];if(sel.type===SELECTOR&&sel.children){selch=sel.children;for(j=0;j<selch.length;j++){sel=selch[j];if(sel.type===CLASS_SELECTOR||sel.type===ID_SELECTOR){if(!sels){sels=[]}sels.push(sel.name)}}}}}return sels};function _isCssVar(decl){var c,v;c=decl.value.children;if(c){v=c[0];return v.name==="var"}return false};function _isColorFunc(fnName){fnName=fnName.toLowerCase();return fnName.startsWith("rgb")||fnName.startsWith("hsl")};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const cssHelper=require("./helpers/cssHelper");const RULE_NAME="oj-css-style-bp-color";const SHORT_DESCRIPT="For best practices, CSS color values should not be used - color classes such as 'oj-text-color-primary' are preferred.";const DESCRIPT="For best practices, CSS color values should not be used - color classes such as 'oj-text-color-primary' are preferred."+" See the Colors demo category in the JET cookbook under the Framework "+"<a href='https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=colors&demo=bgcolors'>Utility CSS</a> category.";const IDENTIFIER="Identifier";const FUNCTION="Function";const HEXCOLOR="HexColor";const HASH="Hash";const VAR_PREFIX="--";function Rule(){this._checkList=null;this._isAccept=false};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCRIPT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){if(!this._checkAcceptReject(regCtx)){return false}this._CssUtils=regCtx.utils.CssUtils;return{"css-rule":this._onRule}};Rule.prototype._onRule=function(ruleCtx,rule){var block,decl,val,b,i;if(!(rule.prelude&&rule.prelude.children&&rule.prelude.children.length)){return}block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type==="Declaration"){if(cssHelper.COLOR_PROPS.includes(decl.property)){if(this._okProp(decl.property)){if(decl.value.type==="Raw"){val=_encodeRaw(decl.value,ruleCtx.utils.utils);if(this._isHardColor(ruleCtx,val)){this._emitIssue(ruleCtx,decl.value)}return}if(_isColorFuncDecl(decl)){b=_isColorFuncDeclCssVar(decl)}else{b=_isCssVarDecl(decl)}if(!b){this._emitIssue(ruleCtx,decl.value)}}}else if(cssHelper.COLOR_PROPS_MULTI.includes(decl.property)){if(this._okProp(decl.property)){this._handleMulti(ruleCtx,decl)}}}}};Rule.prototype._handleMulti=function(ruleCtx,decl){if(decl.value.children){var a,val,ao,o,i,j;var a=decl.value.children;for(i=0;i<a.length;i++){val=a[i];if(val.children&&(val.type!==FUNCTION||!_isColorFunc(val.name))){ao=val.children;for(j=0;j<ao.length;j++){var o=ao[j];if(o.type===HEXCOLOR||o.type===HASH){this._emitIssue(ruleCtx,o)}else if(o.type===FUNCTION){if(_isColorFunc(o.name)){this._emitIssue(ruleCtx,o)}}}}else if(val.type===IDENTIFIER){if(this._CssUtils.isColorName(val.name)){this._emitIssue(ruleCtx,val)}}else if(val.type===HEXCOLOR||val.type===HASH){this._emitIssue(ruleCtx,val)}else if(val.type===FUNCTION){if(_isColorFunc(val.name)&&!_isColorFuncCssVar(val)){this._emitIssue(ruleCtx,val)}}}}};Rule.prototype._emitIssue=function(ruleCtx,o){var issue;issue=new ruleCtx.Issue("CSS color '"+this._encodeColor(o,ruleCtx)+"' - best practices: use the utility CSS selectors available (see 'Text', 'Icons', and 'Link' pages)");issue.setPosition(this._CssUtils.getPosition(ruleCtx,o.loc));ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._encodeColor=function(v,ruleCtx){var val,ret;val=v;if(val.type===HEXCOLOR||val.type===HASH){ret="#"+val.value}else if(val.type===IDENTIFIER){ret=val.name}else if(val.type===FUNCTION&&_isColorFunc(val.name)){ret=_encodeColorFunction(val)}else if(val.type==="Value"){ret=this._encodeColor(val.children[0])}else if(val.type==="Raw"){ret=_encodeRaw(val,ruleCtx.utils.utils)}else{ret="??"};return ret};function _encodeColorFunction(val){var s,c,i;s=val.name+"(";c=val.children;if(c[0].name==="var"){val=c[0];if(val.children&&val.children.length){val=val.children[0];if(val.name){s+=val.name}}}else{for(i=0;i<c.length;i++){s+=c[i].value}}return s+=")"};function _encodeRaw(val,utils){var s,i;s=val.value.trim();if(s.startsWith("#")){for(i=1;i<s.length;i++){if(!_isHex(s.charAt(i))){s=s.substring(0,i);break}}return s}else if(_isColorFunc(s)){i=s.indexOf(")");return i>=0?s.substring(0,i+1):s}else{i=utils.getIndexToWhitespace(s);s=i>=0?s.substring(0,i):s;return s.replace(/[\\,:;\[\{}]/g,"")}};function _isHex(c){const HEX="0123456789ABCDEFabcdef";return HEX.indexOf(c)>=0};Rule.prototype._okProp=function(prop){var i;if(this._checkList){for(i=0;i<this._checkList.length;i++){if(this._checkList[i]===prop){return this._isAccept}}return!this._isAccept}return true};Rule.prototype._isHardColor=function(ruleCtx,s){var x,ret=false;if(s.startsWith("#")){ret=true}else if(s.startsWith("--")){}else if(_isColorFunc(s)){x=s.indexOf("(");if(x<0){return false}s=s.substring(x);ret=!s.startsWith("--")}else{ret=ruleCtx.utils.CssUtils.isColorName(s)}return ret};function _isCssVarDecl(decl){var c,v;c=decl.value.children;if(c){v=c[0];return v.name==="var"}return false};function _isColorFunc(s){var ret;if(s){s=s.toLowerCase();ret=s.startsWith("rgb")||s.startsWith("hsl")}return ret};function _isColorFuncDecl(decl){var c,v;c=decl.value.children;if(c){v=c[0];return _isColorFunc(v.name)}return false}function _isColorFuncCssVar(s){return _isColorFunc(s)&&_isColorFuncCssVar(s)};function _isColorFuncDeclCssVar(decl){var c,v;var ret=false;c=decl.value.children;if(c){v=c[0];ret=_isColorFuncDecl(decl)&&_isColorFuncCssVar(v)}return ret}function _isColorFuncCssVar(v){var ret=false;if(v.children&&v.children.length&&v.children[0].type==="Function"){v=v.children[0].children;if(v&&v.length===1){v=v[0];ret=v.type===IDENTIFIER&&v.name.startsWith(VAR_PREFIX)}}return ret};Rule.prototype._checkAcceptReject=function(regCtx){var accept=regCtx.ruleOpts["accept"];var reject=regCtx.ruleOpts["reject"];if(accept||reject){if(accept&&reject){regCtx.utils.msgLib.error("Rule "+RULE_NAME+": options 'accept' and 'reject' are mutually exclusive");return false}if(accept){this._checkList=accept;this._isAccept=true}else{this._checkList=reject}if(!Array.isArray(this._checkList)){regCtx.utils.msgLib.error("Rule "+RULE_NAME+": option '"+(accept?"accept":"reject")+"' is not an array");return false}for(let i=0;i<this._checkList.length;i++){if(typeof this._checkList[i]==="string"){this._checkList[i]=this._checkList[i].trim()}}}return true};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-css-style-bp-display";const DESCRIPT="For best practices, CSS property 'display:none' should not be used. Use of JET <oj-bind-if> is recommended.";const DECLARATION="Declaration";function getName(){return RULE_NAME};function getShortDescription(){return DESCRIPT};function getDescription(){return DESCRIPT};function register(regCtx){return{"css-rule":_onRule}};function _onRule(ruleCtx,rule){var block,decl,i;if(!(rule.prelude&&rule.prelude.children&&rule.prelude.children.length)){return}block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type===DECLARATION){if(decl.property==="display"&&_propValue(decl)==="none"){if(!_isCssVar(decl)){_emitIssue(ruleCtx,decl)}}}}};function _emitIssue(ruleCtx,o){var issue;issue=new ruleCtx.Issue("CSS 'display:none' - for best practices, use <oj-bind-if>");issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,o.loc));ruleCtx.reporter.addIssue(issue,ruleCtx)};function _propValue(decl){var val,ret;if(decl.value&&decl.value.type==="Value"){val=decl.value;if(val.children&&val.children.length){val=val.children[0];if(val.type==="Identifier"){ret=val.name}}}return ret};function _isCssVar(decl){var c,v;c=decl.value.children;v=c[0];return v.name==="var"};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULENAME="oj-css-style-bp-font-family";const DESCRIPT="For best practices, CSS properties 'font-family' should not be used. Use of JET typography classes is recommended.";const SHORT_DESCRIPT=DESCRIPT;const DECLARATION="Declaration";const FONT_FAMILY="font-family";const IDENTIFIER="Identifier";const VALUE="Value";class Rule{constructor(){this._checkList=null;this._isAccept=false}getName(){return RULENAME}getDescription(){return DESCRIPT}getShortDescription(){return SHORT_DESCRIPT}register(regCtx){if(!this._checkRuleOverrides(regCtx)){return false}return{"css-rule":this._onRule,"css-atrule":this._onAtRule}}_onRule(ruleCtx,rule){var block,decl,i;if(!(rule.prelude&&rule.prelude.children&&rule.prelude.children.length)){return}block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type===DECLARATION){if(decl.property===FONT_FAMILY){if(!_isCssVar(decl)){if(this._okProp(decl)){this._emitIssue(ruleCtx,decl)}}}}}}_onAtRule(ruleCtx,atrule){var block,decl,i;if(!(atrule.block&&atrule.block.children&&atrule.block.children.length)){return}block=atrule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type===DECLARATION){if(decl.property===FONT_FAMILY){if(!_isCssVar(decl)){if(this._okProp(decl)){this._emitIssue(ruleCtx,decl)}}}}}}_emitIssue(ruleCtx,o){var issue;issue=new ruleCtx.Issue(`"CSS property '${o.property}: ${this._family}' - best practices: JET typography classes preferred`);issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,o.loc));ruleCtx.reporter.addIssue(issue,ruleCtx)}_okProp(decl){var i;var i,ff;this._family=ff=_getFamily(decl);if(ff.charAt(0)==="\""){ff=ff.substring(1,ff.length-1)}if(ff&&this._checkList){for(i=0;i<this._checkList.length;i++){if(ff.match(this._checkList[i])){return this._isAccept}}return!this._isAccept}return true}_checkRuleOverrides(regCtx){var accept=regCtx.ruleOpts["accept"];var ignore=regCtx.ruleOpts["ignore"];if(accept||ignore){if(accept&&ignore){regCtx.utils.msgLib.error(`Rule ${RULENAME} : options 'accept' and 'ignore' are mutually exclusive`);return false}if(accept){this._checkList=accept;this._isAccept=true}else{this._checkList=ignore}if(!Array.isArray(this._checkList)){regCtx.utils.msgLib.error(`Rule ${RULENAME} : option '${accept?"accept":"ignore"}' is not an array`);return false}for(let i=0;i<this._checkList.length;i++){if(typeof this._checkList[i]==="string"){this._checkList[i]=new RegExp(this._checkList[i].trim())}}}return true}}function _getFamily(decl){var family,ch,i;if(decl.value&&decl.value.type===VALUE){ch=decl.value.children;if(ch&&ch.length){for(i=0;i<ch.length;i++){family=ch[i];if(family.type===IDENTIFIER){family=family.name;break}else if(family.type==="String"){family=family.value;break}}}}return family};function _isCssVar(decl){var c,v;c=decl.value.children;v=c[0];return v.name==="var"};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-css-style-bp-font";const DESCRIPT="For best practices, CSS properties 'font-size' and 'font-weight' should not be used. Use of JET typography classes is recommended.";const SHORT_DESCRIPT=DESCRIPT;const DECLARATION="Declaration";const FONT_CLASSES=["font-size","font-weight"];function Rule(){this._checkList=null;this._isAccept=false};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCRIPT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){if(!this._checkAcceptReject(regCtx)){return false}return{"css-rule":this._onRule}};Rule.prototype._onRule=function(ruleCtx,rule){var block,decl,i;if(!(rule.prelude&&rule.prelude.children&&rule.prelude.children.length)){return}block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type===DECLARATION){if(FONT_CLASSES.includes(decl.property)){if(!_isCssVar(decl)){if(this._okProp(decl.property)){_emitIssue(ruleCtx,decl)}}}}}};function _emitIssue(ruleCtx,o){var issue;issue=new ruleCtx.Issue("CSS property '"+o.property+"' - for best practices, JET typography classes preferred");issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,o.loc));ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._okProp=function(prop){var i;if(this._checkList){for(i=0;i<this._checkList.length;i++){if(this._checkList[i]===prop){return this._isAccept}}return!this._isAccept}return true};Rule.prototype._checkAcceptReject=function(regCtx){var accept=regCtx.ruleOpts["accept"];var reject=regCtx.ruleOpts["reject"];if(accept||reject){if(accept&&reject){regCtx.utils.msgLib.error("Rule "+RULE_NAME+": options 'accept' and 'reject' are mutually exclusive");return false}if(accept){this._checkList=accept;this._isAccept=true}else{this._checkList=reject}if(!Array.isArray(this._checkList)){regCtx.utils.msgLib.error("Rule "+RULE_NAME+": option '"+(accept?"accept":"reject")+"' is not an array");return false}for(let i=0;i<this._checkList.length;i++){if(typeof this._checkList[i]==="string"){this._checkList[i]=this._checkList[i].trim()}}}return true};function _isCssVar(decl){var c,v;c=decl.value.children;v=c[0];return v.name==="var"};module.exports=Rule;
|