@oracle/oraclejet-audit 10.1.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/jaf-amd.js +12 -4
- package/jaf.js +6 -1
- package/jafapi.js +6 -1
- package/lib/AST.js +6 -1
- package/lib/AST_Ts.js +6 -1
- package/lib/AstJson.js +6 -1
- package/lib/AstMd.js +6 -0
- package/lib/AstNodeTypes.js +6 -1
- package/lib/Comments.js +6 -1
- package/lib/ComponentSvcs.js +5 -0
- package/lib/Components.js +6 -1
- package/lib/Config.js +6 -1
- package/lib/ConfigLib.js +6 -1
- package/lib/CssLib.js +5 -0
- package/lib/CssUtils.js +5 -0
- package/lib/DomUtils.js +6 -1
- package/lib/FileIndex.js +5 -0
- package/lib/FileSet.js +5 -0
- package/lib/FsUtils.js +6 -1
- package/lib/Histo.js +6 -0
- package/lib/HtmlTree.js +6 -1
- package/lib/HtmlUtils.js +5 -0
- package/lib/Issue.js +6 -1
- package/lib/JafEvents.js +5 -0
- package/lib/JafLib.js +6 -1
- package/lib/Json.js +6 -0
- package/lib/JsonLoader.js +6 -1
- package/lib/Md.js +6 -0
- package/lib/MetaLib.js +6 -1
- package/lib/NetUtils.js +5 -0
- package/lib/NodeTypes.js +5 -0
- package/lib/Parser.js +6 -1
- package/lib/RegTypes.js +6 -1
- package/lib/Registry.js +6 -1
- package/lib/Reporter.js +6 -1
- package/lib/RuleContext.js +5 -0
- package/lib/RulePack.js +5 -0
- package/lib/RuleSet.js +6 -1
- package/lib/Rules.js +6 -1
- package/lib/Scope.js +6 -1
- package/lib/SemVer.js +5 -0
- package/lib/Server.js +5 -0
- package/lib/SevLib.js +5 -0
- package/lib/Severity.js +6 -1
- package/lib/Stats.js +6 -0
- package/lib/Ts.js +6 -1
- package/lib/Utils.js +6 -1
- package/lib/Watch.js +5 -0
- package/lib/Writer.js +5 -0
- package/lib/ZipUtils.js +5 -0
- package/lib/api.js +6 -0
- package/lib/builtinpacks.js +6 -0
- package/lib/cliStats.js +6 -0
- package/lib/clone.js +6 -1
- package/lib/cmdline.js +6 -1
- package/lib/colors.js +6 -1
- package/lib/defaults.js +6 -0
- package/lib/deflist.js +6 -0
- package/lib/dislist.js +6 -0
- package/lib/exportRules.js +6 -0
- package/lib/extends.js +6 -0
- package/lib/filetypes.js +6 -0
- package/lib/grouplist.js +6 -0
- package/lib/groups.js +6 -0
- package/lib/help.js +6 -1
- package/lib/jetver.js +6 -1
- package/lib/macros.js +6 -0
- package/lib/manual.js +6 -1
- package/lib/metaLoader.js +5 -0
- package/lib/metahist.js +5 -0
- package/lib/msgidLoader.js +6 -1
- package/lib/ns.js +6 -1
- package/lib/nslist.js +5 -0
- package/lib/outFormat.js +6 -0
- package/lib/outfile.js +5 -0
- package/lib/ruleLoader.js +5 -0
- package/lib/scaffold.js +6 -1
- package/lib/scaffoldRule.js +6 -1
- package/lib/schema.js +6 -1
- package/lib/scopewalker.js +6 -0
- package/lib/spinner.js +6 -1
- package/lib/spinnernoop.js +5 -0
- package/lib/tabs.js +5 -0
- package/libext/expparser.js +6 -1
- package/meta/11.0.0/jetauditmeta.js +9 -0
- package/meta/11.1.0/jetauditmeta.js +9 -0
- package/meta/12.0.0/jetauditmeta.js +9 -0
- package/meta/metaverlist.json +1 -1
- package/package.json +72 -69
- package/rulepacks/csp/csp-html-script-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-html-style-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-html-unsafe-expr.js +5 -0
- package/rulepacks/csp/csp-js-script-unsafe-eval.js +6 -1
- package/rulepacks/csp/csp-js-style-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-ts-script-unsafe-eval.js +6 -0
- package/rulepacks/csp/csp-ts-style-unsafe-inline.js +6 -0
- package/rulepacks/csp/msgid.json +6 -1
- package/rulepacks/csp/rules.json +6 -1
- package/rulepacks/jetwc/jetwc-absolute-jetversion.js +6 -1
- package/rulepacks/jetwc/jetwc-aria-redefinition.js +6 -1
- package/rulepacks/jetwc/jetwc-bootstrap.js +6 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +6 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +6 -1
- package/rulepacks/jetwc/jetwc-component-dependencies.js +6 -1
- package/rulepacks/jetwc/jetwc-component-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-component-foldername.js +6 -1
- package/rulepacks/jetwc/jetwc-component-location.js +6 -1
- package/rulepacks/jetwc/jetwc-component-type.js +6 -1
- package/rulepacks/jetwc/jetwc-css-oj-complete.js +6 -0
- package/rulepacks/jetwc/jetwc-data-property-prefix.js +6 -1
- package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +6 -1
- package/rulepacks/jetwc/jetwc-disabled-property.js +6 -1
- package/rulepacks/jetwc/jetwc-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +6 -1
- package/rulepacks/jetwc/jetwc-dynamic-slots-naming.js +6 -1
- package/rulepacks/jetwc/jetwc-event-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-events.js +6 -1
- package/rulepacks/jetwc/jetwc-jet-version.js +6 -1
- package/rulepacks/jetwc/jetwc-loader-file.js +6 -1
- package/rulepacks/jetwc/jetwc-markdown-link.js +6 -0
- package/rulepacks/jetwc/jetwc-method-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-methods.js +6 -1
- package/rulepacks/jetwc/jetwc-namespace.js +6 -1
- package/rulepacks/jetwc/jetwc-nested-defaults.js +6 -1
- package/rulepacks/jetwc/jetwc-nls-languages.js +6 -1
- package/rulepacks/jetwc/jetwc-nls-root.js +6 -1
- package/rulepacks/jetwc/jetwc-oj-register.js +6 -1
- package/rulepacks/jetwc/jetwc-ojcss.js +6 -1
- package/rulepacks/jetwc/jetwc-pack-children.js +6 -1
- package/rulepacks/jetwc/jetwc-packable-components.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-pattern.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-version.js +6 -1
- package/rulepacks/jetwc/jetwc-property-changed.js +6 -1
- package/rulepacks/jetwc/jetwc-property-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-property-nesting.js +6 -1
- package/rulepacks/jetwc/jetwc-public-modules.js +6 -1
- package/rulepacks/jetwc/jetwc-register-css.js +6 -1
- package/rulepacks/jetwc/jetwc-register-with-promises.js +6 -1
- package/rulepacks/jetwc/jetwc-require-paths.js +6 -1
- package/rulepacks/jetwc/jetwc-required-subproperty.js +6 -0
- package/rulepacks/jetwc/jetwc-reserved-property.js +6 -1
- package/rulepacks/jetwc/jetwc-schema.js +6 -1
- package/rulepacks/jetwc/jetwc-semantic-version.js +6 -1
- package/rulepacks/jetwc/jetwc-slot-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-standard-files.js +6 -1
- package/rulepacks/jetwc/jetwc-subproperty-writeback.js +6 -0
- package/rulepacks/jetwc/jetwc-template-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-unused-events.js +6 -1
- package/rulepacks/jetwc/jetwc-unused-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-vb-category.js +6 -1
- package/rulepacks/jetwc/jetwc-vb-icon.js +6 -1
- package/rulepacks/jetwc/jetwc-vcomponent-jetversion.js +6 -0
- package/rulepacks/jetwc/jetwc-vcomponent-loader.js +6 -0
- package/rulepacks/jetwc/jetwc-vcomponent-version.js +6 -0
- package/rulepacks/jetwc/jetwc-version-openrange.js +6 -1
- package/rulepacks/jetwc/jetwc-writeback-required.js +6 -1
- package/rulepacks/jetwc/msgid.json +6 -0
- package/rulepacks/jetwc/rules.json +6 -1
- package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +6 -0
- package/rulepacks/jetwco/jetwco-bootstrap.js +6 -1
- package/rulepacks/jetwco/jetwco-cacc-auditConstraints.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-dependencies.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-events.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-helpers.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-jetVer.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodParams.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methods.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packBundle.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packContent.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-properties.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-publicModules.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slots.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +6 -0
- package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +6 -1
- package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +6 -0
- package/rulepacks/jetwco/jetwco-component-api-changes.js +6 -1
- package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +6 -0
- package/rulepacks/jetwco/jetwco-component-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-description-standards.js +6 -0
- package/rulepacks/jetwco/jetwco-displayname-standards.js +6 -0
- package/rulepacks/jetwco/jetwco-exchange-version-check.js +6 -1
- package/rulepacks/jetwco/jetwco-license-info.js +6 -1
- package/rulepacks/jetwco/jetwco-prerelease-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-thirdparty-ba.js +6 -1
- package/rulepacks/jetwco/msgid.json +6 -0
- package/rulepacks/jetwco/rules.json +6 -1
- package/rulepacks/spoc/msgid.json +5 -0
- package/rulepacks/spoc/rules.json +5 -0
- package/rulepacks/spoc/spoc-dom-manip-inv-tag.js +5 -0
- package/rulepacks/spoc/spoc-dom-manip-tag-pos.js +5 -0
- package/rulepacks/spoc/spoc-dom-manip.js +5 -0
- package/{tests/rules/oj-js-diagnose/js_FAIL_1.js → rulepacks/wdt/msgid.json} +3 -9
- package/rulepacks/wdt/rules.json +6 -0
- package/rulepacks/wdt/wd-driver-sleep.js +6 -0
- package/rulepacks/wdt/wd-xpath.js +6 -0
- package/rules/jaf/jaf-css-diagnose.js +5 -0
- package/rules/jaf/jaf-html-diagnose.js +5 -0
- package/rules/jaf/jaf-init-schema.js +5 -0
- package/rules/jaf/jaf-js-diagnose.js +5 -0
- package/rules/jaf/jaf-ts-diagnose.js +6 -0
- package/rules/jaf/msgid.json +6 -1
- package/rules/jaf/rules.json +6 -1
- package/rules/jet/helpers/acc-aria-label.js +6 -1
- package/rules/jet/helpers/bp-checkPropType.js +5 -0
- package/rules/jet/helpers/cssHelper.js +6 -1
- package/rules/jet/helpers/extractStylesFromClass.js +6 -1
- package/rules/jet/helpers/has-slot-name.js +6 -1
- package/rules/jet/helpers/has-slot.js +5 -0
- package/rules/jet/helpers/json-prop-pos.js +5 -0
- package/rules/jet/helpers/json-propname-pos.js +5 -0
- package/rules/jet/helpers/style-selector.js +6 -1
- package/rules/jet/helpers/valid-attr.js +5 -0
- package/rules/jet/helpers/vartrack.js +5 -0
- package/rules/jet/jet-css-ojselector.js +5 -0
- package/rules/jet/msgid.json +6 -1
- package/rules/jet/oj-acc-aria-labelledby.js +5 -0
- package/rules/jet/oj-acc-aria-prop.js +6 -1
- package/rules/jet/oj-acc-avatar-aria-role.js +6 -1
- package/rules/jet/oj-acc-combobox-aria-label.js +6 -1
- package/rules/jet/oj-acc-film-strip-aria-label.js +6 -1
- package/rules/jet/oj-acc-input-aria-label.js +6 -1
- package/rules/jet/oj-acc-select-aria-label.js +6 -1
- package/rules/jet/oj-cca-compjson-bp-ar.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-dsplyname.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-jetver.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-obj.js +5 -0
- package/rules/jet/oj-cca-compjson-ns-reg.js +5 -0
- package/rules/jet/oj-css-bp-border-color.js +5 -0
- package/rules/jet/oj-css-bp-dir-flow.js +6 -1
- package/rules/jet/oj-css-bp-float.js +5 -0
- package/rules/jet/oj-css-bp-textalign.js +5 -0
- package/rules/jet/oj-css-style-abs-units.js +6 -1
- package/rules/jet/oj-css-style-bp-color.js +5 -0
- package/rules/jet/oj-css-style-bp-display.js +6 -1
- package/rules/jet/oj-css-style-bp-font-family.js +6 -1
- package/rules/jet/oj-css-style-bp-font.js +5 -0
- package/rules/jet/oj-css-style-deprecated.js +6 -1
- package/rules/jet/oj-css-style-override.js +6 -1
- package/rules/jet/oj-css-var-override.js +5 -0
- package/rules/jet/oj-form-maxcols.js +6 -1
- package/rules/jet/oj-html-5-attr-obs.js +5 -0
- package/rules/jet/oj-html-5-tag-obs.js +5 -0
- package/rules/jet/oj-html-alta-deprecated.js +6 -0
- package/rules/jet/oj-html-attr-$unique.js +5 -0
- package/rules/jet/oj-html-attr-2def.js +5 -0
- package/rules/jet/oj-html-attr-json.js +6 -1
- package/rules/jet/oj-html-attr-prefix-expr.js +6 -1
- package/rules/jet/oj-html-attr-prefix-ro.js +5 -0
- package/rules/jet/oj-html-attr-req.js +5 -0
- package/rules/jet/oj-html-bindforeach-data.js +6 -1
- package/rules/jet/oj-html-bindif-test.js +6 -1
- package/rules/jet/oj-html-binding-attr.js +6 -1
- package/rules/jet/oj-html-cca-count.js +5 -0
- package/rules/jet/oj-html-cca-tagname.js +6 -1
- package/rules/jet/oj-html-cdn.js +5 -0
- package/rules/jet/oj-html-combo-converter.js +5 -0
- package/rules/jet/oj-html-cspexpr.js +6 -1
- package/rules/jet/oj-html-databind-all.js +5 -0
- package/rules/jet/oj-html-dlg-title.js +6 -1
- package/rules/jet/oj-html-file-pick-accept.js +6 -1
- package/rules/jet/oj-html-form-bindif.js +6 -1
- package/rules/jet/oj-html-form-layout-maxcols.js +6 -1
- package/rules/jet/oj-html-form-noflex.js +5 -0
- package/rules/jet/oj-html-input-isodate.js +6 -0
- package/rules/jet/oj-html-invalid-doctype.js +6 -1
- package/rules/jet/oj-html-jq-databind.js +6 -1
- package/rules/jet/oj-html-ko-comment.js +5 -0
- package/rules/jet/oj-html-ko-databind.js +6 -1
- package/rules/jet/oj-html-label-for-prefix.js +5 -0
- package/rules/jet/oj-html-missing-doctype.js +6 -1
- package/rules/jet/oj-html-msgs-cat-text.js +6 -0
- package/rules/jet/oj-html-no-style-tag.js +6 -0
- package/rules/jet/oj-html-notag-style.js +6 -0
- package/rules/jet/oj-html-oj-lib.js +5 -0
- package/rules/jet/oj-html-ojattr-520.js +6 -1
- package/rules/jet/oj-html-ojattr-deprecated.js +6 -1
- package/rules/jet/oj-html-ojattr-enum-deprecated.js +6 -1
- package/rules/jet/oj-html-ojattr-evt-syntax.js +6 -1
- package/rules/jet/oj-html-ojattr-value.js +6 -1
- package/rules/jet/oj-html-ojattr.js +6 -1
- package/rules/jet/oj-html-ojevent.js +6 -1
- package/rules/jet/oj-html-ojslot.js +6 -1
- package/rules/jet/oj-html-ojstyle.js +5 -0
- package/rules/jet/oj-html-ojtag-datacmd.js +6 -1
- package/rules/jet/oj-html-ojtag-datactx.js +5 -0
- package/rules/jet/oj-html-ojtag-deprecated.js +6 -1
- package/rules/jet/oj-html-ojtag-globattr-noprefix.js +6 -1
- package/rules/jet/oj-html-ojtag-id.js +5 -0
- package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +6 -1
- package/rules/jet/oj-html-ojtag-ns.js +5 -0
- package/rules/jet/oj-html-picker-attrs.js +6 -0
- package/rules/jet/oj-html-redwood-cssnovars.js +6 -0
- package/rules/jet/oj-html-redwood-cssvars.js +6 -0
- package/rules/jet/oj-html-self-close.js +5 -0
- package/rules/jet/oj-html-slot-item-minmax.js +6 -0
- package/rules/jet/oj-html-slot-name.js +6 -1
- package/rules/jet/oj-html-slot-pref-content.js +6 -0
- package/rules/jet/oj-html-style-abs-units.js +5 -0
- package/rules/jet/oj-html-style-bp-color.js +5 -0
- package/rules/jet/oj-html-style-bp-display.js +6 -1
- package/rules/jet/oj-html-style-bp-font-family.js +5 -0
- package/rules/jet/oj-html-style-bp-font.js +5 -0
- package/rules/jet/oj-html-style-deprecated.js +6 -1
- package/rules/jet/oj-html-style.js +6 -1
- package/rules/jet/oj-html-stylesel.js +6 -1
- package/rules/jet/oj-html-tag-attr-noprefix.js +6 -1
- package/rules/jet/oj-html-template-index.js +6 -1
- package/rules/jet/oj-html-unsup-theme.js +6 -1
- package/rules/jet/oj-html-wctag-$props.js +6 -1
- package/rules/jet/oj-html-wctag-arialabelledby.js +5 -0
- package/rules/jet/oj-html-wctag-for.js +5 -0
- package/rules/jet/oj-html-wctag-id.js +6 -1
- package/rules/jet/oj-html-wctag-nested.js +6 -0
- package/rules/jet/oj-html-wctag-packprivate.js +6 -0
- package/rules/jet/oj-js-comp-attr-deprecated.js +6 -1
- package/rules/jet/oj-js-comp-meth-deprecated.js +6 -1
- package/rules/jet/oj-js-no-ext-final.js +5 -0
- package/rules/jet/oj-js-noconsole.js +5 -0
- package/rules/jet/oj-js-ojcomp-deprecated.js +6 -1
- package/rules/jet/oj-js-ojcomp-exist.js +5 -0
- package/rules/jet/oj-js-ojcomp-new.js +5 -0
- package/rules/jet/oj-js-poly-promise.js +6 -1
- package/rules/jet/oj-js-var-undef.js +5 -0
- package/rules/jet/oj-json-syntax.js +5 -0
- package/rules/jet/oj-ts-comp-attr-deprecated.js +6 -1
- package/rules/jet/oj-ts-comp-meth-deprecated.js +6 -1
- package/rules/jet/oj-ts-no-ext-final.js +6 -0
- package/rules/jet/oj-ts-noconsole.js +6 -1
- package/rules/jet/oj-ts-ojcomp-deprecated.js +6 -1
- package/rules/jet/oj-ts-ojcomp-exist.js +6 -1
- package/rules/jet/oj-ts-ojcomp-new.js +6 -1
- package/rules/jet/oj-ts-poly-promise.js +6 -1
- package/rules/jet/rules.json +6 -1
- package/schema/component-schema.json +125 -2
- package/src/JafCore.js +6 -1
- package/types/index.d.ts +175 -37
- package/lib/stats.js +0 -1
- package/rulepacks/jetwc-lib/component-audit-utils.js +0 -1
- package/rules/exch/helpers/json-prop-pos.js +0 -1
- package/rules/exch/msgid.json +0 -1
- package/rules/exch/oj-cca-comp-zip-content-composite.js +0 -1
- package/rules/exch/oj-cca-comp-zip-content-pack.js +0 -1
- package/rules/exch/oj-cca-comp-zip-expand.js +0 -1
- package/rules/exch/oj-cca-compjson-evnames.js +0 -1
- package/rules/exch/oj-cca-compjson-file.js +0 -1
- package/rules/exch/oj-cca-compjson-prefix.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-compdeps.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-deps.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-jetver.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-obs.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-type.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-types.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-undef.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-version.js +0 -1
- package/rules/exch/oj-cca-compjson-schema.js +0 -1
- package/rules/exch/oj-cca-zip-compjson.js +0 -1
- package/rules/exch/rules.json +0 -1
- package/rules/jet/oj-css-bp-bgcolor.js +0 -1
- package/tests/components/attr-req-test/component.json +0 -1
- package/tests/components/demo-analog-clock/component.json +0 -1
- package/tests/components/demo-analog-clock/demo-analog-clock-viewModel.js +0 -1
- package/tests/components/demo-analog-clock/extension/demo/js/viewModels/demo.js +0 -1
- package/tests/components/demo-analog-clock/loader.js +0 -1
- package/tests/components/demo-card/component.json +0 -1
- package/tests/components/demo-chart-orientation-control/component.json +0 -1
- package/tests/components/demo-chart-stack-control/component.json +0 -1
- package/tests/components/made-up/component.json +0 -1
- package/tests/components/oj-made-up/component.json +0 -1
- package/tests/components/sp-activity-item/component.json +0 -1
- package/tests/config/config_base.json +0 -1
- package/tests/golden/10.0.0/golden_base.json +0 -1
- package/tests/golden/8.1.0/golden_base.json +0 -1
- package/tests/golden/9.0.0/golden_base.json +0 -1
- package/tests/rulepacks/hooks/hook-rpext.js +0 -1
- package/tests/rulepacks/hooks/hook-start-close-rulepack.js +0 -1
- package/tests/rulepacks/hooks/rule-rpext.js +0 -1
- package/tests/rulepacks/hooks/rules.json +0 -1
- package/tests/rulepacks/tags/proc_directive.js +0 -1
- package/tests/rulepacks/tags/rules.json +0 -1
- package/tests/rulepacks/tags/tag-count-setup.js +0 -1
- package/tests/rulepacks/tags/tag-count.js +0 -1
- package/tests/rules/bugs/JET-4770_PASS_1.html +0 -9
- package/tests/rules/comments/com_FAIL_1.js +0 -57
- package/tests/rules/comments/com_FAIL_2.js +0 -96
- package/tests/rules/comments/com_PASS_1.js +0 -42
- package/tests/rules/comments/com_PASS_2.js +0 -63
- package/tests/rules/comments/com_PASS_3.js +0 -40
- package/tests/rules/comments/com_PASS_4.js +0 -36
- package/tests/rules/comments/com_PASS_5.js +0 -19
- package/tests/rules/csp/html-script-unsafe-inline/FAIL_1.html +0 -11
- package/tests/rules/csp/html-script-unsafe-inline/FAIL_2.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_1.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_2.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_3.html +0 -8
- package/tests/rules/csp/html-style-unsafe-inline/FAIL_1.html +0 -11
- package/tests/rules/csp/html-style-unsafe-inline/PASS_1.html +0 -11
- package/tests/rules/csp/html-unsafe-expr/FAIL_1.html +0 -14
- package/tests/rules/csp/html-unsafe-expr/PASS_1.html +0 -23
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_1.js +0 -17
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_2.js +0 -40
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_3.js +0 -22
- package/tests/rules/csp/js-script-unsafe-eval/PASS_1.js +0 -20
- package/tests/rules/csp/js-script-unsafe-eval/PASS_2.js +0 -44
- package/tests/rules/csp/js-script-unsafe-eval/PASS_3.js +0 -16
- package/tests/rules/csp/js-style-unsafe-inline/FAIL_1.js +0 -25
- package/tests/rules/csp/js-style-unsafe-inline/PASS.js +0 -22
- package/tests/rules/demo/noself_FAIL_1.js +0 -101
- package/tests/rules/import/import_FAIL_1.js +0 -11
- package/tests/rules/import/import_PASS_1.js +0 -10
- package/tests/rules/jet-composites/demo-buttonset-enum/component.json +0 -57
- package/tests/rules/jet-composites/demo-buttonset-enum/loader.js +0 -19
- package/tests/rules/jet-composites/demo-buttonset-enum/view.html +0 -48
- package/tests/rules/jet-composites/demo-card/component.json +0 -28
- package/tests/rules/jet-composites/demo-card/loader.js +0 -16
- package/tests/rules/jet-composites/demo-card/view.html +0 -30
- package/tests/rules/jet-composites/demo-card/viewModel.js +0 -46
- package/tests/rules/jet-composites/demo-card/view_PASS_1.html +0 -21
- package/tests/rules/jet-composites/demo-contact-form/component.json +0 -23
- package/tests/rules/jet-composites/demo-contact-form/loader.js +0 -16
- package/tests/rules/jet-composites/demo-contact-form/view.html +0 -9
- package/tests/rules/jet-composites/demo-grocery-list/component.json +0 -18
- package/tests/rules/jet-composites/demo-grocery-list/loader.js +0 -19
- package/tests/rules/jet-composites/demo-grocery-list/view.html +0 -22
- package/tests/rules/jet-composites/demo-grocery-list/viewModel.js +0 -48
- package/tests/rules/jet-composites/dummy-component-1/component.json +0 -82
- package/tests/rules/jet-composites/dummy-component-2/component.json +0 -72
- package/tests/rules/jet-composites/foo-my-cca/component.json +0 -14
- package/tests/rules/jet-composites/foo-unsup-theme/component.json +0 -29
- package/tests/rules/jet-composites/header/component.json +0 -12
- package/tests/rules/jet-composites/oj-cgbu-omc/attribute-selection/component.json +0 -154
- package/tests/rules/jet-composites/oj-cgbu-omc/component.json +0 -11
- package/tests/rules/jet-composites/oj-cgbu-omc/reference/component.json +0 -185
- package/tests/rules/jet-composites/oj-cgbu-omc/wctag_props_FAIL_1.html +0 -34
- package/tests/rules/jet-composites/oj-enum-depr/component.json +0 -69
- package/tests/rules/jet-composites/oj-html-wctag-id/id_FAIL_1.html +0 -10
- package/tests/rules/jet-composites/oj-html-wctag-id/id_PASS_1.html +0 -6
- package/tests/rules/misc/oj.js +0 -12
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_1.html +0 -23
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_1.html +0 -23
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_2.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_3.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_4.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_5.html +0 -22
- package/tests/rules/oj-acc-aria-prop/aria_prop_FAIL_1.html +0 -22
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_1.html +0 -23
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_2.html +0 -24
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_3.html +0 -21
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_4.html +0 -22
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_5.html +0 -22
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_2.html +0 -21
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_PASS_1.html +0 -20
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_1.html +0 -21
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_PASS_1.html +0 -22
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_1.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_2.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_1.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_2.html +0 -19
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_3.html +0 -22
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_1.html +0 -21
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_1.html +0 -16
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_3.html +0 -26
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_PASS_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_2.html +0 -18
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_PASS_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_PASS_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_3_PASS_1.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_2.html +0 -21
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_PASS_2.html +0 -62
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_nolabel_PASS_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_PASS_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_PASS_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_2.html +0 -21
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_1.zip +0 -1
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_2.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_3.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_4.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_5.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_6.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_7.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_8.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_PASS_1.zip +0 -0
- package/tests/rules/oj-cca-ns-reg/oj-cca-ns-FAIL_1/component.json +0 -19
- package/tests/rules/oj-cca-ns-reg/oj-cca-ns-PASS_1/component.json +0 -19
- package/tests/rules/oj-cgbu-omc_tests/html_ojevent_FAIL_1.html +0 -15
- package/tests/rules/oj-cgbu-omc_tests/html_ojevent_PASS_1.html +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_1/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_10/component.json +0 -103
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_11/component.json +0 -24
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_12/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_13/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_14/component.json +0 -40
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_15/component.json +0 -24
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_16/component.json +0 -44
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_17/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_18/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_19/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_2/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_20/component.json +0 -18
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_21/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_22/component.json +0 -19
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_3/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_4/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_5/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_6/component.json +0 -18
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_7/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_8/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_9/component.json +0 -52
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_1/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_2/component.json +0 -88
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_3/component.json +0 -19
- package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_1.html +0 -22
- package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_2.html +0 -22
- package/tests/rules/oj-css-diagnose/css_FAIL_1.html +0 -14
- package/tests/rules/oj-css-diagnose/css_PASS_1.html +0 -14
- package/tests/rules/oj-css-var-override/varovr_FAIL_1.html +0 -8
- package/tests/rules/oj-html-5-attr-depr/attrdepr_FAIL_1.html +0 -16
- package/tests/rules/oj-html-5-attr-depr/attrdepr_PASS_1.html +0 -16
- package/tests/rules/oj-html-5-tag-depr/tagdepr_FAIL_1.html +0 -9
- package/tests/rules/oj-html-attr/attr_FAIL_1.html +0 -27
- package/tests/rules/oj-html-attr-$unique/attr_$unique1_FAIL_1.html +0 -19
- package/tests/rules/oj-html-attr-$unique/attr_$unique_FAIL_2.html +0 -25
- package/tests/rules/oj-html-attr-2def/attr2def_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-2def/attr2def_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_1.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_2.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_3.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_1.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_2.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_3.html +0 -8
- package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_1.html +0 -17
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_2.html +0 -13
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_3.html +0 -8
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_4.html +0 -13
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_5.html +0 -17
- package/tests/rules/oj-html-attr-req/attrreq_PASS_1.html +0 -24
- package/tests/rules/oj-html-attr-req/attrreq_PASS_2.html +0 -24
- package/tests/rules/oj-html-attr-req/attrreq_PASS_3.html +0 -10
- package/tests/rules/oj-html-attr-req/attrreq_PASS_4.html +0 -11
- package/tests/rules/oj-html-bindforeach-data/bindforeach_data_FAIL_1.html +0 -19
- package/tests/rules/oj-html-bindforeach-data/bindforeach_data_PASS_1.html +0 -10
- package/tests/rules/oj-html-bindif-test/bindif_test_FAIL_1.html +0 -22
- package/tests/rules/oj-html-bindif-test/bindif_test_PASS_1.html +0 -11
- package/tests/rules/oj-html-binding-attr/binding-foreach_FAIL_2.html +0 -28
- package/tests/rules/oj-html-binding-attr/binding-if_FAIL_1.html +0 -23
- package/tests/rules/oj-html-binding-attr/binding-if_PASS_1.html +0 -23
- package/tests/rules/oj-html-cca-count/cca-count_FAIL_1.html +0 -119
- package/tests/rules/oj-html-cca-tagname/ccatag_FAIL_1.html +0 -7
- package/tests/rules/oj-html-cca-tagname/ccatag_PASS_1.html +0 -7
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_1.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_2.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_3.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_PASS_1.html +0 -10
- package/tests/rules/oj-html-cdn/html_cdn_FAIL_1.html +0 -18
- package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_1.html +0 -14
- package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_2.html +0 -10
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_1.html +0 -23
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_2.html +0 -10
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_3.html +0 -13
- package/tests/rules/oj-html-dlg-title/dlgtitle_FAIL_1.html +0 -12
- package/tests/rules/oj-html-dlg-title/dlgtitle_PASS_1.html +0 -12
- package/tests/rules/oj-html-form-noflex/noflex_FAIL_1.html +0 -10
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_1.html +0 -20
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_2.html +0 -13
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_3.html +0 -16
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_4.html +0 -13
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_1.html +0 -6
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_2.html +0 -7
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_3.html +0 -7
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_1.html +0 -37
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_2.html +0 -34
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_3.html +0 -27
- package/tests/rules/oj-html-jq-databind/jq-databind_PASS_1.html +0 -30
- package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_1.html +0 -47
- package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_2.html +0 -36
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_1.html +0 -24
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_2.html +0 -36
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_3.html +0 -29
- package/tests/rules/oj-html-label-for-prefix/for_FAIL_1.html +0 -8
- package/tests/rules/oj-html-label-for-prefix/for_PASS_1.html +0 -8
- package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_1.html +0 -12
- package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_2.html +0 -11
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_1.html +0 -14
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_2.html +0 -5
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_3.html +0 -12
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_5.html +0 -6
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_1.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_2.html +0 -14
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_3.html +0 -13
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_5.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_6.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_PASS_1.html +0 -7
- package/tests/rules/oj-html-oj-lib/oj_lib_FAIL_1.html +0 -15
- package/tests/rules/oj-html-ojattr/ojattr_PASS_1.html +0 -8
- package/tests/rules/oj-html-ojattr/ojattr_PASS_2.html +0 -10
- package/tests/rules/oj-html-ojattr/ojattr_PASS_3.html +0 -7
- package/tests/rules/oj-html-ojattr/ojattr_PASS_4.html +0 -7
- package/tests/rules/oj-html-ojattr-deprecated/ojattr-dep_FAIL1.html +0 -156
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_1.html +0 -19
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_2.html +0 -20
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_PASS_1.html +0 -25
- package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_FAIL_1.html +0 -6
- package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_PASS_1.html +0 -6
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_1.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_2.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_3.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_4.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_5.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_1.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_2.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_3.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_6.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_7.html +0 -10
- package/tests/rules/oj-html-ojattr-value/attr_value_PASS_4.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr_value_PASS_5.html +0 -9
- package/tests/rules/oj-html-ojslot/ojslot_FAIL_1.html +0 -11
- package/tests/rules/oj-html-ojslot/ojslot_PASS_1.html +0 -12
- package/tests/rules/oj-html-ojstyle/style_FAIL_1.html +0 -103
- package/tests/rules/oj-html-ojstyle/style_PASS_2.html +0 -7
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_1.html +0 -10
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_2.html +0 -18
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_3.html +0 -10
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_1.html +0 -28
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_2.html +0 -15
- package/tests/rules/oj-html-ojtag-datactx/datactx_FAIL_1.html +0 -14
- package/tests/rules/oj-html-ojtag-datactx/datactx_PASS_1.html +0 -14
- package/tests/rules/oj-html-ojtag-globattr-noprefix/globattr-noprefix_FAIL_1.html +0 -36
- package/tests/rules/oj-html-ojtag-nonglobattr-prefix/nonglobattr-prefix_FAIL_1.html +0 -26
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_1.html +0 -24
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_2.html +0 -46
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_3.html +0 -10
- package/tests/rules/oj-html-slot-name/slot_name.PASS_1.html +0 -24
- package/tests/rules/oj-html-slot-name/slot_name.PASS_2.html +0 -39
- package/tests/rules/oj-html-slot-name/slot_name.PASS_3.html +0 -10
- package/tests/rules/oj-html-slot-name/slot_name_PASS_4.html +0 -16
- package/tests/rules/oj-html-slot-name/slot_name_PASS_5.html +0 -11
- package/tests/rules/oj-html-slot-name/slot_name_PASS_6.html +0 -14
- package/tests/rules/oj-html-slot-name/slot_name_PASS_7.html +0 -10
- package/tests/rules/oj-html-style/style_FAIL_1.html +0 -7
- package/tests/rules/oj-html-style/style_PASS_1.html +0 -12
- package/tests/rules/oj-html-style/style_PASS_2.html +0 -7
- package/tests/rules/oj-html-style-bp-color/color-FAIL_1.html +0 -17
- package/tests/rules/oj-html-style-bp-color/color-FAIL_2.html +0 -15
- package/tests/rules/oj-html-style-bp-color/color-FAIL_3.html +0 -7
- package/tests/rules/oj-html-style-bp-color/color-PASS_1.html +0 -7
- package/tests/rules/oj-html-style-bp-font-family/fam_FAIL_1.html +0 -23
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_1.html +0 -15
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_2.html +0 -9
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_PASS_1.html +0 -9
- package/tests/rules/oj-html-unsup-theme/unsup_FAIL_1.html +0 -8
- package/tests/rules/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/rules/oj-js-comp-attr-deprecated/attr-del_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-attr-deprecated/attr-dep_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-meth-deprecated/meth-del_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-meth-deprecated/meth-dep_FAIL_1.js +0 -20
- package/tests/rules/oj-js-define-promise/def-prom_FAIL_1.js +0 -16
- package/tests/rules/oj-js-define-promise/def-prom_FAIL_2.js +0 -16
- package/tests/rules/oj-js-diagnose/es6_PASS_1.js +0 -24
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_1.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_2.js +0 -23
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_3.js +0 -22
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_4.js +0 -20
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_5.js +0 -24
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_6.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_7.js +0 -15
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_8.js +0 -16
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_1.js +0 -17
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_2.js +0 -17
- package/tests/rules/oj-js-noconsole/nocons_FAIL_1.js +0 -11
- package/tests/rules/oj-js-ojcomp-deprecated/jscomp_FAIL_1.js +0 -27
- package/tests/rules/oj-json-syntax/json_FAIL_1.json +0 -8
- package/tests/rules/oj-json-syntax/json_FAIL_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_1.json +0 -25
- package/tests/rules/oj-json-syntax/json_PASS_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_3.json +0 -14
- package/tests/rules/ojcompjson/attrreq_FAIL_1/component.json +0 -69
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-view.html +0 -6
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-1/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-1/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-view.html +0 -5
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-2/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-2/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component.json +0 -12
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-view.html +0 -5
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-1/component.json +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/resources/nls/audit-singleton-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-view.html +0 -8
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-2/component.json +0 -15
- package/tests/rules/pack-compjson/audit-singleton-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-2/resources/nls/audit-singleton-2-strings.js +0 -18
- package/tests/rules/parse-html/proc_instr.html +0 -9
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_1.js +0 -113
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_2.js +0 -151
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_1.js +0 -149
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_2.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_3.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_4.js +0 -20
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_5.js +0 -246
- package/tests/rules/tab-tests/tab-test_FAIL_1.html +0 -37
- package/tests/rules/tab-tests/tab-test_FAIL_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/src/JetTest.js +0 -1
- package/tests/src/server.js +0 -1
- package/tests/test.js +0 -1
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULENAME='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, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULENAME="oj-css-bp-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, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULENAME="oj-css-bp-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
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const{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._accept=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
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const 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, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-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, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULENAME="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, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-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;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-css-style-deprecated";const SHORT="Deprecated JET CSS style class selectors should not be used";const LONG="Deprecated JET CSS style class selectors should not be used";const OJ="oj-";const EXCEPTION_LIST=["oj-tabbar-stack-icon-label"];function Rule(){this._checkList=null;this._isAccept=false};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return LONG};Rule.prototype.register=function(regCtx){if(!this._checkAcceptReject(regCtx)){return false}return{"css-rule":this._onRule}};Rule.prototype._onRule=function(ruleCtx,rule){var sels,sel,dep,descr,issue,i;sels=_getOjClassSelectors(rule);if(!sels.length){return}for(i=0;i<sels.length;i+=2){sel=sels[i];if(this._OkSel(sel)){dep=ruleCtx.utils.metaLib.isStyleDeprecated(sel);if(dep){descr=dep.description?dep.description.trim():null;if(descr&&!descr.endsWith(".")){descr+="."}issue=new ruleCtx.Issue("JET CSS class selector '"+sel+"' is deprecated"+(dep.since?" (since "+dep.since+")":"")+"."+(descr?" "+descr:""));issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,sels[i+1]));ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _getOjClassSelectors(rule){var sels,sel,a,c,i,j,ret=[];if(!(rule.prelude&&rule.prelude.children)||rule.prelude.type!=="SelectorList"){return ret}a=rule.prelude.children;for(i=0;i<a.length;i++){sels=a[i];if(sels.type==="Selector"){c=sels.children;for(j=0;j<c.length;j++){sel=c[j];if(sel.type==="ClassSelector"&&sel.name.startsWith(OJ)){ret.push(sel.name);ret.push(sel.loc)}}}}return ret};Rule.prototype._OkSel=function(sel){if(EXCEPTION_LIST.includes(sel)){return false}if(this._checkList){for(let i=0;i<this._checkList.length;i++){if(this._checkList[i].test(sel)){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]=new RegExp(this._checkList[i].trim())}}}return true};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-css-style-override";const SHORT_DESCRIPT="JET CSS style classes should not be overridden";const DESCRIPT=SHORT_DESCRIPT;const SELECTOR_LIST="SelectorList";const CLASS_SELECTOR="ClassSelector";const TYPE_SELECTOR="TypeSelector";const PSEUDO_CLASS_SELECTOR="PseudoClassSelector";const NUMBER="number";const STRING="string";const NOT_CLASSES=["oj-complete"];const OVERRIDE_LIST=["oj-buttonset-one","oj-buttonset-many","oj-color-invert","oj-badge-sm","oj-navigationlist-vertical","oj-navigationlist-horizontal","oj-navigationlist-icon-only","oj-navigationlist-stack-icon-label","oj-input-search-hero","oj-avatar-bg-purple","oj-avatar-bg-orange","oj-avatar-bg-teal","oj-avatar-bg-green","oj-avatar-bg-pink","oj-avatar-bg-slate","oj-avatar-bg-blue","oj-avatar-bg-lilac","oj-avatar-bg-gray","oj-avatar-xxs","oj-avatar-xs","oj-avatar-sm","oj-avatar-lg","oj-avatar-xl","oj-avatar-xxl","oj-tabbar-vertical","oj-tabbar-horizontal","oj-tabbar-icon-only","oj-tabbar-stack-icon-label","oj-invalid-drop"];const OVERRIDE_LIST_PREFIX=["oj-animate-inline-"];const NO_OVERRIDE=["oj-removable"];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._checkAcceptRejectOption(regCtx)){return false}this._metaLib=regCtx.utils.metaLib;if(!this._metaLib.hasJetStylePrefixes()){return false}return{"css-rule":this._onRule}};Rule.prototype._onRule=function(ruleCtx,rule){var sels,sel,t,i;sels=this._getOjSelectors(rule,this._metaLib);if(!sels.length){return}for(i=0;i<sels.length;i+=3){sel=sels[i];t=sels[i+1];if(_isBuiltinOverride(sel)){continue}if(this._checkList&&this._isSelAccepted(sel)){this._emitIssue(ruleCtx,t,sel,sels[i+2])}else if(t===CLASS_SELECTOR||t===TYPE_SELECTOR&&this._metaLib.isJetTag(sel)){this._emitIssue(ruleCtx,t,sel,sels[i+2])}};};Rule.prototype._emitIssue=function(ruleCtx,type,sel,loc){var tag,issue;if(type===TYPE_SELECTOR){issue=new ruleCtx.Issue(`type Selector '${sel}' must not be overridden.`);issue.setMsgKey(ruleCtx.ruleName+"_2")}else{tag=ruleCtx.utils.metaLib.getJetTagFromStyle(sel);issue=new ruleCtx.Issue(`class selector '.${sel}' ${tag?"(for <"+tag+">) ":""}must not be overridden.`);issue.setMsgKey(ruleCtx.ruleName+"_1")}issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,loc));ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._getOjSelectors=function(rule){var sels,sel,a,c,i,j,ret=[];if(!(rule.prelude&&rule.prelude.children)||rule.prelude.type!=="SelectorList"){return ret}a=rule.prelude.children;for(i=0;i<a.length;i++){sels=a[i];if(sels.type==="Selector"){c=sels.children;for(j=0;j<c.length;j++){sel=c[j];if(sel.type===CLASS_SELECTOR&&(this._metaLib.isJetStylePrefix(sel.name)||NO_OVERRIDE.includes(sel.name))||sel.type===TYPE_SELECTOR&&this._metaLib.isJetTag(sel.name)){ret.push(sel.name);ret.push(sel.type);ret.push(sel.loc)}else if(sel.type===PSEUDO_CLASS_SELECTOR){this._evalPseudoClassSelector(sel,ret,sel.name)}}}}return ret};Rule.prototype._evalPseudoClassSelector=function(sel,a,pseudo){var c,o,l,e,i,j;if(!(c=sel.children)){return}for(i=0;i<c.length;i++){o=c[i];if(o.type==="Selector"){if(l=o.children){for(j=0;j<l.length;j++){e=l[j];if(e.type===CLASS_SELECTOR&&this._metaLib.isJetStylePrefix(e.name)||e.type===TYPE_SELECTOR&&this._metaLib.isJetTag(e.name)){if(!_checkNotClasses(e.name)){a.push(e.name);a.push(e.type);a.push(e.loc)}}}}continue}else{if(o.type!==SELECTOR_LIST){continue}}this._evalPseudoClassSelector(o,a,pseudo)}};Rule.prototype._isSelAccepted=function(sel){if(this._checkList){for(let i=0;i<this._checkList.length;i++){if(this._checkList[i].test(sel)){return this._isAccept}}return!this._isAccept}return true};Rule.prototype._checkAcceptRejectOption=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}: override 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){if(!(this._checkList[i]=this._makeRegExp(regCtx,this._checkList[i].trim(),i))){return false}}}}return true};Rule.prototype._makeRegExp=function(ruleCtx,s,x){var re;try{re=new RegExp(s.trim())}catch(e){re=null}if(!re){var s=typeof x===NUMBER?`element ${x} `:"";ruleCtx.utils.msgLib.error(`Rule ${RULE_NAME}: in override option '${this._isAccept?"accept":"reject"}' element ${x} is not a valid regular expression`)}return re};function _isBuiltinOverride(sel){if(OVERRIDE_LIST.includes(sel)){return true}for(let i=0;i<OVERRIDE_LIST_PREFIX.length;i++){if(sel.startsWith(OVERRIDE_LIST_PREFIX[i])){return true}}return false};function _checkNotClasses(name){return NOT_CLASSES.includes(name)};module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULENAME="oj-css-var-override";const DESCRIPTION="CSS Vars may be available for use on the client, but they cannot be overriden in this project.";const SHORT_DESCRIPTION="CSS Vars may be available for use on the client, but they cannot be overriden in this project.";const DECLARATION="Declaration";const VAR_PREFIX="--";const COLON=":";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){if(!this._checkRuleOptions(regCtx)){return false}return{"css-rule":this._onRule,"style":this._onStyle}}_onRule(ruleCtx,rule){var block,decl,issue,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&&decl.property.startsWith(VAR_PREFIX)){if(this._okProp(decl)){issue=new ruleCtx.Issue(`CSS var '${decl.property}' should not be overridden`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}_onStyle(ruleCtx,attr,attrVal){var csv,issue,i,x;for(i=0;i<attrVal.length;i++){csv=attrVal[i];if(csv.startsWith(VAR_PREFIX)){x=csv.indexOf(COLON);if(x>0){csv=csv.substring(2,x).trimRight();issue=new ruleCtx.Issue(`CSS var '${csv}' in 'style' attribute should not be overridden`);issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}_okProp(decl){var cvar,list,i;cvar=decl.property;list=this._ignore||this._accept;if(!list){return true}for(i=0;i<list.length;i++){if(list[i].test(cvar)){return!!this._accept}}return!!this._accept}_checkRuleOptions(regCtx){var cvars,accept,ign,b;cvars=regCtx.ruleOpts["vars"];if(cvars){if(!regCtx.utils.utils.isObject(cvars)){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'vars' is not an object`);this._fail=true;return false}accept=cvars.accept;ign=cvars.ignore;if(accept&&ign){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'vars' - sub-properties 'accept' and 'ignore are mutually exclusive`);b=true}if(!b){if(accept){this._accept=this._getOptionVars(regCtx,"accept",accept)}else if(ign){this._ignore=this._getOptionVars(regCtx,"ignore",ign)}}}return this._fail?false:!b}_getOptionVars(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}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-form-maxcols";const DESCRIPTION="Prior to JET 10.0.0, maxColumns in 'row' direction was not responsive, so that the "+"number of columns was exactly equal to maxColumns. In JET 10.0.0 and later, maxColumns "+"<b>is</b> responsive, so that the actual number of columns may now be less, depending on the "+"space available to the form.<br>If the app needs to preserve the old fixed-columns behavior, "+"then it should remove any 'max-columns' attribute (which is deprecated in dynamic UI 10.0.0) "+"from <oj-dynamic-form>, and set the new 'columns' property in the layout.";const SHORT_DESCRIPTION="The 'max-columns' attribute for <oj-dynamic-form>, or the 'maxColumns' property for layout, may have a behavioral change in JET 10.0.0.";var path;const LAYOUT_JSON="layout.json";const FORM="form";const LAYOUTS="layouts";const MAX_COLUMNS="max-columns";const COLUMN="column";const DIRECTION="direction";const ID="id";const SEV_CRITICAL="critical";const ISSUE="<@tag@id> with 'max-columns' may have a behavior change in JET 10.0.0.";class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){path=require("path");return{"json":this._onJson,"<oj-dynamic-form>":this._onTag}}_onJson(ruleCtx){var json,layouts,name,obj,layouts,layout,olayouts,issue,pos;if(path.basename(ruleCtx.filepath)!==LAYOUT_JSON){return}json=ruleCtx.suppData.obj;if(ruleCtx.suppData.msg){if(!ruleCtx.rulePack.isRuleEnabled("oj-json-syntax","JET")){issue=new ruleCtx.Issue(ruleCtx.suppData.msg);issue.setPosition(ruleCtx.suppData.line,ruleCtx.suppData.col,ruleCtx.suppData.position,ruleCtx.suppData.position+3);issue.setMsgKey(RULE_NAME+"_2");issue.setSeverity(SEV_CRITICAL);ruleCtx.reporter.addIssue(issue,ruleCtx);return}}if(!(layouts=json.layouts)){return}for(name in layouts){obj=layouts[name];if(obj.layoutType!==FORM){continue}if(!(olayouts=obj.layouts)){continue}for(layout in olayouts){obj=olayouts[layout];if(obj.layoutType===FORM&&obj.layout){if(obj.layout.maxColumns>1){if(!obj.layout.columns||obj.layout.direction!==COLUMN){issue=new ruleCtx.Issue(`layout '${name}' : '${layout}' with maxColumns may have behavior change in JET 10.0.x.`);if(pos=_getPos(ruleCtx.suppData.ast,name,layout)){issue.setPosition(pos.row,pos.col,pos.start,pos.end)}issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}}_onTag(ruleCtx,tag){if(_isGT(_getTagAttr(ruleCtx,MAX_COLUMNS),1)&&_getTagAttr(ruleCtx,DIRECTION)!==COLUMN){let id=_getTagAttr(ruleCtx,ID);id=id?" id='"+id+"'":"";let msg=ISSUE.replace("@tag",tag).replace("@id",id);let issue=new ruleCtx.Issue(msg);let pos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,MAX_COLUMNS);issue.setPosition(pos.row,pos.col,pos.start,pos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}function _getLayout(member,name,layoutName){var layouts,mems,mem,lo,ar,i,j,k;layouts=member.value.members;for(i=0;i<layouts.length;i++){if(layouts[i].name===name){lo=layouts[i];if(lo.value&&lo.value.type==="Object"){mems=lo.value.members;if(mems){for(j=0;j<mems.length;j++){mem=mems[j];if(mem.name===LAYOUTS){if(mem.value.type==="Object"){ar=mem.value.members;for(k=0;k<ar.length;k++){if(ar[k].name===layoutName){return ar[k]}}}}}}}}}};function _getPos(ast,name,layoutName){var members,member,layout,mems,pos,i,j;members=ast.members;for(i=0;i<members.length;i++){member=members[i];if(member.name===LAYOUTS&&member.value){if(layout=_getLayout(member,name,layoutName)){if(layout&&layout.value&&layout.value.type==="Object"){mems=layout.value.members;for(j=0;j<mems.length;j++){if(mems[j].name==="layout"){pos=mems[j].pos;return{row:pos.row,col:pos.col,start:pos.index,end:pos.index+layoutName.length}}}}}}}return null};function _getTagAttr(ruleCtx,attr){var attrs=ruleCtx.tagNode.attribs;return attrs?attrs[attr]:null}function _isGT(val,n){val=parseInt(val);return!isNaN(val)&&val>n}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-html-5-attr-obs";const POSSIBLE_CONFORMING_ATTRS={"border":["img"],"charset":["script"],"language":["script"],"type":["script","style"],"name":["a"],"maxlength":["input"],"size":["input"]};function getName(){return RULE_NAME};function getShortDescription(){return"HTML5 obsolete attributes must not be used"};function getDescription(){return"HTML5 obsolete attributes must not be used."};function register(){return{"tag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrName,attrValue,issue,attrPos,possibleConformingAttr;attribs=ruleCtx.node.attribs;if(!attribs){return}for(attrName in attribs){issue=null;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);possibleConformingAttr=_isPossibleConformingAttr(attrName);if(ruleCtx.utils.DomUtils.isHtml5ObsoleteAttr(tagName,attrName)){attrValue=attribs[attrName];if(_isConformingException(tagName,attrName,attrValue,attribs)){continue}issue=new ruleCtx.Issue("Attribute '"+attrName+"' is obsolete "+(possibleConformingAttr?"(but conforming) ":"")+"for <"+tagName+"> in HTML5")}else if(possibleConformingAttr){if(!_isConformingException(tagName,attrName,attrValue,attribs)){issue=new ruleCtx.Issue("Attribute '"+attrName+"' is obsolete but conforming <"+tagName+"> in HTML5")}}if(issue){attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULE_NAME+(possibleConformingAttr?"_2":"_1"));ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _isConformingException(tagName,attrName,attrValue,attribs){var ret=false;if(tagName==="a"&&attrName==="name"){ret=_checkAnchor(attrValue,attribs)}else if(tagName==="img"&&attrName==="border"){ret=_checkImg(attrValue)}else if(tagName==="script"){if(attrName==="language"){ret=_checkScriptLanguage(attrValue,attribs)}else if(attrName==="charset"){ret=_checkScriptCharSet(attrValue,attribs)}}else if(tagName==="style"&&attrName==="type"){ret=_checkStyleType(attrValue,attribs)}return ret};function _checkAnchor(nameValue,attribs){var Id;if(nameValue==="")return true;Id=attribs.id;if(Id&&nameValue===Id)return true;return false};function _checkImg(borderValue){return borderValue==="0"};function _checkScriptLanguage(languageValue,attribs){if(languageValue.toLowerCase()==="javascript"){return!attribs.type||attribs.type.toLowerCase()==="text/javascript"}return true};function _checkScriptCharSet(charSetValue,attribs){return charSetValue.toLowerCase()==="utf-8"};function _checkStyleType(typeValue,attribs){return typeValue.toLowerCase()==="text/css"};function _isPossibleConformingAttr(attrName){};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-html-5-tag-obs";function getName(){return RULE_NAME};function getShortDescription(){return"HTML5 obsolete elements must not be used"};function getDescription(){return"HTML5 obsolete elements must not be used."};function register(){return{"tag":_handleTag}};function _handleTag(ruleCtx,tagName){if(ruleCtx.utils.DomUtils.isHtml5ObsoleteElem(tagName)){var issue=new ruleCtx.Issue("Element <"+tagName+"> is obsolete in HTML5");ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULENAME="oj-html-alta-deprecated";const DESCRIPTION="Starting from JET 10, the Alta theme is deprecated and and use of this theme, or of "+"a custom theme such as the ApplicationsCloudUI theme, which extends it, should be "+"replaced with either the Redwood theme or a custom theme that extends the Redwood "+"theme or the Stable theme. The Alta theme will be removed all together in JET 13 "+"and must be replaced before then.";const SHORT_DESCRIPTION="Detect the use of the deprecated Alta theme";const RE_ALTA_MIN=/.*\/alta\/(oj-alta-min.css|oj-alta.css)/;const RE_APP_CLOUD=/.*\/web\/ApplicationsCloudUI.css/;const RE_INJECT_THEME=/\s*vb:inject\s.*theme="[a-zA-Z0-9\.\/]*ApplicationsCloudUI.css"/;const RE_INJECT=/\s*vb:inject id="headContent"\s*/;const STYLESHEET="stylesheet";const VER_12_0_0="12.0.0";const CRITICAL="critical";const HREF="href";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){let jetVer=regCtx.utils.metaLib.getMetaVers().runver;let semver=regCtx.utils.semVerUtils;this._jetVerGte12=semver.gte(jetVer,VER_12_0_0);return{link:this._onLink,comment:this._onComment}}_onLink(ruleCtx){var href;if(!_isStyleSheetLink(ruleCtx)||!(href=ruleCtx.tagNode.attribs.href)){return}if(RE_ALTA_MIN.test(href)||RE_APP_CLOUD.test(href)){this._emitIssue(ruleCtx,1)}}_onComment(ruleCtx,comment){var emit,stack;if((stack=ruleCtx.elemStack)&&stack.length){stack=stack[stack.length-1];if(stack.type==="tag"&&stack.name==="head"){if(!(emit=RE_INJECT_THEME.test(comment))){if(RE_INJECT.test(comment)){emit=comment.indexOf(" theme=")<0}}if(emit){this._emitIssue(ruleCtx,2,comment)}}}}_emitIssue(ruleCtx,type,comment){var issue,msg,node;msg=type===1?"Stylesheet <link> refers to deprecated Alta theme or a theme that extends it":"vb:inject theme : Alta theme is deprecated";issue=new ruleCtx.Issue(msg);if(type===1){issue.setPosition(ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.node,HREF))}else{node=ruleCtx.node;let x=comment.indexOf("theme=");if(x>=0){x+=node.startIndex;issue.setPosition(null,null,node.startIndex+5,node.endIndex)}else{issue.setPosition(null,null,node.startIndex,node.endIndex)}}if(this._jetVerGte12){issue.setSeverity(CRITICAL)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}function _isStyleSheetLink(ruleCtx){var attribs,ret;if(attribs=ruleCtx.tagNode.attribs){ret=attribs.rel===STYLESHEET}return ret?ret:false}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-html-attr-$unique";const $UNIQUE="$unique";const ID="id";const DATABIND="data-bind";const ATTR="attr";const EXPLAIN="When generating or referencing element IDs in web components, $uniqueId should be used in preference to $unique to guarantee stable UI's for testing.";function getName(){return RULE_NAME};function getShortDescription(){return"Use $uniqueid instead of $unique in Knockout and web component syntax"};function getDescription(){return EXPLAIN};function register(){return{"attr":_handleAttr}};function _handleAttr(ruleCtx,attrName,attrValue){var tagName,issue;tagName=ruleCtx.tag;if(attrName===DATABIND&&attrValue.startsWith(ATTR)){if(_is$Unique(attrValue)){issue=new ruleCtx.Issue("<"+tagName+"> data-bind attribute uses $unique. "+EXPLAIN);issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}return}if(_is$Unique(attrValue)){issue=new ruleCtx.Issue("<"+tagName+"> - found use of $unique. "+EXPLAIN);issue.setMsgKey(RULE_NAME+"_2");ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _is$Unique(s){var x,end,isIssue=false;x=s.indexOf($UNIQUE);if(x>=0){if(s.length>=x+$UNIQUE.length+ID.length){end=s.substr(x+$UNIQUE.length,2).toLowerCase();if(end!==ID){isIssue=true}}else{isIssue=true}}return isIssue};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-html-attr-2def";const DOUBLE_BRACE="{{";const DOUBLE_BRACKET="[[";const EXEMPT=["style","class"];const EXPLAIN="A tag should not contain both an attribute and a colon-prefixed attribute of the same name."+"<p>For example:<p>"+"<div id=\"id1\" :id=\"[[mydiv]]\">";function getName(){return RULE_NAME};function getShortDescription(){return"Check tag does not contain an attribute and a colon-prefixed attribute of the same name"};function getDescription(){return EXPLAIN};function register(){return{"elem":_fnTags}};function _fnTags(ruleCtx,tagName){var attribs,attr,attr2,a,attrPos,issue;attribs=ruleCtx.node.attribs;for(attr in attribs){if(attr.charAt(0)===":"||EXEMPT.includes(attr)){continue}attr2=":"+attr;for(a in attribs){if(a===attr2){issue=new ruleCtx.Issue("<"+tagName+"> contains attributes '"+attr+"' and '"+attr2+"'");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-html-attr-json";const DOUBLE_BRACE="{{";const DOUBLE_BRACKET="[[";const EXPLAIN="When defining a JSON string as an attribute value for a component tag, the JSON must be valid. Expressions enclosed by [[ ]] or {{ }} are not validated."+"<p>"+"When defining a JSON string as an attribute value, the JSON property names (and values where appropriate) must be enclosed with double quotes. "+"This requires that the entire JSON string be delimited with single quotes<br>. For example:<br>"+"<i>options-keys=\"{'label': 'email', 'value': 'id'}\"</i> is invalid, and should be specified as "+"<i>options-keys='{\"label\": \"email\", \"value\": \"id\"}'</i>.<p>"+"Note: this does not apply when an expression is enclosed within [[ ]] or {{ }}, so these are valid:<br>"+"options-keys='[[ {label: 'email', value: 'id'} ]]'<br>"+"options-keys='[[ {label: \"email\", value: \"id\"} ]]'";function getName(){return RULE_NAME};function getShortDescription(){return"Check attribute for starting quote and containing well formed json"};function getDescription(){return EXPLAIN};function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag){var attrs,attr;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){_checkAttr(ruleCtx,tag,attr,attrs[attr])}}};function _checkAttr(ruleCtx,tag,attr,attrValue){var rc,issue,val,attrRawVal,start;val=attrValue.replace(/^\s+/g,"");start=val.charAt(0);if(start!=="{"&&start!=="["||_isExprStart(attrValue)||attr=="data-bind"){return}rc=ruleCtx.utils.DomUtils.isValidJson(attrValue);if(typeof rc==="string"){attrRawVal=ruleCtx.utils.DomUtils.getAttribRawValue(ruleCtx,attr);if(attrRawVal.charAt(0)!=="'"){issue=new ruleCtx.Issue("<"+tag+"> attribute '"+attr+"' containing JSON must be delimited with single-quotes.");issue.setMsgKey(RULE_NAME+"_1")}else{issue=new ruleCtx.Issue("<"+tag+"> attribute '"+attr+"' JSON error : ("+rc+")");issue.setMsgKey(RULE_NAME+"_2")}}if(issue){let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _isExprStart(attrValue){return attrValue.startsWith(DOUBLE_BRACKET)||attrValue.startsWith(DOUBLE_BRACE)};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const isValidAttr=require("./helpers/valid-attr");const RULE_NAME="oj-html-attr-prefix-expr";const COLON=":";const STYLE="style";const STYLE_DOT="style.";const CLASS="class";const TYPE="type";const ON_OJ_EVENT="on-oj-";function getName(){return RULE_NAME};function getShortDescription(){return"Colon-prefixed attribute should specify a '[[...]]' or '{{...}}' expression."};function getDescription(){return"Attributes prefixed with the late-binding indicator <b>':'</b?, should refer to a read-only expression <b>'[[. . .]]'</b>, or a read-write expression '{{. . .}}'</b>."};function register(){return{"elem":_onElem}};function _onElem(ruleCtx,tag){var attrs,attr,val;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){if(attr.charAt(0)===COLON&&typeof(val=attrs[attr])==="string"){attr=attr.substring(1);if(attr===CLASS||attr===TYPE||attr.startsWith(ON_OJ_EVENT)){continue}if(attr===STYLE||attr.startsWith(STYLE_DOT)){continue}if(!isValidAttr(attr)){continue}_checkAttr(ruleCtx,tag,":"+attr,val)}}}};function _checkAttr(ruleCtx,tag,attr,attrValue){let val=attrValue.trim();if(!val.startsWith("{{")&&!val.startsWith("[[")){let issue=new ruleCtx.Issue(`Colon-prefixed attribute '${attr}' is not a read-only '[[...]]', or read-write '{{...}} expression`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attr);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, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-html-attr-prefix-ro";function getName(){return RULE_NAME};function getShortDescription(){return"Colon-prefixed attribute should specify a non-RW expression."};function getDescription(){return"Attributes prefixed with the late-binding indicator <b>':'</b?, should refer to a read-only expression <b>'[[. . .]]'</b> in preference to '{{. . .}}'</b>. "+"Although use of the form '{{...}}' is functional, it is misleading to use a read/write expression that can only be read-only."};function register(){return{"attrexpr":_fnAttr}};function _fnAttr(ruleCtx,attrName,attrValue){var issue,attrPos;if(attrName.charAt(0)===":"&&typeof attrValue==="string"){if(attrValue.trim().startsWith("{{")){issue=new ruleCtx.Issue("Colon-prefixed attribute '"+attrName+"' should use read-only '[[...]]' in preference to '{{...}}'");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);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, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-html-attr-req";const SHORT_DESCR="Check that a webcomponent element contains all mandatory attributes";const LONG_DESCR="A Web Component attribute which is mandatory, must be declared on the web component element.";const DOUBLE_BRACE="{{";const DOUBLE_BRACKET="[[";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCR};function getDescription(){return LONG_DESCR};function register(){return{webcomp:_fnTag}};function _fnTag(ruleCtx,tagName){var node,req,attribs,attrib,attrReq,sub,val,i,x,tmp,issue,n,found;req=ruleCtx.utils.metaLib.getRequiredAttrs(tagName);if(!req||!req.length){return}node=ruleCtx.tagNode;if(!ruleCtx.utils.utils.hasAnyProps(node.attribs)){if(req.length){val=req.length+" required attribute"+(req.length>1?"s":"")+": ";for(i=0;i<req.length;i++){val+=i?", ":"";val+="'"+req[i]+"'"}val+=" missing on <"+tagName+">";issue=new ruleCtx.Issue(val)}ruleCtx.reporter.addIssue(issue,ruleCtx);return}attribs=node.attribs;n=0;for(i=0;i<req.length;i++){attrReq=req[i];found=false;for(attrib in attribs){attrib=attrib.charAt(0)===":"?attrib.substring(1):attrib;if(attrib===attrReq){n++;found=true;break}}if(n===req.length){return}if(found){continue}tmp=attrReq;while((x=tmp.lastIndexOf("."))>0){sub=tmp=tmp.substring(0,x);val=_isAttrMatch(node.attribs,sub);if(val){if(_isExpr(val)){return}if(_isJson(val)){if(_resolveWithObj(attrReq,sub,val)){return}}else{break}}}issue=new ruleCtx.Issue(`Required attribute '${attrReq}' is missing on <${tagName}>`);issue._msgEx={reqAttr:attrReq};ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _isAttrMatch(attribs,attr){var attrib,ret=false;for(attrib in attribs){attrib=attrib.charAt(0)===":"?attrib.substring(1):attrib;if(attrib===attr){ret=attribs[attrib];break}}return ret};function _resolveWithObj(attrReq,sub,json){var obj,prop;try{obj=JSON.parse(json);for(prop in obj){if(attrReq===sub+"."+prop)return true}}catch(e){}return false};function _isExpr(s){s=s.trim();return s.startsWith("[[")||s.startsWith("{{")};function _isJson(s){var start=s.charAt(0);return(start==="{"||start!=="[")&&!_isExprStart(s)};function _isExprStart(s){return s.startsWith(DOUBLE_BRACKET)||s.startsWith(DOUBLE_BRACE)};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-html-bindforeach-data";const SHORT_DESCRIPT="The 'data' attribute of an <oj-bind-for-each> must be a '[[...]]' expression";const LONG_DESCRIPT="The 'data' attribute of an <oj-bind-for-each> tag must be a '[[...]]' expression and not a literal.";const ATTRNAME="data";const PREFIX_ATTRNAME=":data";const PREFERRED="preferred";const EXPECTED="expected";const MSG="<oj-bind-for-each> 'data' attribute : read-only '[[...]]' expression ";var what;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"<oj-bind-for-each>":_fnTag}};function _fnTag(ruleCtx){var attribs,val,valType,attrName,attrPos,issue;if(ruleCtx.tagNode.attribs){attribs=ruleCtx.tagNode.attribs;val=attribs[ATTRNAME];valType=typeof val;if(valType!=="undefined"){attrName=ATTRNAME}else{val=attribs[PREFIX_ATTRNAME];valType=typeof val;if(valType!=="undefined"){attrName=PREFIX_ATTRNAME}}if(valType==="undefined"){issue=new ruleCtx.Issue("<oj-bind-for-each> 'data' attribute missing");ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(valType==="string"&&val.startsWith("[[")){return}what=valType==="string"&&val.startsWith("{{")?PREFERRED:EXPECTED;issue=new ruleCtx.Issue(MSG+what);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(what===PREFERRED){issue.setSeverity("minor")}ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-html-bindif-test";const SHORT_DESCRIPT="'test' attribute of an <oj-bind-if> must be a '[[...]]' expression";const LONG_DESCRIPT="The 'test' attribute of an <oj-bind-if> tag must be a '[[...]]' expression and not a literal.";const ATTRNAME="test";const PREFIX_ATTRNAME=":test";const PREFERRED="preferred";const EXPECTED="expected";const MSG="<oj-bind-if> 'test' attribute : read-only '[[...]]' expression ";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"<oj-bind-if>":_onBindIf}};function _onBindIf(ruleCtx){var attribs,val,valType,attrName,attrPos,issue,what;if(ruleCtx.tagNode.attribs){attribs=ruleCtx.tagNode.attribs;val=attribs[ATTRNAME];valType=typeof val;if(valType!=="undefined"){attrName=ATTRNAME}else{val=attribs[PREFIX_ATTRNAME];valType=typeof val;if(valType!=="undefined"){attrName=PREFIX_ATTRNAME}}if(valType==="undefined"){issue=new ruleCtx.Issue("<oj-bind-if> 'test' attribute missing");ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(valType==="string"){if(val.startsWith("[[")||val==="true"||val==="false"){return}what=val.startsWith("{{")?PREFERRED:EXPECTED}issue=new ruleCtx.Issue(MSG+what);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(what===PREFERRED){issue.setSeverity("minor")}ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-html-binding-attr";const SHORT_DESCRIPT="JET binding elements should not use global attributes";const LONG_DESCRIPT="The binding elements in JET (e.g. <b><i>oj-bind-for-each</i></b>, <b><i>oj-bind-if</i></b>, <b><i>oj-bind-slot</i></b>, <b><i>oj-bind-text</i></b>) are run through "+"a preprocessor and replaced with comment nodes when bindings are applied. As a result, the global HTML "+"attributes which are typically supported on all elements (e.g. <i>style</i>, <i>id</i>, etc.) are meaningless when applied "+"to binding elements.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{bindingtag:_onBind}};function _onBind(ruleCtx,tagName){var attribs,attrib,issue,attrPos;attribs=ruleCtx.node.attribs;if(!attribs){return}for(attrib in attribs){if(ruleCtx.utils.DomUtils.isCommonAttr(attrib)||attrib.startsWith("aria")){issue=new ruleCtx.Issue("Use of attribute '"+attrib+"' is meaningless for binding element <"+tagName+">");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, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
function getName(){return"oj-html-cca-count"};function getShortDescription(){return"Pages should not use an excessive number of web components"};function getDescription(){return"For optimal performance, a page should not contain an excessive number of web components, since this can negatively affect the loading time of the page. Refer to the Oracle JET Toolkit Documention, section \"Add Performance Optimization to an Oracle JET Application\""+"<br>The threshold values are defined in the options for rule 'oj-html-cca-count'."};function register(regCtx){return _getOptionCounts(regCtx)?{"file":_onFile}:false};function _onFile(ruleCtx){var thresholds=ruleCtx.rulePack.getRuleOption("thresholds");var threshCount=thresholds?thresholds.$total:0;var tags=ruleCtx.utils.DomUtils.getComponentElems();var compCount=0;var tagName,issue;thresholds=typeof threshCount==="number"?thresholds:0;for(tagName in tags){tagName=tags[tagName].name;if(tagName.toLowerCase().startsWith("oj-")){if(tagName!=="oj-option"&&tagName!=="oj-label"){compCount++}}}for(tagName in thresholds){_checkComponentThreshold(ruleCtx,tags,thresholds,tagName)}if(threshCount&&compCount>threshCount){issue=new ruleCtx.Issue("Performance - page exceeds recommended threshold count ("+threshCount+") of web components by "+(compCount-threshCount));ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _checkComponentThreshold(context,tags,thresholds,tagName){var tagThreshold,tagCount,issue;if(tagName!=="$total"){tagThreshold=thresholds[tagName];if(tagThreshold!==undefined){tagCount=_count(tags,tagName);if(tagCount>tagThreshold){issue=new context.Issue("Page exceeds recommended web component threshold count for <"+tagName+"> ("+tagThreshold+") by "+(tagCount-tagThreshold));context.reporter.addIssue(issue,context)}}}};function _count(tags,tagName){var count=0,regex;if(tagName.indexOf("*")>=0){regex=new RegExp("^"+tagName.split("*").join(".*")+"$");tags.forEach(function(x){count+=regex.test(x.name)?1:0})}else{tags.forEach(function(x){count+=x.name===tagName?1:0})}return count};function _getOptionCounts(regCtx){var opts,prop,total=0;opts=regCtx.ruleOpts.thresholds;if(opts&&typeof opts==="object"){for(prop in opts){total+=opts[prop]}}return total};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-html-cca-tagname";const SHORT_DESCRIPT="Web component element names must be defined";const LONG_DESCRIPT="This web component is unknown to JAF. Check the element spelling. For non-JET core components, check that the component metadata has been declared to JAF via the 'component's configuration property.";const IGNORE_LIST=["oj-slot","oj-dynamic-form"];function Rule(){this._ignoreList=null}Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCRIPT};Rule.prototype.getDescription=function(){return LONG_DESCRIPT};Rule.prototype.register=function(regCtx){if(!this._getIgnoreOverrides(regCtx)){return false}return{"tag":this._handleTag,"ojtag":this._handleTag}};Rule.prototype._handleTag=function(ruleCtx,tagName){if(ruleCtx.utils.DomUtils.isCommonElem(tagName)||ruleCtx.utils.DomUtils.isHtml5ObsoleteElem(tagName)||tagName==="template"||_isSvg(ruleCtx,tagName)){return}if(!ruleCtx.utils.metaLib.isWCTag(tagName)&&!IGNORE_LIST.includes(tagName)&&!this._checkOverrides(tagName)){let b=tagName.includes("-");let s=b?"web component":"tag";var issue=new ruleCtx.Issue(`<${ruleCtx.tag}> is not a known ${s}`);if(b){issue.setMsgKey(RULE_NAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)}};Rule.prototype._checkOverrides=function(tag){if(tag.startsWith("oj-what-is-")){var jj=42}if(this._ignoreList){for(let i=0;i<this._ignoreList.length;i++){if(this._ignoreList[i].test(tag)){return true}}}return false};Rule.prototype._getIgnoreOverrides=function(regCtx){var ignore;if(ignore=regCtx.ruleOpts["ignore"]){if(!Array.isArray(ignore)){regCtx.utils.msgLib.error(`Rule ${RULE_NAME} : config option 'ignore' is not an array`);return false}this._ignoreList=[];for(let i=0;i<ignore.length;i++){if(typeof ignore[i]==="string"){try{this._ignoreList[i]=new RegExp(ignore[i].trim())}catch(e){regCtx.utils.msgLib.error(`Config 'ruleMods' ${RULE_NAME} 'ignore' entry [${i}]: ${e.message}`);return false}}}}return true};function _isSvg(ruleCtx,elem){var ret=false,n;if(elem==="svg"){return true}if(ruleCtx.utils.DomUtils.isSvgElem(elem)){n=ruleCtx.tagNode;while(n){n=n.parent;if(!n){break}if(n.name&&n.name==="svg"){ret=true;break}}}return ret};module.exports=Rule;
|
package/rules/jet/oj-html-cdn.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-html-cdn";const LONG_DESCRIPT="For improved performance, production status pages referred to in <b><i><link></i></b> or <b></i><script></i></b> elements should load from the Content Delivery Network (<b>CDN</b>).";const SHORT_DESCRIPT="Production status pages should preferably load from the CDN.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"script":_handle,"link":_handle}};function _handle(ruleCtx,tagName){var attribs=ruleCtx.tagNode.attribs;var url,issue;if(attribs){if(attribs.src){url=attribs.src}else if(attribs.href){url=attribs.href}if(url){if(url.toLowerCase().indexOf("/cdn/jet/v")>=0){issue=new ruleCtx.Issue("Performance: <"+tagName+"> does not refer to the Content Delivery Network (CDN)");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULENAME="oj-html-combo-converter";const SHORT_DESCRIPTION="Starting in JET 10.0.0, oj-combobox-one/many will not apply the converter to format the display label of the dropdown items";const DESCRIPTION=SHORT_DESCRIPTION+" It will be the application's responsibility to provide option items with already-formatted labels, potentially by calling the converter instance directly.";const CONVERTER="converter";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{ojtag:this._onOjTag}}_onOjTag(ruleCtx,tag){var issue;if(!tag.startsWith("oj-combobox-")){return}let attribs=ruleCtx.tagNode.attribs;if(attribs[CONVERTER]){issue=new ruleCtx.Issue(`<${tag}> use of 'converter' - in 10.0.0 this will not format the display label of the dropdown items`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,CONVERTER);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
var exprEval;const RULE_NAME="oj-html-cspexpr";const LONG="Expressions of this format are unsupported if the content_security_policy does not have an exception for unsafe eval";function getName(){return RULE_NAME};function getShortDescription(){return LONG};function getDescription(){return LONG};function register(regCtx){if(regCtx.runMode==="api"&®Ctx.VsCodeExtHint){if(exprEval){regCtx.decache(exprEval)}}exprEval=require("../../libext/expparser");exprEval=new exprEval;return{"attrexpr":_handle}};function _handle(ruleCtx,attrName,attrValue){var p,issue,msg;attrValue=attrValue.trim();if(attrName.charAt(0)===":"){attrName=attrName.substring(1)}if(_badExprDelims(attrValue)){issue=new ruleCtx.Issue("Attribute '"+attrName+"' has unmatched expression delimiters");issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx);return}attrValue=" "+attrValue.substring(2,attrValue.length-2).trimRight();try{p=exprEval.parse(attrValue)}catch(e){msg=_cleanUp(e.message);issue=new ruleCtx.Issue("Attribute '"+attrName+"' contains an expression that may not be compatible with all Content Security policies: "+msg);ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _badExprDelims(expr){return expr.startsWith("[[")&&!expr.endsWith("]]")||expr.startsWith("{{")&&!expr.endsWith("}}")};function _cleanUp(msg){msg=msg.replace("character","attribute value position");return msg}module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULE_NAME="oj-html-databind-all";function getName(){return RULE_NAME};function getShortDescription(){return"Report usage of the 'data-bind' attribute on any element"};function getDescription(){return"Reports usage of the 'data-bind' attribute on any element"};function register(){return{"attr":function(ruleCtx,attrName,attrValue){if(attrName==="data-bind"){var issue=new ruleCtx.Issue("element <"+ruleCtx.tag+"> uses the 'data-bind' attribute.");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-html-dlg-title";const SHORT_DESCR="Check that <oj-dialog> attribute is not specified";const LONG_DESCR="<oj-dialog> : 'title' attribute should not be used - use 'dialog-title' instead.";const MSG="<oj-dialog> attribute 'title' should be replaced with 'dialog-title'";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCR};function getDescription(){return LONG_DESCR};function register(){return{"<oj-dialog>":_onDlg}};function _onDlg(ruleCtx){let attribs,attrName;if(attribs=ruleCtx.tagNode.attribs){for(attrName in attribs){if(attrName==="title"||attrName===":title"){let issue=new ruleCtx.Issue(MSG);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-html-file-pick-accept";const DESCRIPTION="Valid array entries for the 'accept' attribute of <oj-file-picker> are:<p>"+"1) a file suffix beginning with a period, e.g. \".xxx\"<br>"+"2) an empty string<br>"+"3) an audio, video, or image file, e.g. \"image/*\" or \"audio/*\", or \"video/*\".";const SHORT_DESCRIPTION="Array entries for <oj-file-picker accept=' . . .'> attribute should be valid file strings.";const BASE_MSG="<oj-file-picker> attribute 'accept'";const FILE_PICKER="oj-file-picker";const ACCEPT="accept";const RO_EXPR="[[";const RW_EXPR="{{";const ARRAY_LEFT="[";const ARRAY_RIGHT="]";const GOOD_VALS=[".","audio/","video/","image/"];class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-file-picker>":this._onTag}}_onTag(ruleCtx){let accept;accept=ruleCtx.tagNode.attribs;accept=accept?accept[ACCEPT]:null;if(accept){let avals=this._checkAttr(ruleCtx,accept);if(avals){this._checkArray(ruleCtx,avals)}}}_emitIssue(ruleCtx,msgNum,info,val){var msg,issue;switch(msgNum){case 0:msg=`${BASE_MSG} is not an array of strings`;break;case 1:msg=`${BASE_MSG} syntax : ${info.msg} at index ${info.startIndex}`;break;case 2:msg=`${BASE_MSG} : invalid array entry \"${val}\"`;break;}if(msg){issue=new ruleCtx.Issue(msg);if(msgNum){issue.setMsgKey(RULE_NAME+"_"+msgNum)}let pos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,ACCEPT);issue.setPosition(pos.row,pos.col,pos.start,pos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}_checkArray(ruleCtx,avals){var v,i,j;for(i=0;i<avals.length;i++){v=avals[i];if(typeof v!=="string"){this._emitIssue(ruleCtx,2,null,v);continue}for(j=0;j<GOOD_VALS.length;j++){if(v.startsWith(GOOD_VALS[j])||v===""){break}}if(j>=GOOD_VALS.length){this._emitIssue(ruleCtx,2,i,v)}}}_checkAttr(ruleCtx,s){if(s.startsWith(RO_EXPR)||s.startsWith(RW_EXPR)){return}if(s.charAt(0)!==ARRAY_LEFT&&s.charAt(s.length-1)!==ARRAY_RIGHT){this._emitIssue(ruleCtx,0);return}let o=ruleCtx.utils.utils.parseJson(s,false);if(o.msg){this._emitIssue(ruleCtx,1,o);return}return o.obj}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULENAME="oj-html-form-bindif";const DESCRIPTION="<oj-form-layout> is meant to have static content only. The use of <oj-bind-for-each> or <oj-bind-if> is not supported";const SHORT_DESCRIPTION="The use of <oj-bind-for-each> or <oj-bind-if> inside <oj-form-layout> is not supported";const OJ_BIND_IF="oj-bind-if";const OJ_BIND_FOR_EACH="oj-bind-for-each";const OJ_FORM_LAYOUT="oj-form-layout";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{ojtag:this._onElem}}_onElem(ruleCtx,tag){if(tag===OJ_FORM_LAYOUT){let node=ruleCtx.tagNode;let attribs=node.attribs;if(this._attrVal(attribs,"direction")!=="column"){let maxcol=this._attrVal(attribs,"max-columns");if(isNaN(maxcol)||maxcol>1){this._walkDomChildren(ruleCtx,node)}}}}_emit(ruleCtx,node){let issue=new ruleCtx.Issue(`<oj-form-layout> is meant to have static content only. The use of <${node.name}> is not supported`);issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx)}_walkDomChildren(ruleCtx,node){var ch,n,i,ok=true;;ch=node.children;if(ch){for(i=0;i<ch.length;i++){n=ch[i];if(n.type==="tag"){if(n.name===OJ_BIND_FOR_EACH){ok=false;this._emit(ruleCtx,n)}else if(n.name===OJ_BIND_IF){if(n.children&&n.children.length>1){ok=false;this._emit(ruleCtx,n)}}}}}return ok}_attrVal(attribs,attr){var v=attribs[attr];switch(attr){case"max-columns":v=parseInt(v);break;}return v}}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_NAME="oj-html-form-layout-maxcols";const DESCRIPTION="Prior to JET 10.0.0, maxColumns in 'row' direction was not responsive, so that the "+"number of columns was exactly equal to maxColumns. In JET 10.0.0 and later, maxColumns "+"<b>is</b> responsive, so that the actual number of columns may now be less, depending on the "+"space available to the form.<br>If the app needs to preserve the old fixed-columns behavior, "+"then the <oj-form-layout> 'max-columns' attribute should be replaced with the new "+"'columns' attribute.";const SHORT_DESCRIPTION="For <oj-form-layout>, the 'max-columns' attribute may have a behavioral change in JET 10.0.0.";const MAX_COLUMNS="max-columns";const COLUMNS="columns";const COLUMN="column";const DIRECTION="direction";const ISSUE="<oj-form-layout> with 'max-columns' may have a behavior change in JET 10.0.0.";class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-form-layout>":this._onTag}}_onTag(ruleCtx){if(_isGT(_getTagAttr(ruleCtx,MAX_COLUMNS),1)){if(!_hasTagAttr(ruleCtx,COLUMNS)||_getTagAttr(ruleCtx,DIRECTION)===COLUMN){let issue=new ruleCtx.Issue(ISSUE);let pos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,MAX_COLUMNS);issue.setPosition(pos.row,pos.col,pos.start,pos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}function _hasTagAttr(ruleCtx,attr){var attrs=ruleCtx.tagNode.attribs;return attrs?attrs.hasOwnProperty(attr):false}function _getTagAttr(ruleCtx,attr){var attrs=ruleCtx.tagNode.attribs;return attrs?attrs[attr]:null}function _isGT(val,n){val=parseInt(val);return!isNaN(val)&&val>n}module.exports=Rule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const RULENAME="oj-html-form-noflex";const DESCRIPTION="Flex styling, as indicated by the 'oj-flex class', should only be applied in cases where the developer can then "+"indicate any managed child elements using the 'oj-flex-item' class. It cannot be applied to JET components "+"where the developer has no direct access to any child elements, for example, form controls. Doing so may "+"inadvertently interfere with the internal layout of those components.";const SHORT_DESCRIPTION="Flex styling, as indicated by the 'oj-flex' class, should only be applied in cases where the developer can then "+"indicate any managed child elements using the oj-flex-item class.";const FORM_CONTROLS=["oj-checkboxset","oj-radioset","oj-slider","oj-switch","oj-text-area"];class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{ojtag:this._onOjTag}}_onOjTag(ruleCtx,tag){var attrs,clazz,flex;if(!_isFormControl(tag)){return}attrs=ruleCtx.node.attribs;if(attrs){clazz=attrs["class"];if(clazz){flex=_isOjFlex(clazz);if(flex){let issue=new ruleCtx.Issue(`"Form control <${tag}> should not use JET flex class '${flex}'`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,"class");issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}function _isOjFlex(clazz){var ar,attr,ret,i;ar=clazz.split(" ");for(i=0;i<ar.length;i++){attr=ar[i].trim();if(attr==="oj-flex"){ret=attr;break}}return ret};function _isFormControl(tag){return tag.startsWith("oj-input-")||tag.startsWith("oj-combobox-")||tag.startsWith("oj-label-")||tag.startsWith("oj-select-")||tag.startsWith("oj-color-")||FORM_CONTROLS.includes(tag)};module.exports=Rule;
|