@oracle/oraclejet-audit 14.1.3 → 15.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/corePackMigrator/cli.js +6 -0
- package/corePackMigrator/corePackMigrator.js +10 -0
- package/corePackMigrator/metadata/avatarMetadata.json +40 -0
- package/corePackMigrator/metadata/buttonMetadata.json +55 -0
- package/corePackMigrator/metadata/collapsibleMetadata.json +15 -0
- package/corePackMigrator/metadata/filePickerMetadata.json +8 -0
- package/corePackMigrator/metadata/inputNumberMetadata.json +56 -0
- package/corePackMigrator/metadata/inputPasswordMetadata.json +50 -0
- package/corePackMigrator/metadata/inputTextMetadata.json +62 -0
- package/corePackMigrator/metadata/legendItemMetadata.json +8 -0
- package/corePackMigrator/metadata/legendMetadata.json +18 -0
- package/corePackMigrator/metadata/legendSectionMetadata.json +8 -0
- package/corePackMigrator/metadata/listItemLayoutMetadata.json +15 -0
- package/corePackMigrator/metadata/listviewMetadata.json +8 -0
- package/corePackMigrator/metadata/messagesMetadata.json +35 -0
- package/corePackMigrator/metadata/progressBarMetadata.json +15 -0
- package/corePackMigrator/metadata/progressCircleMetadata.json +8 -0
- package/corePackMigrator/metadata/ratingGaugeMetadata.json +78 -0
- package/corePackMigrator/metadata/selectManyMetadata.json +39 -0
- package/corePackMigrator/metadata/selectSingleMetadata.json +39 -0
- package/corePackMigrator/metadata/statusMeterGaugeMetadata.json +99 -0
- package/corePackMigrator/metadata/textAreaMetadata.json +44 -0
- package/corePackMigrator/resource/astUtils.js +6 -0
- package/corePackMigrator/resource/componentMigrator.js +6 -0
- package/corePackMigrator/resource/fileScanner.js +6 -0
- package/corePackMigrator/resource/htmlUtils.js +6 -0
- package/corePackMigrator/resource/manifest.json +102 -0
- package/corePackMigrator/resource/migrationConfig.json +21 -0
- package/corePackMigrator/templates/componentMetaData.json +119 -0
- package/corePackMigrator/templates/migrationConfig.json +17 -0
- package/corePackMigrator/utilities/logging.js +6 -0
- package/jaf-amd.js +1 -1
- package/lib/AST_Ts.js +1 -1
- package/lib/Cli.js +1 -1
- package/lib/Components.js +1 -1
- package/lib/Config.js +1 -1
- package/lib/ConfigLib.js +1 -1
- package/lib/DomUtils.js +1 -1
- package/lib/FileIndex.js +1 -1
- package/lib/FileSet.js +1 -1
- package/lib/FsUtils.js +1 -1
- package/lib/HtmlUtils.js +1 -1
- package/lib/JsonLoader.js +1 -1
- package/lib/MetaLib.js +1 -1
- package/lib/NetUtils.js +1 -1
- package/lib/Parser.js +1 -1
- package/lib/RegTypes.js +1 -1
- package/lib/Registry.js +1 -1
- package/lib/Reporter.js +1 -1
- package/lib/RulePack.js +1 -1
- package/lib/RuleSet.js +1 -1
- package/lib/Rules.js +1 -1
- package/lib/Scope.js +1 -1
- package/lib/Ts.js +1 -1
- package/lib/TsxUtils.js +1 -1
- package/lib/TsxUtils2.js +6 -0
- package/lib/Utils.js +1 -1
- package/lib/ZipUtils.js +1 -1
- package/lib/checkage.js +1 -1
- package/lib/cmdline.js +1 -1
- package/lib/defaults.js +1 -1
- package/lib/exportRules.js +1 -1
- package/lib/filetypes.js +1 -1
- package/lib/groups.js +1 -1
- package/lib/help.js +1 -1
- package/lib/jetver.js +1 -1
- package/lib/jsx.js +1 -1
- package/lib/maint.js +6 -0
- package/lib/manpage.js +1 -1
- package/lib/manual.js +1 -1
- package/lib/migrator.js +6 -0
- package/lib/msgidLoader.js +1 -1
- package/lib/ns.js +1 -1
- package/lib/outfile.js +1 -1
- package/lib/schema.js +1 -1
- package/lib/scopewalker.js +1 -1
- package/libext/expparser.js +1 -1
- package/meta/14.0.0/jetauditmeta.js +1 -1
- package/meta/14.1.0/jetauditmeta.js +1 -1
- package/meta/15.0.0/jetauditmeta.js +9 -0
- package/meta/metaverlist.json +1 -1
- package/package.json +16 -8
- package/profiles/redwood-strict.json +2 -1
- package/rulepacks/csp/csp-html-script-unsafe-inline.js +1 -1
- package/rulepacks/csp/csp-html-unsafe-expr.js +1 -1
- package/rulepacks/csp/csp-js-script-unsafe-eval.js +1 -1
- package/rulepacks/csp/csp-js-style-unsafe-inline.js +1 -1
- package/rulepacks/csp/csp-json-unsafe-expr.js +6 -0
- package/rulepacks/csp/msgid.json +1 -1
- package/rulepacks/csp/rules.json +1 -1
- package/rulepacks/jetwc/jetwc-absolute-jetversion.js +1 -1
- package/rulepacks/jetwc/jetwc-aria-redefinition.js +1 -1
- package/rulepacks/jetwc/jetwc-bootstrap.js +1 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +1 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +1 -1
- package/rulepacks/jetwc/jetwc-component-dependencies.js +1 -1
- package/rulepacks/jetwc/jetwc-component-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-component-foldername.js +1 -1
- package/rulepacks/jetwc/jetwc-component-location.js +1 -1
- package/rulepacks/jetwc/jetwc-component-type.js +1 -1
- package/rulepacks/jetwc/jetwc-css-oj-complete.js +1 -1
- package/rulepacks/jetwc/jetwc-css-pack-load-path.js +6 -0
- package/rulepacks/jetwc/jetwc-css-scoping.js +1 -1
- package/rulepacks/jetwc/jetwc-data-property-prefix.js +1 -1
- package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +1 -1
- package/rulepacks/jetwc/jetwc-disabled-property.js +1 -1
- package/rulepacks/jetwc/jetwc-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +1 -1
- package/rulepacks/jetwc/jetwc-event-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-events.js +1 -1
- package/rulepacks/jetwc/jetwc-exchange-images.js +1 -1
- package/rulepacks/jetwc/jetwc-jet-version.js +1 -1
- package/rulepacks/jetwc/jetwc-loader-file.js +1 -1
- package/rulepacks/jetwc/jetwc-markdown-link.js +1 -1
- package/rulepacks/jetwc/jetwc-method-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-methods.js +1 -1
- package/rulepacks/jetwc/jetwc-namespace.js +1 -1
- package/rulepacks/jetwc/jetwc-nested-defaults.js +1 -1
- package/rulepacks/jetwc/jetwc-nls-languages.js +1 -1
- package/rulepacks/jetwc/jetwc-nls-root.js +1 -1
- package/rulepacks/jetwc/jetwc-oj-register.js +1 -1
- package/rulepacks/jetwc/jetwc-ojcss.js +1 -1
- package/rulepacks/jetwc/jetwc-pack-children.js +1 -1
- package/rulepacks/jetwc/jetwc-packable-components.js +1 -1
- package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +1 -1
- package/rulepacks/jetwc/jetwc-prerelease-pattern.js +1 -1
- package/rulepacks/jetwc/jetwc-prerelease-version.js +1 -1
- package/rulepacks/jetwc/jetwc-property-changed.js +1 -1
- package/rulepacks/jetwc/jetwc-property-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-property-nesting.js +1 -1
- package/rulepacks/jetwc/jetwc-property-translatable.js +1 -1
- package/rulepacks/jetwc/jetwc-public-modules.js +1 -1
- package/rulepacks/jetwc/jetwc-reference-npm-path.js +6 -0
- package/rulepacks/jetwc/jetwc-register-css.js +1 -1
- package/rulepacks/jetwc/jetwc-register-with-promises.js +1 -1
- package/rulepacks/jetwc/jetwc-require-paths.js +1 -1
- package/rulepacks/jetwc/jetwc-required-subproperty.js +1 -1
- package/rulepacks/jetwc/jetwc-reserved-property.js +1 -1
- package/rulepacks/jetwc/jetwc-schema.js +1 -1
- package/rulepacks/jetwc/jetwc-semantic-version.js +1 -1
- package/rulepacks/jetwc/jetwc-slot-displayname.js +1 -1
- package/rulepacks/jetwc/jetwc-slots.js +1 -1
- package/rulepacks/jetwc/jetwc-standard-files.js +1 -1
- package/rulepacks/jetwc/jetwc-status-since.js +6 -0
- package/rulepacks/jetwc/jetwc-unused-events.js +1 -1
- package/rulepacks/jetwc/jetwc-unused-slots.js +1 -1
- package/rulepacks/jetwc/jetwc-vb-category.js +1 -1
- package/rulepacks/jetwc/jetwc-vb-icon.js +1 -1
- package/rulepacks/jetwc/jetwc-vcomponent-jetversion.js +1 -1
- package/rulepacks/jetwc/jetwc-vcomponent-loader.js +1 -1
- package/rulepacks/jetwc/jetwc-vcomponent-version.js +1 -1
- package/rulepacks/jetwc/jetwc-version-openrange.js +1 -1
- package/rulepacks/jetwc/jetwc-writeback-required.js +1 -1
- package/rulepacks/jetwc/msgid.json +1 -1
- package/rulepacks/jetwc/rules.json +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +1 -1
- package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +1 -1
- package/rulepacks/jetwco/jetwco-bootstrap.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-componentType.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-dependencies.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-events.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-helpers.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-jetVer.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-methodParams.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-methods.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-packBundle.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-packContent.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-properties.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyType.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-publicModules.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-slots.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +1 -1
- package/rulepacks/jetwco/jetwco-cacc-typeMappingOverrides.js +6 -0
- package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +1 -1
- package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +1 -1
- package/rulepacks/jetwco/jetwco-component-api-changes.js +1 -1
- package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +1 -1
- package/rulepacks/jetwco/jetwco-component-cdn.js +1 -1
- package/rulepacks/jetwco/jetwco-description-standards.js +1 -1
- package/rulepacks/jetwco/jetwco-displayname-standards.js +1 -1
- package/rulepacks/jetwco/jetwco-exchange-version-check.js +1 -1
- package/rulepacks/jetwco/jetwco-license-info.js +1 -1
- package/rulepacks/jetwco/jetwco-prerelease-cdn.js +1 -1
- package/rulepacks/jetwco/jetwco-thirdparty-ba.js +1 -1
- package/rulepacks/jetwco/msgid.json +1 -1
- package/rulepacks/jetwco/rules.json +1 -1
- package/rules/jaf/jaf-ts-noparser.js +6 -0
- package/rules/jaf/msgid.json +1 -1
- package/rules/jaf/rules.json +1 -1
- package/rules/jet/helpers/has-slot-name.js +1 -1
- package/rules/jet/helpers/style-selector.js +1 -1
- package/rules/jet/helpers/tsx/has-slot-name.js +6 -0
- package/rules/jet/msgid.json +1 -1
- package/rules/jet/oj-acc-aria-labelledby.js +1 -1
- package/rules/jet/oj-cca-compjson-bp-ar.js +1 -1
- package/rules/jet/oj-cca-compjson-bp-obj.js +1 -1
- package/rules/jet/oj-css-bp-dir-flow.js +1 -1
- package/rules/jet/oj-html-attr-$unique.js +1 -1
- package/rules/jet/oj-html-attr-expr-delims.js +6 -0
- package/rules/jet/oj-html-combo-converter.js +1 -1
- package/rules/jet/oj-html-file-pick-accept.js +1 -1
- package/rules/jet/oj-html-form-bindif.js +1 -1
- package/rules/jet/oj-html-input-isodate.js +1 -1
- package/rules/jet/oj-html-invalid-doctype.js +1 -1
- package/rules/jet/oj-html-msgs-cat-text.js +1 -1
- package/rules/jet/oj-html-ojattr-deprecated.js +1 -1
- package/rules/jet/oj-html-ojattr-enum-deprecated.js +1 -1
- package/rules/jet/oj-html-ojtag-deprecated.js +1 -1
- package/rules/jet/oj-html-ojtag-ns.js +1 -1
- package/rules/jet/oj-html-rating-gauge-track-resize.js +6 -0
- package/rules/jet/oj-html-self-close.js +1 -1
- package/rules/jet/oj-html-slot-deprecated.js +1 -1
- package/rules/jet/oj-html-slot-item-minmax.js +1 -1
- package/rules/jet/oj-html-slot-name.js +1 -1
- package/rules/jet/oj-html-slot-pref-content.js +1 -1
- package/rules/jet/oj-html-style.js +1 -1
- package/rules/jet/oj-html-stylesel.js +1 -1
- package/rules/jet/oj-html-tabbar-edge.js +6 -0
- package/rules/jet/oj-html-unsup-theme.js +1 -1
- package/rules/jet/oj-html-wctag-maintenance.js +1 -1
- package/rules/jet/oj-html-wctag-nested.js +1 -1
- package/rules/jet/oj-html-wctag-supersedes.js +6 -0
- package/rules/jet/oj-js-numconv-pattern.js +6 -0
- package/rules/jet/oj-ts-numconv-pattern.js +6 -0
- package/rules/jet/oj-tsx-5-tag-obs.js +1 -1
- package/rules/jet/oj-tsx-acc-avatar-aria-role.js +6 -0
- package/rules/jet/oj-tsx-acc-button-onclick.js +1 -1
- package/rules/jet/oj-tsx-aria-ojselector-labelledby.js +1 -1
- package/rules/jet/oj-tsx-aria-prop.js +1 -1
- package/rules/jet/oj-tsx-attr-req.js +1 -1
- package/rules/jet/oj-tsx-cca-tagname.js +1 -1
- package/rules/jet/oj-tsx-combo-converter.js +1 -1
- package/rules/jet/oj-tsx-databind-all.js +1 -1
- package/rules/jet/oj-tsx-dlg-title.js +1 -1
- package/rules/jet/oj-tsx-form-bindif.js +6 -0
- package/rules/jet/oj-tsx-form-noflex.js +6 -0
- package/rules/jet/oj-tsx-input-isodate.js +1 -1
- package/rules/jet/oj-tsx-ojattr-deprecated.js +6 -0
- package/rules/jet/oj-tsx-ojattr-enum-deprecated.js +6 -0
- package/rules/jet/oj-tsx-ojattr-value.js +1 -1
- package/rules/jet/oj-tsx-ojattr.js +1 -1
- package/rules/jet/oj-tsx-ojtag-deprecated.js +1 -1
- package/rules/jet/oj-tsx-ojtag-ns.js +6 -0
- package/rules/jet/oj-tsx-pageopts-type.js +1 -1
- package/rules/jet/oj-tsx-picker-attrs.js +1 -1
- package/rules/jet/oj-tsx-prop-inline-definition.js +1 -1
- package/rules/jet/oj-tsx-rating-gauge-size.js +1 -1
- package/rules/jet/oj-tsx-rating-gauge-track-resize.js +6 -0
- package/rules/jet/oj-tsx-slot-deprecated.js +6 -0
- package/rules/jet/oj-tsx-slot-pref-content.js +6 -0
- package/rules/jet/oj-tsx-tabbar-edge.js +6 -0
- package/rules/jet/oj-tsx-unsup-theme.js +1 -1
- package/rules/jet/oj-tsx-wctag-maintenance.js +1 -1
- package/rules/jet/oj-tsx-wctag-nested.js +1 -1
- package/rules/jet/rules.json +1 -1
- package/schema/component-schema.json +1 -1
- package/src/JafCore.js +1 -1
- package/types/index.d.ts +6 -4
- package/rules/jet/oj-html-cspexpr.js +0 -6
package/rules/jet/msgid.json
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
{"oj-html-ojtag-deprecated":"0010","oj-html-ojtag-deprecated_1":"0011","oj-html-wctag-maintenance":"0014","oj-html-attr-json_1":"0020","oj-html-attr-json_2":"0021","oj-html-ojattr":"0040","oj-html-ojattr_1":"0041","oj-html-ojattr-520":"0040","oj-html-ojattr-value":"0060","oj-html-attr-2def":"0070","oj-html-attr-prefix-ro":"0073","oj-html-attr-prefix-expr":"0075","oj-html-attr-req":"0077","oj-html-ojattr-deprecated":"0080","oj-html-ojattr-deprecated_1":"0081","oj-html-ojattr-deprecated_2":"0082","oj-html-ojattr-deprecated_3":"0083","oj-html-ojattr-enum-deprecated":"0085","oj-html-ojevent":"0090","oj-html-jq-databind_1":"0100","oj-html-jq-databind_2":"0110","oj-html-jq-databind_3":"0120","oj-html-databind-all":"0130","oj-html-ojslot":"0140","oj-html-slot-deprecated":"0145","oj-html-slot-name":"0150","oj-html-slot-pref-content":"0153","oj-html-slot-item-minmax":"0156","oj-html-slot-item-minmax_1":"0157","oj-html-binding-attr":"0160","oj-html-bindif-test":"0163","oj-html-bindforeach-data":"0165","oj-html-dlg-title":"0168","oj-html-attr-$unique_1":"0170","oj-html-attr-$unique_2":"0180","oj-html-tag-attr-noprefix":"0190","oj-html-label-for-prefix":"0195","oj-html-ojtag-globattr-noprefix":"0200","oj-html-ojtag-nonglobattr-prefix":"0210","oj-html-invalid-doctype":"0220","oj-html-invalid-doctype_1":"0221","oj-html-missing-doctype":"0230","oj-html-oj-lib":"0240","oj-html-ko-comment":"0250","oj-html-ko-databind":"0260","oj-html-cca-count":"0270","oj-html-cca-count_1":"0271","oj-html-cdn":"0280","oj-html-ojattr-evt-syntax":"0290","oj-html-ojtag-datacmd":"0310","oj-html-ojtag-datacmd_1":"0311","oj-html-ojtag-datacmd_2":"0312","oj-html-ojtag-datacmd_3":"0313","oj-html-ojtag-datactx":"0320","oj-html-wctag-id":"0330","oj-html-wctag-id_1":"0331","oj-html-wctag-id_2":"0332","oj-html-wctag-for":"0340","oj-html-wctag-arialabelledby":"0350","oj-html-wctag-$props":"0360","oj-html-wctag-$props_1":"0361","oj-html-wctag-$props_2":"0362","oj-html-wctag-$props_3":"0363","oj-html-form-bindif":"0370","oj-html-combo-converter":"0380","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","oj-html-
|
|
6
|
+
{"oj-html-ojtag-deprecated":"0010","oj-html-ojtag-deprecated_1":"0011","oj-html-wctag-maintenance":"0014","oj-html-wctag-supersedes":"0015","oj-html-attr-json_1":"0020","oj-html-attr-json_2":"0021","oj-html-ojattr":"0040","oj-html-ojattr_1":"0041","oj-html-ojattr-520":"0040","oj-html-ojattr-value":"0060","oj-html-attr-2def":"0070","oj-html-attr-prefix-ro":"0073","oj-html-attr-prefix-expr":"0075","oj-html-attr-req":"0077","oj-html-ojattr-deprecated":"0080","oj-html-ojattr-deprecated_1":"0081","oj-html-ojattr-deprecated_2":"0082","oj-html-ojattr-deprecated_3":"0083","oj-html-ojattr-enum-deprecated":"0085","oj-html-ojevent":"0090","oj-html-jq-databind_1":"0100","oj-html-jq-databind_2":"0110","oj-html-jq-databind_3":"0120","oj-html-databind-all":"0130","oj-html-ojslot":"0140","oj-html-slot-deprecated":"0145","oj-html-slot-name":"0150","oj-html-slot-pref-content":"0153","oj-html-slot-item-minmax":"0156","oj-html-slot-item-minmax_1":"0157","oj-html-binding-attr":"0160","oj-html-bindif-test":"0163","oj-html-bindforeach-data":"0165","oj-html-dlg-title":"0168","oj-html-attr-$unique_1":"0170","oj-html-attr-$unique_2":"0180","oj-html-tag-attr-noprefix":"0190","oj-html-label-for-prefix":"0195","oj-html-ojtag-globattr-noprefix":"0200","oj-html-ojtag-nonglobattr-prefix":"0210","oj-html-invalid-doctype":"0220","oj-html-invalid-doctype_1":"0221","oj-html-missing-doctype":"0230","oj-html-oj-lib":"0240","oj-html-ko-comment":"0250","oj-html-ko-databind":"0260","oj-html-cca-count":"0270","oj-html-cca-count_1":"0271","oj-html-cdn":"0280","oj-html-ojattr-evt-syntax":"0290","oj-html-ojtag-datacmd":"0310","oj-html-ojtag-datacmd_1":"0311","oj-html-ojtag-datacmd_2":"0312","oj-html-ojtag-datacmd_3":"0313","oj-html-ojtag-datactx":"0320","oj-html-wctag-id":"0330","oj-html-wctag-id_1":"0331","oj-html-wctag-id_2":"0332","oj-html-wctag-for":"0340","oj-html-wctag-arialabelledby":"0350","oj-html-wctag-$props":"0360","oj-html-wctag-$props_1":"0361","oj-html-wctag-$props_2":"0362","oj-html-wctag-$props_3":"0363","oj-html-form-bindif":"0370","oj-html-combo-converter":"0380","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","oj-html-unsup-theme":"0390","oj-html-unsup-theme_1":"0391","oj-html-form-noflex":"0395","oj-html-5-tag-obs":"0400","oj-html-5-attr-obs_1":"0410","oj-html-5-attr-obs_2":"0411","oj-html-redwood-cssvars":"0420","oj-html-redwood-cssnovars":"0421","oj-html-redwood-bp-endslot":"0422","oj-html-template-index":"0425","oj-form-maxcols":"0430","oj-form-maxcols_1":"0431","oj-form-maxcols_2":"0432","oj-html-form-layout-maxcols":"0435","oj-html-file-pick-accept":"0450","oj-html-file-pick-accept_1":"0451","oj-html-file-pick-accept_2":"0452","oj-html-wctag-packprivate":"0465","oj-html-picker-attrs":"0470","oj-html-wctag-nested":"0480","oj-html-notag-style":"0490","oj-html-notag-style_1":"0491","oj-html-msgs-cat-text":"0495","oj-html-msgs-cat-text_1":"0496","oj-html-msgs-cat-text_2":"0497","oj-html-msgs-cat-text_3":"0498","oj-html-no-style":"0505","oj-html-no-style-tag":"0505","oj-html-alta-deprecated":"0510","oj-html-rating-gauge-size":"0520","oj-html-rating-gauge-track-resize":"0525","oj-acc-input-aria-label_1":"2000","oj-acc-input-aria-label_2":"2010","oj-acc-input-aria-label_3":"2020","oj-acc-input-aria-label_4":"2030","oj-acc-input-aria-label_5":"2031","oj-acc-input-aria-label_6":"2032","oj-acc-select-aria-label_1":"2040","oj-acc-select-aria-label_2":"2050","oj-acc-select-aria-label_3":"2060","oj-acc-select-aria-label_4":"2070","oj-acc-select-aria-label_5":"2071","oj-acc-select-aria-label_6":"2072","oj-acc-combobox-aria-label_1":"2080","oj-acc-combobox-aria-label_2":"2090","oj-acc-combobox-aria-label_3":"2100","oj-acc-combobox-aria-label_4":"2120","oj-acc-combobox-aria-label_5":"2121","oj-acc-combobox-aria-label_6":"2122","oj-acc-aria-labelledby":"2130","oj-acc-avatar-aria-role":"2140","oj-acc-film-strip-aria-label":"2150","oj-acc-aria-prop":"2160","oj-acc-aria-ojselector-labelledby":"2170","oj-acc-button-onclick":"2180","oj-html-cca-tagname":"2200","oj-html-cca-tagname_1":"2201","oj-html-attr-expr-delims":"2211","oj-html-tabbar-edge":"2215","oj-html-tabbar-edge_1":"2216","oj-js-ojcomp-deprecated":"3000","oj-js-comp-meth-deprecated":"3020","oj-js-comp-meth-deprecated_1":"3022","oj-js-comp-meth-deprecated_2":"3023","oj-js-comp-attr-deprecated":"3025","oj-js-comp-attr-deprecated_1":"3026","oj-js-comp-attr-deprecated_2":"3027","oj-js-ojcomp-new":"3060","oj-js-ojcomp-exist":"3070","oj-js-ojcomp-exist_1":"3071","oj-js-var-undef":"3080","oj-js-var-undef_1":"3082","oj-js-poly-promise":"3090","oj-js-noconsole":"3100","oj-js-no-ext-final":"3200","oj-ts-ojcomp-deprecated":"3400","oj-ts-comp-meth-deprecated":"3420","oj-ts-comp-meth-deprecated_1":"3422","oj-ts-comp-meth-deprecated_2":"3423","oj-ts-comp-attr-deprecated":"3425","oj-ts-comp-attr-deprecated_1":"3426","oj-ts-comp-attr-deprecated_2":"3427","oj-ts-ojcomp-new":"3440","oj-ts-ojcomp-exist":"3445","oj-ts-ojcomp-exist_1":"3450","oj-ts-poly-promise":"3455","oj-ts-noconsole":"3460","oj-ts-no-ext-final":"3465","oj-ts-numconv-pattern":"3470","oj-json-syntax":"4000","oj-html-style":"5000","oj-html-style_1":"5001","oj-html-style-deprecated":"5010","oj-html-ojstyle":"5015","oj-html-style-bp-color":"5020","oj-html-style-bp-font":"5025","oj-html-style-bp-display":"5030","oj-html-self-close":"5035","oj-html-style-bp-font-family":"5040","oj-html-style-abs-units":"5045","oj-html-style-abs-units_1":"5046","oj-html-style-abs-units_2":"5047","oj-html-stylesel":"5080","oj-html-stylesel_1":"5081","oj-html-stylesel_2":"5082","oj-html-stylesel_3":"5083","oj-html-stylesel_4":"5084","oj-html-stylesel_5":"5085","oj-html-stylesel_6":"5086","oj-html-stylesel_7":"5087","oj-html-input-isodate":"5095","oj-html-input-isodate_1":"5096","oj-html-input-isodate_2":"5097","oj-html-input-isodate_3":"5098","oj-html-input-isodate_4":"5099","oj-html-input-isodate_5":"5100","oj-html-input-isodate_6":"5101","oj-html-input-isodate_7":"5102","oj-html-input-isodate_8":"5103","oj-html-input-isodate_9":"5104","oj-html-pageopts-type":"5110","oj-html-pageopts-type_2":"5111","oj-html-slot-deprecated_aged":"5800","oj-html-ojtag-deprecated_aged":"5805","oj-html-ojtag-deprecated_1_aged":"5806","oj-html-ojattr-deprecated_aged":"5810","oj-html-ojattr-deprecated_1_aged":"5811","oj-html-ojattr-deprecated_2_aged":"5812","oj-html-ojattr-deprecated_3_aged":"5813","oj-html-ojattr-enum-deprecated_aged":"5820","oj-html-alta-deprecated_aged":"5825","oj-js-numconv-pattern":"5830","oj-css-style-override_1":"6010","oj-css-style-override_2":"6011","oj-css-style-bp-color":"6015","oj-css-style-deprecated":"6020","oj-css-style-bp-font":"6025","oj-css-style-bp-display":"6030","oj-css-style-bp-font-family":"6035","oj-css-style-abs-units":"6040","oj-css-style-abs-units_1":"6041","oj-css-bp-float":"6045","oj-css-bp-float_1":"6046","oj-css-bp-textalign":"6050","oj-css-bp-textalign_1":"6051","oj-css-bp-border-color":"6060","oj-css-bp-border-color_1":"6061","oj-css-var-override":"6065","oj-css-var-override_1":"6066","oj-css-bp-dir-flow":"6070","oj-tsx-wctag-packprivate":"7000","oj-tsx-ojtag-deprecated":"7010","oj-tsx-ojtag-deprecated_1":"7011","oj-tsx-cca-tagname":"7015","oj-tsx-cca-tagname_1":"7016","oj-tsx-ojattr":"7020","oj-tsx-ojattr_1":"7021","oj-tsx-ojattr_2":"7022","oj-tsx-ojattr-value":"7025","oj-tsx-attr-req":"7030","oj-tsx-5-tag-obs":"7035","oj-tsx-prop-inline-definition":"7040","oj-tsx-combo-converter":"7045","oj-tsx-aria-ojselector-labelledby":"7050","oj-tsx-aria-prop":"7055","oj-tsx-rating-gauge-size":"7060","oj-tsx-input-isodate":"7065","oj-tsx-input-isodate_1":"7066","oj-tsx-input-isodate_2":"7067","oj-tsx-input-isodate_3":"7068","oj-tsx-input-isodate_4":"7069","oj-tsx-input-isodate_5":"7070","oj-tsx-input-isodate_6":"7071","oj-tsx-input-isodate_7":"7072","oj-tsx-input-isodate_8":"7073","oj-tsx-input-isodate_9":"7074","oj-tsx-unsup-theme":"7080","oj-tsx-unsup-theme_1":"7081","oj-tsx-pageopts-type":"7085","oj-tsx-pageopts-type_1":"7086","oj-tsx-pageopts-type_2":"7087","oj-tsx-pageopts-type_3":"7088","oj-tsx-picker-attrs":"7090","oj-tsx-wctag-nested":"7095","oj-tsx-dlg-title":"7100","oj-tsx-acc-button-onclick":"7105","oj-tsx-acc-avatar-aria-role":"7110","oj-tsx-databind-all":"7115","oj-tsx-wctag-maintenance":"7120","oj-tsx-slot-deprecated":"7125","oj-tsx-ojattr-deprecated":"7130","oj-tsx-ojattr-deprecated_1":"7131","oj-tsx-jsx-prop":"7135","oj-tsx-jsx-prop_1":"7136","oj-tsx-form-bindif":"7140","oj-tsx-form-noflex":"7145","oj-tsx-rating-gauge-track-resize":"7150","oj-tsx-slot-pref-content":"7155","oj-tsx-ojtag-ns":"7160","oj-tsx-ojtag-ns_1":"7161","oj-tsx-ojattr-enum-deprecated":"7165","oj-tsx-tabbar-edge":"7170","oj-tsx-tabbar-edge_1":"7171","oj-cca-comp-json-file":"9000","oj-cca-comp-json-schema":"9005","oj-cca-comp-json-compdeps":"9010","oj-cca-comp-zip":"9015","oj-cca-comp-zip-type":"9020","oj-cca-comp-zip-content":"9025","oj-cca-comp-zip-content-case":"9030","oj-cca-compjson-bp-obj":"9040","oj-cca-compjson-bp-ar":"9043","oj-cca-compjson-ns-reg":"9046","oj-cca-compjson-ns-reg_1":"9047","oj-cca-compjson-bp-jetver":"9049","oj-cca-compjson-bp-dsplyname":"9052"}
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULE_NAME="oj-acc-aria-labelledby";const ARIA_LABELLEDBY="aria-labelledby";const DATABIND="data-bind";const DESCRIPTION="The <i>'aria-labelledby'</i> attribute contains the element id of another element to provide a relationship between an object and its label. The label ID can be provided by an 'id' or a JET 'label-id' attribute. e.g. <p><oj-label id=\"groupReadonly\" label-id=\"groupReadonly\" class=\"oj-label\">Read Only switches</oj-label><br><oj-switch id=\"switch-1\" readonly aria-labelledby=\"groupReadonly\"></oj-switch><br>";function getName(){return RULE_NAME};function getShortDescription(){return"JET 'aria-labelledby' attribute must refer to an element 'id' or 'label-id' attribute"};function getDescription(){return DESCRIPTION};function register(){return{"
|
|
6
|
+
const RULE_NAME="oj-acc-aria-labelledby";const ARIA_LABELLEDBY="aria-labelledby";const DATABIND="data-bind";const DESCRIPTION="The <i>'aria-labelledby'</i> attribute contains the element id of another element to provide a relationship between an object and its label. The label ID can be provided by an 'id' or a JET 'label-id' attribute. e.g. <p><oj-label id=\"groupReadonly\" label-id=\"groupReadonly\" class=\"oj-label\">Read Only switches</oj-label><br><oj-switch id=\"switch-1\" readonly aria-labelledby=\"groupReadonly\"></oj-switch><br>";function getName(){return RULE_NAME};function getShortDescription(){return"JET 'aria-labelledby' attribute must refer to an element 'id' or 'label-id' attribute"};function getDescription(){return DESCRIPTION};function register(){return{"webcomp":_onComp}};function _onComp(ruleCtx){var attrs,attr,val;if(!(attrs=ruleCtx.tagNode.attribs)){return}for(attr in attrs){val=attrs[attr];_onAttr(ruleCtx,attr,val)}}function _onAttr(ruleCtx,attrName,attrValue){var attr,node,attrOrig=attrName;var ids,i;if(attrName===DATABIND){attr=ruleCtx.utils.DomUtils.extractAttribsFromDataBind(attrValue);if(attr&&attr[ARIA_LABELLEDBY]){attrName=ARIA_LABELLEDBY;attrValue=attr[ARIA_LABELLEDBY]}}if(attrName!==ARIA_LABELLEDBY||_isExpression(attrValue)){return}ids=attrValue.split(" ");for(i=0;i<ids.length;i++){ids[i]=ids[i].trim();if(ids.length){if(_isExpression(ids[i])){continue}node=ruleCtx.utils.DomUtils.getElemById(ids[i],true);if(!node){let issue=new ruleCtx.Issue(`<${ruleCtx.tagNode.name}> 'aria-labelledby' attribute '${ids[i]}' has no matching element with same id`);_addIssue(ruleCtx,issue,attrOrig)}}}};function _addIssue(ruleCtx,issue,attrName){let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)};function _isExpression(s){return /[(}{}+*\/]/.test(s)};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const helperPos=require(
|
|
6
|
+
const helperPos=require("./helpers/json-propname-pos");const helperProp=require("./helpers/bp-checkPropType");const RULE_NAME="oj-cca-compjson-bp-ar";function getName(){return RULE_NAME};function getShortDescription(){return"Web component component.json metadata should follow best practices and avoid 'array' properties"};function getDescription(){return"For best practices, web component property definitions should avoid use of unqualified property type 'array', and provide a more complete definition of the API using a closure type definition"};function register(){return{"compjson-composite":_handle}};function _handle(ruleCtx,obj){var json,props,prop,propObj,propType,issue,msg,pos,i;json=obj.obj;if(json.properties){props=helperProp(json.properties,"a");if(props){for(i=0;i<props.length;i++){prop=props[i];propObj=prop.includes(".")?_getPropObject(json.properties,prop):json.properties[prop];propType=propObj.type;if(propType.indexOf("<")>=0){continue}msg="property '"+prop+"': unqualified type 'array'. Provide a more complete API definition using a closure type definition";issue=new ruleCtx.Issue(msg);pos=helperPos(ruleCtx,prop);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _getPropObject(properties,propName){var propObj,a,i;a=propName.split(".");for(i=0;i<a.length;i++){propObj=properties[a[i]];if(propObj.properties){properties=propObj.properties}}return propObj}module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const helperPos=require(
|
|
6
|
+
const helperPos=require("./helpers/json-propname-pos");const helperProp=require("./helpers/bp-checkPropType");const RULE_NAME="oj-cca-compjson-bp-obj";function getName(){return RULE_NAME};function getShortDescription(){return"Web component component.json metadata should follow best practices and avoid 'object' type properties"};function getDescription(){return"For best practices, web components should avoid use of the property type 'object' without sub-properties, and provide a more complete definition of the API either using sub-properties or using a closure type definition"};function register(){return{"compjson-composite":_handle}};function _handle(ruleCtx,obj){var json,props,prop,issue,msg,pos,i;json=obj.obj;if(json.properties){props=helperProp(json.properties,"o");if(props){for(i=0;i<props.length;i++){prop=props[i];if(_hasSub_properties(json.properties,prop)){continue}msg="property '"+prop+"': type 'object' has no sub-properties. Provide a more complete API definition using sub-properties or a closure type definition";issue=new ruleCtx.Issue(msg);pos=helperPos(ruleCtx,prop);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _hasSub_properties(props,prop){var subprop,a,i;if(!prop.includes(".")){return!!props[prop].properties}a=prop.split(".");for(i=0;i<a.length;i++){subprop=props[a[i]];if(subprop&&subprop.properties){if(a.length-1===i){return true}props=subprop.properties;continue}break}return false};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULENAME=
|
|
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;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
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}
|
|
6
|
+
const RULE_NAME="oj-html-attr-$unique";const $UNIQUE="$unique";const ID="id";const DATABIND="data-bind";const ATTR="attr";const MSG="Use $uniqueid instead of $unique in Knockout and web component syntax";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 MSG}function getDescription(){return EXPLAIN}function register(){return{"notglob":_onComp}};function _onComp(ruleCtx){var attrs,attr,val;if(!(attrs=ruleCtx.tagNode.attribs)){return}for(attr in attrs){val=attrs[attr];_onAttr(ruleCtx,attr,val)}}function _onAttr(ruleCtx,attrName,attrValue){if(attrName===DATABIND&&attrValue.startsWith(ATTR)){if(_is$Unique(attrValue)){let issue=new ruleCtx.Issue(`<${ruleCtx.tag}> data-bind attribute uses $unique. ${EXPLAIN}`);issue.setMsgKey(RULE_NAME+"_1");_addIssue(ruleCtx,issue,attrName)}return}if(_is$Unique(attrValue)){let issue=new ruleCtx.Issue(`<${ruleCtx.tag}> - found use of $unique. ${EXPLAIN}`);issue.setMsgKey(RULE_NAME+"_2");_addIssue(ruleCtx,issue,attrName)}};function _addIssue(ruleCtx,issue,attrName){let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);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};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2023, 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-expr-delims";const LONG="Unmatched attribute expression delimiters are not permitted.";function getName(){return RULE_NAME};function getShortDescription(){return LONG};function getDescription(){return LONG};function register(){return{"attrexpr":_onExpr}};function _onExpr(ruleCtx,attrName,attrValue){attrValue=attrValue.trim();if(attrName.charAt(0)===":"){attrName=attrName.substring(1)}if(_badExprDelims(attrValue)){let issue=new ruleCtx.Issue(`Attribute '${attrName}' has unmatched expression delimiters.`);ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _badExprDelims(expr){return expr.startsWith("[[")&&!expr.endsWith("]]")||expr.startsWith("{{")&&!expr.endsWith("}}")};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
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){
|
|
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){if(!tag.startsWith("oj-combobox-")){return}let attribs=ruleCtx.tagNode.attribs;if(attribs[CONVERTER]){let issue=new ruleCtx.Issue(`<${tag}> use of 'converter' - in JET >= 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;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
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
|
|
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;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
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";
|
|
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";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-form-layout>":this._onForm}}_onForm(ruleCtx){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;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULENAME="oj-html-input-isodate";const DESCRIPTION="Date/time strings used in the 'value', 'min, and 'max' attributes of web components "+"<oj-input-date>, oj-input-date-time>, <oj-input-time>, <oj-date-picker>, and <oj-date-time-picker>, "+"must be valid ISO-8061 strings, and have the same format type - zulu, offset, or local. ";const SHORT_DESCRIPTION="Date/time strings used in the 'value', 'min, and 'max' attributes of <oj-date-*> and <oj-input-date-*>, "+"must have the same format type - zulu, offset, or local. ";const ISO_DATE_REGEXP=/^[+-]?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(Z|[+-]\d{2}(?::?\d{2})?)?)?$|^T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(Z|[+-]\d{2}(?::?\d{2})?)?$/;class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-input-date>":this._onOjTag,"<oj-input-date-time>":this._onOjTag,"<oj-input-time>":this._onOjTag,"<oj-date-picker>":this._onOjTag,"<oj-date-time-picker>":this._onOjTag}}_onOjTag(ruleCtx){let min,max,value;this._isErr=this._isValExpr=this._isMinExpr=this._isMaxExpr=false;value=_getAttrib(ruleCtx,"value");min=_getAttrib(ruleCtx,"min");max=_getAttrib(ruleCtx,"max");this._isValid(ruleCtx,value,min,max)}_isValid(ruleCtx,value,min,max){if(value){this._isValExpr=_isExpr(value);if(!this._isValExpr&&!ISO_DATE_REGEXP.test(value)){this._emitIssue(ruleCtx,"value",value,1)}}if(min){this._isMinExpr=_isExpr(min);if(!this._isMinExpr&&!ISO_DATE_REGEXP.test(min)){this._emitIssue(ruleCtx,"min",min,2)}}if(max){this._isMaxExpr=_isExpr(max);if(!this._isMaxExpr&&!ISO_DATE_REGEXP.test(max)){this._emitIssue(ruleCtx,"max",max,3)}}if(this._isErr){return}this._checkZone(ruleCtx,value,min,max);if(!this._isErr){this._isMinGtMax(ruleCtx,min,max);this._isTimeOnlyValue(ruleCtx,value,min,max)}}_checkZone(ruleCtx,value,min,max){var fmtValue,fmtMin,fmtMax,fmtErr;if(value&&!this._isValExpr){fmtValue=this._getISOStrFormatType(value);if(fmtValue===null){fmtErr="value"}}if(min&&!this._isMinExpr){fmtMin=this._getISOStrFormatType(min);if(fmtMin===null){fmtErr="min"}}if(max&&!this._isMaxExpr){fmtMax=this._getISOStrFormatType(max);if(fmtMax===null){fmtErr="max"}}if(fmtErr){this._emitIssue(ruleCtx,fmtErr,null,9);return}if(value&&fmtValue){if(min&&fmtMin&&max&&fmtMax&&!(fmtValue===fmtMin&&fmtValue===fmtMax)){this._emitIssue(ruleCtx,fmtValue,null,5)}else{if(min&&fmtMin&&!(fmtValue===fmtMin)){this._emitIssue(ruleCtx,fmtValue,null,6)}if(max&&fmtMax&&!(fmtValue===fmtMax)){this._emitIssue(ruleCtx,fmtValue,null,7)}}}if(min&&fmtMin&&max&&fmtMax&&!(fmtMin===fmtMax)){this._emitIssue(ruleCtx,fmtValue,fmtMax,8)}}_isTimeOnlyValue(ruleCtx,value,min,max){if(value&&!this._isValExpr&&value.startsWith("T")){if(min&&!this._isMinExpr&&!min.startsWith("T")){this._emitIssue(ruleCtx,"min",null,10)}if(max&&!this._isMaxExpr&&!min.startsWith("T")){this._emitIssue(ruleCtx,"max",null,10)}}}_isMinGtMax(ruleCtx,min,max){if(min&&!this._isMinExpr&&max&&!this._isMaxExpr){if(_compareISODates(max,min)<=0){this._emitIssue(ruleCtx,null,null,4)}}}_getISOStrFormatType(isoStr){let format=null;var exe=ISO_DATE_REGEXP.exec(isoStr);if(exe){if(exe[1]===undefined&&exe[2]===undefined){format="local"}else{let timeZone=exe[1]!==undefined?exe[1]:exe[2];format=timeZone==="Z"?"zulu":"offset"}}return format}_emitIssue(ruleCtx,str,val,id){var issue,attrPos;switch(id){case 1:case 2:case 3:issue=new ruleCtx.Issue(`Attrib '${str}' : Invalid ISO-8601 time/date string`);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,str);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);break;case 4:issue=new ruleCtx.Issue(`min' attribute value is greater than 'max'`);break;case 5:issue=new ruleCtx.Issue(`'min' and 'max' must be same ISO string format as 'value' (${str})`);break;case 6:issue=new ruleCtx.Issue(`'min' must be same ISO string format as 'value' (${str})`);break;case 7:issue=new ruleCtx.Issue(`'max' must be same ISO string format as 'value' (${str}))`);break;case 8:issue=new ruleCtx.Issue(`'min' and 'max' must be same ISO string format. 'min'= ${str}, 'max'=${val}`);break;case 9:issue=new ruleCtx.Issue(`Error determining ISO string format of '${str}'`);break;case 10:issue=new ruleCtx.Issue(`value' is a time-only string, but '${str}' includes a date`);break
|
|
6
|
+
const RULENAME="oj-html-input-isodate";const DESCRIPTION="Date/time strings used in the 'value', 'min, and 'max' attributes of web components "+"<oj-input-date>, oj-input-date-time>, <oj-input-time>, <oj-date-picker>, and <oj-date-time-picker>, "+"must be valid ISO-8061 strings, and have the same format type - zulu, offset, or local. ";const SHORT_DESCRIPTION="Date/time strings used in the 'value', 'min, and 'max' attributes of <oj-date-*> and <oj-input-date-*>, "+"must have the same format type - zulu, offset, or local. ";const ISO_DATE_REGEXP=/^[+-]?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(Z|[+-]\d{2}(?::?\d{2})?)?)?$|^T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(Z|[+-]\d{2}(?::?\d{2})?)?$/;class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-input-date>":this._onOjTag,"<oj-input-date-time>":this._onOjTag,"<oj-input-time>":this._onOjTag,"<oj-date-picker>":this._onOjTag,"<oj-date-time-picker>":this._onOjTag}}_onOjTag(ruleCtx){let min,max,value;this._isErr=this._isValExpr=this._isMinExpr=this._isMaxExpr=false;value=_getAttrib(ruleCtx,"value");min=_getAttrib(ruleCtx,"min");max=_getAttrib(ruleCtx,"max");this._isValid(ruleCtx,value,min,max)}_isValid(ruleCtx,value,min,max){if(value){this._isValExpr=_isExpr(value);if(!this._isValExpr&&!ISO_DATE_REGEXP.test(value)){this._emitIssue(ruleCtx,"value",value,1)}}if(min){this._isMinExpr=_isExpr(min);if(!this._isMinExpr&&!ISO_DATE_REGEXP.test(min)){this._emitIssue(ruleCtx,"min",min,2)}}if(max){this._isMaxExpr=_isExpr(max);if(!this._isMaxExpr&&!ISO_DATE_REGEXP.test(max)){this._emitIssue(ruleCtx,"max",max,3)}}if(this._isErr){return}this._checkZone(ruleCtx,value,min,max);if(!this._isErr){this._isMinGtMax(ruleCtx,min,max);this._isTimeOnlyValue(ruleCtx,value,min,max)}}_checkZone(ruleCtx,value,min,max){var fmtValue,fmtMin,fmtMax,fmtErr;if(value&&!this._isValExpr){fmtValue=this._getISOStrFormatType(value);if(fmtValue===null){fmtErr="value"}}if(min&&!this._isMinExpr){fmtMin=this._getISOStrFormatType(min);if(fmtMin===null){fmtErr="min"}}if(max&&!this._isMaxExpr){fmtMax=this._getISOStrFormatType(max);if(fmtMax===null){fmtErr="max"}}if(fmtErr){this._emitIssue(ruleCtx,fmtErr,null,9);return}if(value&&fmtValue){if(min&&fmtMin&&max&&fmtMax&&!(fmtValue===fmtMin&&fmtValue===fmtMax)){this._emitIssue(ruleCtx,fmtValue,null,5)}else{if(min&&fmtMin&&!(fmtValue===fmtMin)){this._emitIssue(ruleCtx,fmtValue,null,6)}if(max&&fmtMax&&!(fmtValue===fmtMax)){this._emitIssue(ruleCtx,fmtValue,null,7)}}}if(min&&fmtMin&&max&&fmtMax&&!(fmtMin===fmtMax)){this._emitIssue(ruleCtx,fmtValue,fmtMax,8)}}_isTimeOnlyValue(ruleCtx,value,min,max){if(value&&!this._isValExpr&&value.startsWith("T")){if(min&&!this._isMinExpr&&!min.startsWith("T")){this._emitIssue(ruleCtx,"min",null,10)}if(max&&!this._isMaxExpr&&!min.startsWith("T")){this._emitIssue(ruleCtx,"max",null,10)}}}_isMinGtMax(ruleCtx,min,max){if(min&&!this._isMinExpr&&max&&!this._isMaxExpr){if(_compareISODates(max,min)<=0){this._emitIssue(ruleCtx,null,null,4)}}}_getISOStrFormatType(isoStr){let format=null;var exe=ISO_DATE_REGEXP.exec(isoStr);if(exe){if(exe[1]===undefined&&exe[2]===undefined){format="local"}else{let timeZone=exe[1]!==undefined?exe[1]:exe[2];format=timeZone==="Z"?"zulu":"offset"}}return format}_emitIssue(ruleCtx,str,val,id){var issue,attrPos;switch(id){case 1:case 2:case 3:issue=new ruleCtx.Issue(`Attrib '${str}' : Invalid ISO-8601 time/date string`);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,str);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);break;case 4:issue=new ruleCtx.Issue(`min' attribute value is greater than 'max'`);break;case 5:issue=new ruleCtx.Issue(`'min' and 'max' must be same ISO string format as 'value' (${str})`);break;case 6:issue=new ruleCtx.Issue(`'min' must be same ISO string format as 'value' (${str})`);break;case 7:issue=new ruleCtx.Issue(`'max' must be same ISO string format as 'value' (${str}))`);break;case 8:issue=new ruleCtx.Issue(`'min' and 'max' must be same ISO string format. 'min'= ${str}, 'max'=${val}`);break;case 9:issue=new ruleCtx.Issue(`Error determining ISO string format of '${str}'`);break;case 10:issue=new ruleCtx.Issue(`value' is a time-only string, but '${str}' includes a date`);break}if(issue){this._isErr=true;if(id>1){issue.setMsgKey(RULENAME+"_"+(id-1))}ruleCtx.reporter.addIssue(issue,ruleCtx)}}}function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};function _compareISODates(maxIso,minIso){const today=new Date;const month=today.getMonth()+1;let monthStr=_zeroPad(month.toString(),2);const day=today.getDate();let dayStr=_zeroPad(day.toString(),2);const todayIsoDate=today.getFullYear()+"-"+monthStr+"-"+dayStr;let isoString1=maxIso;let isoString2=minIso;const maxStartsWithT=maxIso.indexOf("T")===0;const minStartsWithT=minIso.indexOf("T")===0;const maxHasNoT=maxIso.indexOf("T")===-1;const minHasNoT=minIso.indexOf("T")===-1;const zeroTime="T00:00:00";if(maxStartsWithT){isoString1=todayIsoDate+isoString1}else if(maxHasNoT){isoString1+=zeroTime}if(minStartsWithT){isoString2=todayIsoDate+isoString2}else if(minHasNoT){isoString2+=zeroTime}const dateMax=new Date(isoString1);const dateMin=new Date(isoString2);return dateMax.getTime()-dateMin.getTime()};function _getAttrib(ruleCtx,attr){return _getNodeAttrib(ruleCtx,ruleCtx.node,attr)};function _getNodeAttrib(ruleCtx,node,attr){var du=ruleCtx.utils.DomUtils;return du.getAttribValue(node,attr)||du.getAttribValue(node,":"+attr)};function _zeroPad(s,n){s=s.trim(s);if(s.length<n){s="0".repeat(n-s.length)+s}return s};module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULE_NAME="oj-html-invalid-doctype";function getName(){return RULE_NAME};function getShortDescription(){return"HTML page should specify 'html' in the <!doctype> declaration"};function getDescription(){return"JET requires HTML5 standards mode. To ensure that this mode is enabled in every browser, you should specify 'html' in the <!doctype> declaration"};function register(){return{"file":_handleFile}};function _handleFile(ruleCtx){var node,siblings,i;var DomUtils=ruleCtx.utils.DomUtils;var NodeType=ruleCtx.NodeTypes;node=ruleCtx.node;if(node.type===NodeType.DIRECTIVE){if(_isGoodDirective(ruleCtx,node)){return}}siblings=DomUtils.getSiblings(node);for(i=0;i<siblings.length;i++){node=siblings[i];if(node.type===NodeType.DIRECTIVE){if(_isGoodDirective(ruleCtx,node)){return}}if(node.type===NodeType.TAG||node.type===NodeType.SCRIPT){break}}};function _isGoodDirective(ruleCtx,node){var ret=false;if(_isDocType(node.data)){if(ruleCtx.utils.DomUtils.isNonFragmentJetPage(ruleCtx)){_isDocTypeHtml(ruleCtx,node);ret=true}}return ret};function _emitIssue(ruleCtx,node,id){var issue,pos,msg;ruleCtx.clearPosition();switch(id){case 1:msg="<!doctype> does not specify 'html'";break;case 2:msg="Unexpected white space between ! and 'doctype'";break
|
|
6
|
+
const RULE_NAME="oj-html-invalid-doctype";function getName(){return RULE_NAME};function getShortDescription(){return"HTML page should specify 'html' in the <!doctype> declaration"};function getDescription(){return"JET requires HTML5 standards mode. To ensure that this mode is enabled in every browser, you should specify 'html' in the <!doctype> declaration"};function register(){return{"file":_handleFile}};function _handleFile(ruleCtx){var node,siblings,i;var DomUtils=ruleCtx.utils.DomUtils;var NodeType=ruleCtx.NodeTypes;node=ruleCtx.node;if(node.type===NodeType.DIRECTIVE){if(_isGoodDirective(ruleCtx,node)){return}}siblings=DomUtils.getSiblings(node);for(i=0;i<siblings.length;i++){node=siblings[i];if(node.type===NodeType.DIRECTIVE){if(_isGoodDirective(ruleCtx,node)){return}}if(node.type===NodeType.TAG||node.type===NodeType.SCRIPT){break}}};function _isGoodDirective(ruleCtx,node){var ret=false;if(_isDocType(node.data)){if(ruleCtx.utils.DomUtils.isNonFragmentJetPage(ruleCtx)){_isDocTypeHtml(ruleCtx,node);ret=true}}return ret};function _emitIssue(ruleCtx,node,id){var issue,pos,msg;ruleCtx.clearPosition();switch(id){case 1:msg="<!doctype> does not specify 'html'";break;case 2:msg="Unexpected white space between ! and 'doctype'";break}issue=new ruleCtx.Issue(msg);pos=_applyfix(ruleCtx,node);issue.setPosition(null,null,pos,pos+7);if(id===2){issue.setMsgKey(RULE_NAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)};function _isDocTypeHtml(ruleCtx,node){var data=node.data.toLowerCase();if(!data.startsWith("!d")){_emitIssue(ruleCtx,node,2)}if(_getNodeData(data)!=="html"){_emitIssue(ruleCtx,node,1)}};function _isDocType(s){s=s?s.substr(1).trim().toLowerCase():s;return s.startsWith("doctype")};function _getNodeData(s){if(s){s=s.replace(/!/g,"").trim().substr(7).trim().toLowerCase()}return s};function _applyfix(ruleCtx,node){var x,i,d;x=node.startIndex;d=ruleCtx.rawData;x=ruleCtx.utils.utils.eatWhitespace(d,x);d=d.substring(x);for(i=0;i<d.length;i++){if(d.charAt(i)==="!"){return x+i}}return node.startIndex};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULENAME="oj-html-msgs-cat-text";const DESCRIPTION="For theme 'Redwood', the UX specification for Messages does not include category text."+"By default, the component renders the category text based on the severity. Redwood themed "+"applications should explicitly set the 'display-options.category' attribute to 'none' so "+"that the category text will not be rendered, and messages will match the UX "+"specificatiopn.";const SHORT_DESCRIPTION="Redwood themed applications should explicitly set the 'display-options.category' attribute to 'none'";const DISP_OPTS_CATEGORY="display-options.category";const OJ_MESSAGE="oj-message";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-messages>":this._onOjMessages}}_onOjMessages(ruleCtx){var msgs,val;var node=ruleCtx.tagNode;var attribs=node.attribs;var attr=attribs[DISP_OPTS_CATEGORY];var template=_hasMessageTemplate(node);if(template){if(msgs=_getMessages(template)){msgs.forEach(msg=>{val=undefined;if(msg.attribs){if((val=msg.attribs[DISP_OPTS_CATEGORY])!==undefined){if(val==="none"||val!=="auto"&&val!=="header"){return}}}this._emitIssue(ruleCtx,val!==undefined?1:2,msg,val)})}else{this._emitIssue(ruleCtx,3)}}else{if(attr!=="none"){this._emitIssue(ruleCtx,4,node,attr)}}}_emitIssue(ruleCtx,id,node,val){var issue;switch(id){case 1:issue=new ruleCtx.Issue(`<oj-message> attrib 'display-options.category' set to '${val}' - expected 'none'`);break;case 2:issue=new ruleCtx.Issue(`<oj-message> attrib 'display-options.category' missing or not set to 'none'`);break;case 3:issue=new ruleCtx.Issue("<template> with <oj-message> children expected");break;case 4:issue=new ruleCtx.Issue(`<oj-messages> attrib 'display-options.category' missing or not set to 'none'`);break
|
|
6
|
+
const RULENAME="oj-html-msgs-cat-text";const DESCRIPTION="For theme 'Redwood', the UX specification for Messages does not include category text."+"By default, the component renders the category text based on the severity. Redwood themed "+"applications should explicitly set the 'display-options.category' attribute to 'none' so "+"that the category text will not be rendered, and messages will match the UX "+"specificatiopn.";const SHORT_DESCRIPTION="Redwood themed applications should explicitly set the 'display-options.category' attribute to 'none'";const DISP_OPTS_CATEGORY="display-options.category";const OJ_MESSAGE="oj-message";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-messages>":this._onOjMessages}}_onOjMessages(ruleCtx){var msgs,val;var node=ruleCtx.tagNode;var attribs=node.attribs;var attr=attribs[DISP_OPTS_CATEGORY];var template=_hasMessageTemplate(node);if(template){if(msgs=_getMessages(template)){msgs.forEach(msg=>{val=undefined;if(msg.attribs){if((val=msg.attribs[DISP_OPTS_CATEGORY])!==undefined){if(val==="none"||val!=="auto"&&val!=="header"){return}}}this._emitIssue(ruleCtx,val!==undefined?1:2,msg,val)})}else{this._emitIssue(ruleCtx,3)}}else{if(attr!=="none"){this._emitIssue(ruleCtx,4,node,attr)}}}_emitIssue(ruleCtx,id,node,val){var issue;switch(id){case 1:issue=new ruleCtx.Issue(`<oj-message> attrib 'display-options.category' set to '${val}' - expected 'none'`);break;case 2:issue=new ruleCtx.Issue(`<oj-message> attrib 'display-options.category' missing or not set to 'none'`);break;case 3:issue=new ruleCtx.Issue("<template> with <oj-message> children expected");break;case 4:issue=new ruleCtx.Issue(`<oj-messages> attrib 'display-options.category' missing or not set to 'none'`);break}if((id===1||id===4)&&val){let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,node,DISP_OPTS_CATEGORY);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end)}else if(id===2){issue.setPosition(null,null,node.startIndex,node.startIndex+OJ_MESSAGE.length)}if(id>1){issue.setMsgKey(RULENAME+"_"+(id-1))}ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _hasMessageTemplate(node){var ch,n,i;if((ch=node.children)&&ch.length){for(i=0;i<ch.length;i++){n=ch[i];if(n.type==="tag"&&n.name==="template"){if(n.attribs&&n.attribs.slot==="messageTemplate"){return n}}}}return null};function _getMessages(node){var ch,msgs=null;if((ch=node.children)&&ch.length){ch.forEach(n=>{if(n.type==="tag"&&n.name==="oj-message"){if(!msgs){msgs=[]}msgs.push(n)}})}return msgs};module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULE_NAME="oj-html-ojattr-deprecated";const ON_EVENT_PREFIX="on-";const DASH_CHANGED="-changed";const DATABIND="data-bind";const STATUS_PROP_TYPE="propertyType";const STATUS_PROP_VALUE="propertyValue";const STATUS_PROPERTY="property";const OBJECT="object";const STRING="string";const ARRAY_DOT_STRING="array.<string>";const ARRAY_STRING="array<string>";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const OR="|";const SHORT="Deprecated web component attributes or deprecated event attributes should not be used";const LONG="Deprecated web component attributes, or event attributes referring to a deprecated attribute, should not be used. Refer to the API doc for potential removal date.";function getName(){return RULE_NAME}function getShortDescription(){return SHORT}function getDescription(){return LONG}function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag){var attrs,attr,attrName;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){attrName=attr.charAt(0)!==":"?attr:attr.substring(1);if(ruleCtx.utils.DomUtils.isCommonAttr(attrName)||ruleCtx.utils.DomUtils.isCommonEventAttr(attrName)||attr===DATABIND){continue}_checkAttr(ruleCtx,tag,attrName,attrs[attr])}}};function _checkAttr(ruleCtx,tag,attr,attrVal){var isEvent,deps,status,metaLib;var propType,attrValType;var emitted=false;metaLib=ruleCtx.utils.metaLib;if(attr.startsWith(ON_EVENT_PREFIX)){deps=metaLib.isTagEventDeprecated(tag,attr);isEvent=true}else{deps=metaLib.isTagAttrDeprecated(tag,attr)}propType=metaLib.getTagAttrType(tag,attr);if(!deps&&!isEvent&&propType){if(!_isObjectType(propType)){return}_checkObjectProps(ruleCtx,tag,attr,attrVal);return}if(!deps){return}attrValType=
|
|
6
|
+
const RULE_NAME="oj-html-ojattr-deprecated";const ON_EVENT_PREFIX="on-";const DASH_CHANGED="-changed";const DATABIND="data-bind";const STATUS_PROP_TYPE="propertyType";const STATUS_PROP_VALUE="propertyValue";const STATUS_PROPERTY="property";const OBJECT="object";const STRING="string";const ARRAY_DOT_STRING="array.<string>";const ARRAY_STRING="array<string>";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const OR="|";const ANY="any";const SHORT="Deprecated web component attributes or deprecated event attributes should not be used";const LONG="Deprecated web component attributes, or event attributes referring to a deprecated attribute, "+"should not be used. Refer to the API doc for potential removal date.";function getName(){return RULE_NAME}function getShortDescription(){return SHORT}function getDescription(){return LONG}function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag){var attrs,attr,attrName;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){attrName=attr.charAt(0)!==":"?attr:attr.substring(1);if(ruleCtx.utils.DomUtils.isCommonAttr(attrName)||ruleCtx.utils.DomUtils.isCommonEventAttr(attrName)||attr===DATABIND){continue}_checkAttr(ruleCtx,tag,attrName,attrs[attr])}}};function _checkAttr(ruleCtx,tag,attr,attrVal){var isEvent,deps,status,metaLib;var propType,attrValType;var emitted=false;metaLib=ruleCtx.utils.metaLib;if(attr.startsWith(ON_EVENT_PREFIX)){deps=metaLib.isTagEventDeprecated(tag,attr);isEvent=true}else{deps=metaLib.isTagAttrDeprecated(tag,attr)}propType=metaLib.getTagAttrType(tag,attr);if(!deps&&!isEvent&&propType){if(!_isObjectType(propType)){return}_checkObjectProps(ruleCtx,tag,attr,attrVal);return}if(!deps){return}attrValType=_getAttrValueType(attrVal);for(status of deps){if(status.target===STATUS_PROPERTY){if(isEvent){return}}else if(status.target===STATUS_PROP_TYPE||status.target===STATUS_PROP_VALUE){if(attrValType==="expr"||attrValType==="Object"){continue}if(status.value){if(status.target===STATUS_PROP_VALUE){emitted=_doPropValue(ruleCtx,attrValType,tag,attr,attrVal,status,isEvent)}else{emitted=_doPropType(ruleCtx,propType,attrValType,tag,attr,attrVal,status,isEvent)}}else{_emitIssue(ruleCtx,tag,attr,attrVal,status,isEvent?"event":"attr");emitted=true}}else if(!status.value){_emitIssue(ruleCtx,tag,attr,attrVal,status,isEvent?"event":"attr");emitted=true}if(emitted){break}}};function _doPropValue(ruleCtx,attrValType,tag,attr,attrVal,status,isEvent){var ret=false;if(attrValType==="string"||attrValType==="number"||attrValType==="boolean"){if(ruleCtx.rulePack.isRuleEnabled("oj-html-ojattr-enum-deprecated")){return}if(status.value.includes(attrVal)){_emitIssue(ruleCtx,tag,attr,attrVal,status,isEvent?"event":"val");ret=true}}else if(attrValType==="Array<string>"){let aVals=_getStringValsFromAttr(attrVal);if(aVals.length){status.value.forEach(av=>{if(aVals.includes(av)){_emitIssue(ruleCtx,tag,attr,av,status,isEvent?"event":"val");ret=true}})}}return ret};function _doPropType(ruleCtx,propType,attrValType,tag,attr,attrVal,status,isEvent){var val;let propTypes=propType.split(OR);propTypes.forEach((val,x)=>{propTypes[x]=val.trim().toLowerCase().replace(/\>\./,">")});if(status.value.includes(attrValType)){if(_isStringArrayType(attrValType)){val=ARRAY_DOT_STRING}else if(_isStringType(attrValType)){val=STRING}if(val){_emitIssue(ruleCtx,tag,attr,val,status,isEvent?"event":"type");return true}}if(_isStringArrayType(attrValType)){let typeVals=_getStringValsFromType(status.value);let attrVals=_getStringValsFromAttr(attrVal);let emitted=false;for(val of attrVals){if(typeVals.includes(val)){_emitIssue(ruleCtx,tag,attr,val,status,isEvent?"event":"type");emitted=true}}return emitted}return false};function _emitIssue(ruleCtx,tag,attr,attrVal,status,scope,key){var issue,attrPos;issue=_makeIssue(ruleCtx,tag,attr,attrVal,status,scope,key);attrPos=scope==="attrprop"||scope==="attrpropval"?ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.tagNode,attr):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 _makeIssue(ruleCtx,tag,attr,attrVal,status,scope,key){var issue,msgKey,since,descript;since=status.since?" (since "+status.since+")":"";descript=status.description?" "+status.description:"";if(scope==="event"){if(attr.endsWith(DASH_CHANGED)){scope="attribute"}issue=new ruleCtx.Issue(`Event '${attr}' is deprecated${since} for <${tag}>.${descript}`);msgKey="_1"}else if(scope==="val"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' value '${attrVal}' is deprecated${since}!${descript}`);msgKey="_2"}else if(scope==="type"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' value type '${attrVal}' is deprecated${since}!${descript}`);msgKey="_3"}else if(scope==="attr"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' is deprecated${since}!${descript}`)}else if(scope==="attrprop"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' property '${key}' is deprecated${since}!${descript}`)}else if(scope==="attrpropval"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' property '${key}' value '${attrVal}' is deprecated${since}!${descript}`)}if(msgKey){issue.setMsgKey(RULE_NAME+msgKey)}if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+(msgKey?msgKey:"")+MSG_ID_AGED)}return issue};function _checkObjectProps(ruleCtx,tag,attr,attrVal){var obj,key,deps,dep,metaLib,propType,propVal;if(_isExpr(attrVal)||attrVal.charAt(0)!=="{"){return false}try{attrVal=attrVal.replace(/\'/g,"\"");obj=JSON.parse(attrVal);metaLib=ruleCtx.utils.metaLib;for(key in obj){let prop=attr+"."+key;if(deps=metaLib.isTagAttrDeprecated(tag,prop)){propType=metaLib.getTagAttrType(tag,prop);for(dep of deps){if(!dep.target||!dep.value){_emitIssue(ruleCtx,tag,attr,null,dep,"attrprop",key);return true}else if(dep.target===STATUS_PROP_VALUE&&dep.value){if(_isStringType(propType)){propVal=obj[key];if(dep.value.includes(propVal)){_emitIssue(ruleCtx,tag,attr,propVal,dep,"attrpropval",key);return true}}}}}}}catch(e){}return false};function _getStringValsFromType(ar){var val,ret=[];for(val of ar){if(!val.startsWith("Array<")){if(val.startsWith("'")&&val.endsWith("'")){val=val.substring(1,val.length-1)}ret.push(val)}else{let s=val.substring(6,val.length-1);let elems=s.split(OR);elems.forEach(val=>{val=val.trim();if(val.charAt(0)==="'"){val=val.substring(1,val.length-1)}ret.push(val.trim())})}}return ret};function _getStringValsFromAttr(s){var ret=[];if(s.startsWith("[")){s=s.substring(1,s.length-1);let elems=s.split(",");elems.forEach(val=>{val=val.replace(/[\"\']/g,"");ret.push(val.trim())})}return ret};function _getAttrValueType(v){var ret;if(_isExpr(v)){ret="expr"}else{let s=v.charAt(0);if(s==="{"){ret="Object"}else if(s==="["){ret="Array"}else if(!isNaN(parseInt(v))){ret="number"}s=v.toLowerCase();if(s==="true"||s==="false"){ret="boolean"}else if(s==="null"){ret="null"}else if(!ret){ret="string"}}if(ret==="Array"){ret="Array<string>"}return ret};function _isStringArrayType(s){s=s.toLowerCase();return s===ARRAY_STRING||s===ARRAY_DOT_STRING};function _isStringType(s){return s.toLowerCase()===STRING};function _isObjectType(s){var ret,t,a,i;a=s.split(OR);for(i=0;i<a.length;i++){t=a[i].trim().toLowerCase();if(t===OBJECT||t===ANY){ret=true;break}}return ret?ret:false};function _isExpr(s){return s.startsWith("{{")||s.startsWith("[[")};function _getPropFromEvent(ruleCtx,tag,attr){return ruleCtx.utils.metaLib.getTagPropertyFromEvent(tag,attr)};module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULE_NAME="oj-html-ojattr-enum-deprecated";const LONG="Web component attributes that are assigned a deprecated enumerated value should not be used.";const SHORT="Deprecated enumerated attribute values should not be used.";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return LONG};function register(){return{"webcomp":_onWc}};function _onWc(ruleCtx,tagName){var attribs,attrName,enumValue,issue,metaLib,o,since,help;metaLib=ruleCtx.utils.metaLib;attribs=ruleCtx.node.attribs;if(!attribs){return}for(attrName in attribs){issue=null;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);if(!(enumValue=attribs[attrName])){if(!(enumValue=attribs[":"+attrName])){return}}if(_isExpr(enumValue)){return}o=metaLib.isTagAttrEnumValueDeprecated(tagName,attrName,enumValue)
|
|
6
|
+
const RULE_NAME="oj-html-ojattr-enum-deprecated";const LONG="Web component attributes that are assigned a deprecated enumerated value should not be used.";const SHORT="Deprecated enumerated attribute values should not be used.";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return LONG};function register(){return{"webcomp":_onWc}};function _onWc(ruleCtx,tagName){var attribs,attrName,enumValue,issue,metaLib,o,since,help;metaLib=ruleCtx.utils.metaLib;attribs=ruleCtx.node.attribs;if(!attribs){return}for(attrName in attribs){issue=null;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);if(!(enumValue=attribs[attrName])){if(!(enumValue=attribs[":"+attrName])){return}}if(_isExpr(enumValue)||enumValue.startsWith("data-")||enumValue.startsWith("aria-")||enumValue==="class"||enumValue==="style"){return}if(o=metaLib.isTagAttrEnumValueDeprecated(tagName,attrName,enumValue)){help=o.description?" "+o.description.trim():"";since=o.since?" (since "+o.since+")":"";issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' enumerated value '${enumValue}' is deprecated${since}.${help}`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+MSG_ID_AGED)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _isExpr(s){var start=s.substring(0,2);return start==="[["||start==="{{"}module.exports={getName,getDescription,getShortDescription,register};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULE_NAME="oj-html-ojtag-deprecated";const SHORT="Deprecated custom components should not be used";const LONG="Deprecated custom components should not be used. Refer to the diagnostic issued for a suggested replacement.";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const ID_PLUS_1="_1";class Rule{getName(){return RULE_NAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{"webcomp":this._onWC}}_onWC(ruleCtx,tag){var metaLib,status;if(tag==="oj-slot"){return}metaLib=ruleCtx.utils.metaLib;if(status=metaLib.isTagDeprecated(tag)){let descript=status.description
|
|
6
|
+
const RULE_NAME="oj-html-ojtag-deprecated";const SHORT="Deprecated custom components should not be used";const LONG="Deprecated custom components should not be used. Refer to the diagnostic issued for a suggested replacement.";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const DOT=".";const ID_PLUS_1="_1";class Rule{getName(){return RULE_NAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{"webcomp":this._onWC}}_onWC(ruleCtx,tag){var metaLib,status;if(tag==="oj-slot"){return}metaLib=ruleCtx.utils.metaLib;if(status=metaLib.isTagDeprecated(tag)){let descript=status.description?` ${status.description}`:"";let since=status.since?" (since "+status.since+")":null;let value="";let b;if(descript&&!descript.endsWith(DOT)){descript+=DOT}if(status.value&&status.value.length){value=` Available alternative${status.value.length===1?" is":"s are"}`;value+=`: <${status.value.join(">, ")}>.`}let issue=new ruleCtx.Issue(`<${tag}> is deprecated${since}.${descript}${value}`);if(!ruleCtx.ojTag){issue.setMsgKey(RULE_NAME+ID_PLUS_1);b=true}if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+(b?ID_PLUS_1:"")+MSG_ID_AGED)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULENAME="oj-html-ojtag-ns";const LONG="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered. A component must not use an un-registered namespace.";const SHORT="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered.";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{
|
|
6
|
+
const RULENAME="oj-html-ojtag-ns";const LONG="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered. A component must not use an un-registered namespace.";const SHORT="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered.";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{notglob:this._onNotGlob}}_onNotGlob(ruleCtx,tagName){var tagName,a,prefix,msg,i;if(!tagName.includes("-")||tagName.startsWith("demo-")||tagName.startsWith("my-")||tagName==="oj-slot"||ruleCtx.ojNS){return}if(tagName.startsWith("oj-")||tagName.startsWith("ns-")){if(!ruleCtx.utils.metaLib.isNamespaceTag(tagName)){if(!ruleCtx.utils.metaLib.isJetTag(tagName)){msg=`<${tagName}> : unregistered use of '${tagName.substring(0,2)}' namespace`;this._emitIssue(ruleCtx,msg)}}}else{if(this._nameSpaces){a=tagName.split("-");prefix=a[0]+"-"+a[1];for(i=0;i<this._nameSpaces.length;i++){if(this._nameSpaces[i].startsWith(prefix)){return}}}msg=`'${tagName}' : use of unknown web component namespace`;this._emitIssue(ruleCtx,msg,1)}}_emitIssue(ruleCtx,msg,id){var issue;issue=new ruleCtx.Issue(msg);if(id){issue.setMsgKey(RULENAME+"_"+id)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2023, 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-rating-gauge-track-resize";const DESCRIPTION="The use of the <oj-rating-gauge> 'track-resize' attribute is a Redwood theme anti-pattern. "+"This attribute is only needed if the 'size' attribute is set to 'fit', however, 'fit' is a "+"Redwood theme anti-pattern.";const SHORT_DESCRIPTION="Do not use <oj-rating-gauge> with the 'track-resize' attribute set to 'on' in Redwood";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-rating-gauge track-resize=>":this._onTrackResize}}_onTrackResize(ruleCtx,attr,value){if(value==="on"){let issue=new ruleCtx.Issue(`<oj-rating-gauge> attribute 'track-size' value 'on' is an anti-pattern in Redwood.`);issue.setSeverity("blocker");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULE_NAME="oj-html-self-close";const SHORT="Do not self-close non-void elements.";const DESCRIPT="Do not self-close non-void elements, e.g. <div/> or <span/>";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._utils=regCtx.utils.utils;return{elem:this._onElem}};Rule.prototype._onElem=function(ruleCtx,tag){var tag,n,issue;var DomUtils;DomUtils=ruleCtx.utils.DomUtils;n=ruleCtx.tagNode;if(!DomUtils.isSvgElem(tag)){if(!DomUtils.isCommonElem(tag)||!DomUtils.isSelfClosingTag(tag)){if(this._isClosed(ruleCtx.data.substring(n.startIndex,n.endIndex+1),n)){issue=new ruleCtx.Issue(
|
|
6
|
+
const RULE_NAME="oj-html-self-close";const SHORT="Do not self-close non-void elements.";const DESCRIPT="Do not self-close non-void elements, e.g. <div/> or <span/>";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._utils=regCtx.utils.utils;return{elem:this._onElem}};Rule.prototype._onElem=function(ruleCtx,tag){var tag,n,issue;var DomUtils;DomUtils=ruleCtx.utils.DomUtils;n=ruleCtx.tagNode;if(!DomUtils.isSvgElem(tag)){if(!DomUtils.isCommonElem(tag)||!DomUtils.isSelfClosingTag(tag)){if(this._isClosed(ruleCtx.data.substring(n.startIndex,n.endIndex+1),n)){issue=new ruleCtx.Issue(`Invalid self-closure of non-void tag '<${tag}/>'`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};Rule.prototype._isClosed=function(data,node){var c,x,i;data=_removeAttribs(data,node);data=data.trim();if(data.charAt(0)!=="<"){return false}x=_findClose(data);if(x>=0){data=data.substring(0,x+1)}if(data.charAt(data.length-1)===">"){for(i=data.length-2;i>1;i--){c=data.charAt(i);if(this._utils.isWhitespace(c)){continue}return c==="/"}}return false};function _findClose(data){var x;x=data.indexOf(">");return x<0?0:x};function _removeAttribs(data,node){var attrs,attr,val,re;if(!node.attribs){return data}attrs=node.attribs;for(attr in attrs){val=attrs[attr];re=new RegExp(attr);data=data.replace(re,"");val=val.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");re=new RegExp(val);data=data.replace(re,"")}data=data.replace(/[\"\'\=\[\(\{\}\)\]\s#,_]/g,"");return data};module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-deprecated";const DESCRIPT="The slot has been deprecated, and is subject to removal or non-active support in the future.";const SHORT="A deprecated slot has been found.";const SLOT="slot";const TEMPLATE="template";const DEPRECATED="deprecated";const DOT=".";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;return{"<slot=>":this._onSlot}};Rule.prototype._onSlot=function(ruleCtx,slot,slotVal){if(slotVal&&!_isExpr(slotVal)&&ruleCtx.tagNode.name!==TEMPLATE){this._checkSlot(ruleCtx,slotVal)}};Rule.prototype._checkSlot=function(ruleCtx,slotName){var issue,node,
|
|
6
|
+
const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-deprecated";const DESCRIPT="The slot has been deprecated, and is subject to removal or non-active support in the future.";const SHORT="A deprecated slot has been found.";const SLOT="slot";const TEMPLATE="template";const DEPRECATED="deprecated";const DOT=".";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;return{"<slot=>":this._onSlot}};Rule.prototype._onSlot=function(ruleCtx,slot,slotVal){if(slotVal&&!_isExpr(slotVal)&&ruleCtx.tagNode.name!==TEMPLATE){this._checkSlot(ruleCtx,slotVal)}};Rule.prototype._checkSlot=function(ruleCtx,slotName){var issue,node,status;node=getParentNodeForSlot(ruleCtx,slotName);if(!node||node.type!=="tag"){return}if(status=this._metaLib.isTagSlotDeprecated(node.name,slotName)){let since=status.since?` (since ${status.since})`:"";let descript=(status.description?` ${status.description}`:"").trimRight();if(descript&&!descript.endsWith(DOT)){descript+=DOT}issue=new ruleCtx.Issue(`slot '${slotName}' on <${ruleCtx.tag}> for <${node.name}> is deprecated${since}.${descript}`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+MSG_ID_AGED)}ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const getParentNodeForSlot=require(
|
|
6
|
+
const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-item-minmax";const DESCRIPT="Components can include a 'minItems' or 'maxItems' property in a slot defintion in the component metadata, to describe "+"how many child elements can be assigned to that slot. This rule applies to components that are directly allocated to a "+"slot, or which are direct children of a template allocated to that slot.";const SHORT=DESCRIPT;const TEMPLATE="template";const OJ_SWITCHER="oj-switcher";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){this._handled=[];return{"elem":this._onElem,"file":this._onFile}};Rule.prototype._onElem=function(ruleCtx){var slotVal;if(ruleCtx.tagNode.attribs&&(slotVal=ruleCtx.tagNode.attribs.slot)){this._onSlot(ruleCtx,slotVal)}};Rule.prototype._onSlot=function(ruleCtx,slotVal){var issue,node,smd,min,max,items;if(!(node=getParentNodeForSlot(ruleCtx,slotVal))){return}if(this._isNodeHandled(node,slotVal)){return}if(node.name!==OJ_SWITCHER){if(smd=ruleCtx.utils.metaLib.getTagSlotMetadata(node.name,slotVal)){min=typeof smd.minItems==="number"?smd.minItems:0;max=typeof smd.maxItems==="number"?smd.maxItems:0;if(min>0&&max<0){return}}if(ruleCtx.tag===TEMPLATE){items=_getTemplateChildTagCount(ruleCtx.tagNode.children)}else{items=_getChildTagCount(node.children,slotVal)}let sItems;if(items>max&&max>0){sItems=max===1?"one element can":`${max} elements may`;issue=new ruleCtx.Issue(`<${node.name}> specifies that no more than ${sItems} be assigned to slot '${slotVal}'`);issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx);this._handleNode(node,slotVal)}if(min>0&&items<min){sItems=min===1?"one element":`${min} elements`;issue=new ruleCtx.Issue(`<${node.name}> specifies that at least ${sItems} must be assigned to slot '${slotVal}'`);issue.setMsgKey(RULE_NAME+"_1");issue.setSeverity("major");issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx);this._handleNode(node,slotVal)}}};Rule.prototype._onFile=function(){this._handled.length=0};Rule.prototype._isNodeHandled=function(node,slot){var i,si;si=node.startIndex;for(i=0;i<this._handled.length;i+=2){if(this._handled[i]===si&&this._handled[i+1]===slot){return true}}return false};Rule.prototype._handleNode=function(node,slot){this._handled.push(node.startIndex);this._handled.push(slot)};function _getTemplateChildTagCount(childs){var n=0;if(childs){for(let i=0;i<childs.length;i++){if(childs[i].type==="tag"){n++}}}return n};function _getChildTagCount(childs,slot){var child,n=0;if(childs){for(let i=0;i<childs.length;i++){child=childs[i];if(child.type==="tag"&&child.attribs&&child.attribs.slot===slot){n++}}}return n};module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-name";const DESCRIPT="The element specifies a slot attribute value that is not defined by the slot owning component.";const SHORT=DESCRIPT;const SLOT="slot";const TEMPLATE="template";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){return{"<slot=>":this._onSlot}};Rule.prototype._onSlot=function(ruleCtx,slot,slotVal){if(slotVal&&!_isExpr(slotVal)&&ruleCtx.tagNode.name!==TEMPLATE){this._slotAttr(ruleCtx,slotVal)}};Rule.prototype._slotAttr=function(ruleCtx,slotVal){var issue,node;node=getParentNodeForSlot(ruleCtx,slotVal)
|
|
6
|
+
const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-name";const DESCRIPT="The element specifies a slot attribute value that is not defined by the slot owning component.";const SHORT=DESCRIPT;const SLOT="slot";const TEMPLATE="template";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){return{"<slot=>":this._onSlot}};Rule.prototype._onSlot=function(ruleCtx,slot,slotVal){if(slotVal&&!_isExpr(slotVal)&&ruleCtx.tagNode.name!==TEMPLATE){this._slotAttr(ruleCtx,slotVal)}};Rule.prototype._slotAttr=function(ruleCtx,slotVal){var issue,node;if(!(node=getParentNodeForSlot(ruleCtx,slotVal))){issue=new ruleCtx.Issue(`unresolved slot '${slotVal}' on <${ruleCtx.tag}>`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx);return}};function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const getParentNodeForSlot=require(
|
|
6
|
+
const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-pref-content";const DESCRIPT="When component metadata defines 'preferredContent' for a slot, child elements placed into that slot should "+"implement one or more of the requested interfaces and document that through their 'implements' metadata. "+"This rule applies to components that are directly allocated to a slot, or which are direct children "+"of a template allocated to that slot.";const SHORT=DESCRIPT;const IGNORE_TAG=["oj-defer","html","head","body","script"];const TEMPLATE="template";const OJ_SWITCHER="oj-switcher";const OJ_DEFER="oj-defer";const OJ_BIND="oj-bind";const OJ_TOOLBAR="oj-toolbar";const OJ_LABEL="oj-label";const OJ_BIND_SLOT="oj-bind-slot";const DIV="div";const SPAN="span";const TAG="tag";const SLOT="slot";const _isBindTag=tagName=>{return tagName.startsWith("oj-bind")};const _ignoreTag=tagName=>{return IGNORE_TAG.includes(tagName)||tagName.startsWith("oj-bind")};function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;this._hasJetWCInterfaces=this._metaLib.hasJetWCInterfaces();this._utils=regCtx.utils.utils;this._domUtils=regCtx.utils.DomUtils;return{"webcomp":this._onWebComp,"elem":this._onElem}};Rule.prototype._onElem=function(ruleCtx,elemName){if(ruleCtx.utils.DomUtils.isCommonElem(elemName)||elemName===TEMPLATE){if(!_ignoreTag(elemName)){return this._onWebComp(ruleCtx,elemName)}}};Rule.prototype._onWebComp=function(ruleCtx,tagName){var attribs=ruleCtx.tagNode.attribs;var slotx,slotName="";this._slotDefined=false;if(this._utils.hasAnyProps(attribs)){slotx=attribs[SLOT];if(slotx||slotx===""){slotName=slotx;this._slotDefined=true}}this._onSlot(ruleCtx,SLOT,slotName)};Rule.prototype._onSlot=function(ruleCtx,slotAttr,slotName){var pnode,slotTag,psc;if(slotName&&ruleCtx.tagNode.name===OJ_BIND_SLOT){return}if(!(pnode=getParentNodeForSlot(ruleCtx,slotName))){return}if(pnode.name===OJ_SWITCHER||!this._metaLib.isWCTag(pnode.name)){return}if(this._metaLib.isJetTag(pnode.name)&&!this._hasJetWCInterfaces){return}psc=this._metaLib.getPreferredSlotContentEx(pnode.name,slotName);if(!(psc&&psc.interfaces)){return}slotTag=ruleCtx.tag;if(slotTag==="oj-vb-fragment"||slotTag==="oj-module"){return}if(slotTag.startsWith(OJ_BIND)||slotTag===OJ_DEFER||slotTag===TEMPLATE||slotTag===DIV){let child;if(!(child=_getFirstChildTag(ruleCtx.tagNode.children))||!this._isSlotInterfaceSupported(child,psc)){if(child?.name!==SPAN){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,2)}}return}if(ruleCtx.utils.DomUtils.isCommonElem(slotTag)){if(pnode.name!==OJ_TOOLBAR&&ruleCtx.tagNode.name!==SPAN){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,3)}return}if(this._metaLib.isWCTag(slotTag)){if(!_isBindTag(slotTag)&&slotTag!==OJ_DEFER&&slotTag!==TEMPLATE){if(!this._isSlotInterfaceSupported(ruleCtx.tagNode,psc)){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,1)}}}};Rule.prototype._isSlotInterfaceSupported=function(node,psc){var ret,aIfc;if(aIfc=this._metaLib.getInterfaces(node.name)){for(let ifc of aIfc){if(psc.interfaces.includes(ifc)){ret=true;break}}}return ret};Rule.prototype._emitIssue=function(ruleCtx,elemNode,slotName,slotOwner,psci,issueType){var ifc=_list(psci.interfaces,"or");var comp=psci.components?` (e.g. ${_list(psci.components,"or",true)})`:"";var multi=psci.interfaces.length>1;var slotName=slotName?`slot '${slotName}'`:"default slot";var isDefSlot=!slotName;var issue,msg;if(issueType===1){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===2){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but its first child does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===3){msg=`${slotName} on <${elemNode.name}> for <${slotOwner}> cannot provide ${multi?"interfaces":"an interface"} of type ${ifc}${comp}`}else{return}issue=new ruleCtx.Issue(msg);if(this._slotDefined){let attrPos=ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.tagNode,SLOT);ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end)}ruleCtx.reporter.addIssue(issue,ruleCtx)};function _getFirstChildTag(childs){var ret,childs,child;if(childs){for(let i=0;i<childs.length;i++){child=childs[i];if(child.type!==TAG){continue}if(child.name.startsWith("oj-bind-")||child.name===OJ_DEFER||child.name===TEMPLATE){return _getFirstChildTag(child.children)}ret=child;break}}return ret};function _list(a,orand,isComp){var s="";for(let i=0;i<a.length;i++){if(i){if(i===a.length-1){s+=(isComp?">":"'")+" "+orand+" "}else{s+=(isComp?">":"'")+", "}}s+=(isComp?"<":"'")+a[i]}return s?s+=isComp?">":"'":s};module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const getStyles=require("./helpers/extractStylesFromClass");const StyleSelector=require("./helpers/style-selector");const RULE_NAME="oj-html-style";const SHORT="A 'class' style prefixed with 'oj-*' must be valid and applicable to the element on which it is declared";const LONG="A 'class' style prefixed with 'oj-*' must be a known JET style and applicable to the element on which it is declared, or defined in a styleset.";const ch=[">",","];const SS_IGNORE_WILD=["oj-ux-","oj-sample-","oj-typography-"];const SS_IGNORE_LIST=["oj-label","oj-applayout-content","oj-visited","oj-disabled","oj-enabled","oj-read-only","oj-invalid","oj-warning","oj-info","oj-confirmation","oj-required","oj-indeterminate","oj-active","oj-selected","oj-hover","oj-focus","oj-focus-only","oj-focus-highlight","oj-default","oj-draggable","oj-drag","oj-drop","oj-active-drop","oj-valid-drop","oj-invalid-drop","oj-expanded","oj-collapsed","oj-right","oj-center","oj-left","oj-start","oj-end","oj-top","oj-middle","oj-bottom","oj-full-width","oj-hicontrast","oj-component","oj-component-initnode","oj-complete","oj-animate-open","oj-animate-open-active","oj-animate-close","oj-animate-close-active","oj-animate-add","oj-animate-add-active","oj-animate-remove","oj-animate-remove-active","oj-animate-update","oj-animate-update-active"];class Rule{constructor(){this._ignore=null;this._metaLib=null}getName(){return RULE_NAME}getShortDescription(){return SHORT}getDescription(){return LONG}register(regCtx){var customOpts,i;if(regCtx.rulePack.isRuleEnabled("oj-html-stylesel")){return false}if(customOpts=regCtx.ruleOpts.customOpts){if(this._ignore=customOpts.ignore){for(i=0;i<this._ignore.length;i++){this._ignore[i]=new RegExp(this._ignore[i])}}}this._metaLib=regCtx.utils.metaLib;StyleSelector.setAssertMsg(regCtx.utils.msgLib.assert);return{"class":this._onClass}}_onClass(ruleCtx,attrName,attrValue){var tagName,i,j,classes,style,sType;tagName=ruleCtx.tag;classes=getStyles(attrValue);for(i=0;i<classes.length;i++){style=classes[i];if(this._ignore){for(j=0;j<this._ignore.length;j++){if(this._ignore[j].test(style)){break}}if(j<this._ignore.length){continue}}if(_isIgnoreListed(style)){continue}sType=this._metaLib.getStyleOrigin(style);if(!sType){if(style.startsWith("oj-")){if(!this._metaLib.isStylesetStyle(style)){this._emitIssue(1,style,tagName,ruleCtx)}continue}}if(sType==="c"){continue}this._handleStyle(ruleCtx,style,sType)}}_handleStyle(ruleCtx,style,sType){var ss,tags,tagName,i,simple;tagName=ruleCtx.tag;if(sType==="j"||sType==="b"){ss=this._metaLib.getStyleSelector(style,sType==="j"||sType==="b");if(ss){if(StyleSelector.match(ruleCtx,ss)){return true}}else{tags=this._metaLib.getNonSSStyleElems(style,true);if(tags){for(i=0;i<tags.length;i++){if(tags[i]===tagName){return true}}}}}if(sType==="j"){if(ss){simple=_isSimpleElemOrStyle(ss);simple=!simple?3:simple==="e"?5:6;this._emitIssue(simple,style,tagName,ruleCtx,ss)}else if(tags){this._emitIssue(2,style,tagName,ruleCtx,tags)}return false}tags=null;ss=this._metaLib.getStyleSelector(style,false);if(ss){if(StyleSelector.match(ruleCtx,ss)){return true}}if(ss){simple=_isSimpleElemOrStyle(ss);simple=!simple?3:simple==="e"?5:6;this._emitIssue(simple,style,tagName,ruleCtx,ss);return false}return true}_emitIssue(num,style,tag,ruleCtx,extra1,extra2){var msg,ss,i;switch(num){case 1:msg=`Unknown style '${style}' found on <${tag}>`;break;case 2:msg=`'${style}' cannot be applied to <${tag}> - only ${_fmt(num,extra1)}`;break;case 3:if(Array.isArray(extra1)){ss="";for(i=0;i<extra1.length;i++){if(i){ss+=", or "}ss+="'"+extra1[i]+"'"}}else{ss="'"+extra1+"'"}msg=`'${style}' on <${tag}> is not matched by ${ss}`;break;case 5:msg=`'${style}' can only be applied to <${extra1}> - not <${tag}>`;break;case 6:msg=`'${style}' - <${tag}> must also contain style '${extra1.substring(1)}'`;break;case 7:msg=`'${style}' cannot be applied to <${tag}> : no style selector match (${extra1}) and no elem match (${_fmt(num,extra2)})`;break
|
|
6
|
+
const getStyles=require("./helpers/extractStylesFromClass");const StyleSelector=require("./helpers/style-selector");const RULE_NAME="oj-html-style";const SHORT="A 'class' style prefixed with 'oj-*' must be valid and applicable to the element on which it is declared";const LONG="A 'class' style prefixed with 'oj-*' must be a known JET style and applicable to the element on which it is declared, or defined in a styleset.";const ch=[">",","];const SS_IGNORE_WILD=["oj-ux-","oj-sample-","oj-typography-"];const SS_IGNORE_LIST=["oj-label","oj-applayout-content","oj-visited","oj-disabled","oj-enabled","oj-read-only","oj-invalid","oj-warning","oj-info","oj-confirmation","oj-required","oj-indeterminate","oj-active","oj-selected","oj-hover","oj-focus","oj-focus-only","oj-focus-highlight","oj-default","oj-draggable","oj-drag","oj-drop","oj-active-drop","oj-valid-drop","oj-invalid-drop","oj-expanded","oj-collapsed","oj-right","oj-center","oj-left","oj-start","oj-end","oj-top","oj-middle","oj-bottom","oj-full-width","oj-hicontrast","oj-component","oj-component-initnode","oj-complete","oj-animate-open","oj-animate-open-active","oj-animate-close","oj-animate-close-active","oj-animate-add","oj-animate-add-active","oj-animate-remove","oj-animate-remove-active","oj-animate-update","oj-animate-update-active"];class Rule{constructor(){this._ignore=null;this._metaLib=null}getName(){return RULE_NAME}getShortDescription(){return SHORT}getDescription(){return LONG}register(regCtx){var customOpts,i;if(regCtx.rulePack.isRuleEnabled("oj-html-stylesel")){return false}if(customOpts=regCtx.ruleOpts.customOpts){if(this._ignore=customOpts.ignore){for(i=0;i<this._ignore.length;i++){this._ignore[i]=new RegExp(this._ignore[i])}}}this._metaLib=regCtx.utils.metaLib;StyleSelector.setAssertMsg(regCtx.utils.msgLib.assert);return{"class":this._onClass}}_onClass(ruleCtx,attrName,attrValue){var tagName,i,j,classes,style,sType;tagName=ruleCtx.tag;classes=getStyles(attrValue);for(i=0;i<classes.length;i++){style=classes[i];if(this._ignore){for(j=0;j<this._ignore.length;j++){if(this._ignore[j].test(style)){break}}if(j<this._ignore.length){continue}}if(_isIgnoreListed(style)){continue}sType=this._metaLib.getStyleOrigin(style);if(!sType){if(style.startsWith("oj-")){if(!this._metaLib.isStylesetStyle(style)){this._emitIssue(1,style,tagName,ruleCtx)}continue}}if(sType==="c"){continue}this._handleStyle(ruleCtx,style,sType)}}_handleStyle(ruleCtx,style,sType){var ss,tags,tagName,i,simple;tagName=ruleCtx.tag;if(sType==="j"||sType==="b"){ss=this._metaLib.getStyleSelector(style,sType==="j"||sType==="b");if(ss){if(StyleSelector.match(ruleCtx,ss)){return true}}else{tags=this._metaLib.getNonSSStyleElems(style,true);if(tags){for(i=0;i<tags.length;i++){if(tags[i]===tagName){return true}}}}}if(sType==="j"){if(ss){simple=_isSimpleElemOrStyle(ss);simple=!simple?3:simple==="e"?5:6;this._emitIssue(simple,style,tagName,ruleCtx,ss)}else if(tags){this._emitIssue(2,style,tagName,ruleCtx,tags)}return false}tags=null;ss=this._metaLib.getStyleSelector(style,false);if(ss){if(StyleSelector.match(ruleCtx,ss)){return true}}if(ss){simple=_isSimpleElemOrStyle(ss);simple=!simple?3:simple==="e"?5:6;this._emitIssue(simple,style,tagName,ruleCtx,ss);return false}return true}_emitIssue(num,style,tag,ruleCtx,extra1,extra2){var msg,ss,i;switch(num){case 1:msg=`Unknown style '${style}' found on <${tag}>`;break;case 2:msg=`'${style}' cannot be applied to <${tag}> - only ${_fmt(num,extra1)}`;break;case 3:if(Array.isArray(extra1)){ss="";for(i=0;i<extra1.length;i++){if(i){ss+=", or "}ss+="'"+extra1[i]+"'"}}else{ss="'"+extra1+"'"}msg=`'${style}' on <${tag}> is not matched by ${ss}`;break;case 5:msg=`'${style}' can only be applied to <${extra1}> - not <${tag}>`;break;case 6:msg=`'${style}' - <${tag}> must also contain style '${extra1.substring(1)}'`;break;case 7:msg=`'${style}' cannot be applied to <${tag}> : no style selector match (${extra1}) and no elem match (${_fmt(num,extra2)})`;break}if(msg){ruleCtx.reporter.addIssue(new ruleCtx.Issue(msg),ruleCtx)}}};function _isIgnoreListed(style){var ret=false,i;for(i=0;i<SS_IGNORE_WILD.length;i++){if(style.startsWith(SS_IGNORE_WILD[i])){ret=true;break}}if(!ret){ret=SS_IGNORE_LIST.includes(style)}return ret};function _isSimpleElemOrStyle(ss){const COMMA=",";const DOT=".";const SPACE=" ";const GT=">";if(Array.isArray(ss)){if(ss.length===1){ss=ss[0]}else{return null}}ss=ss.trim();if(ss.includes(COMMA)||ss.includes(DOT,1)||ss.includes(SPACE)||ss.includes(GT)){return null}return ss.startsWith(DOT)?"s":"e"};function _fmt(n,extra){if(n===2||n===7){let s="";for(let i=0;i<extra.length;i++){if(i){s+=", ";if(extra.length>=2){if(i===extra.length-1){s+="or "}}}s+="<"+extra[i]+">"}return s}return"<"+extra[0]+">"};module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const getStyles=require("./helpers/extractStylesFromClass");const StyleSelector=require("./helpers/style-selector");const RULENAME="oj-html-stylesel";const SHORT="A 'class' style must be applicable to the element on which it is declared";const LONG="A 'class' style must be a known style and its placement applicable to the element on which it is declared."+" Refer to the component documentation for the style selector defining the placement rules.";const SS_IGNORE_WILD=["oj-ux-","oj-sample-","oj-typography-"];const SS_IGNORE_LIST=["oj-label","oj-applayout-content","oj-visited","oj-disabled","oj-enabled","oj-read-only","oj-invalid","oj-warning","oj-info","oj-confirmation","oj-required","oj-indeterminate","oj-active","oj-selected","oj-hover","oj-focus","oj-focus-only","oj-focus-highlight","oj-default","oj-draggable","oj-drag","oj-drop","oj-active-drop","oj-valid-drop","oj-invalid-drop","oj-expanded","oj-collapsed","oj-right","oj-center","oj-left","oj-start","oj-end","oj-top","oj-middle","oj-bottom","oj-full-width","oj-hicontrast","oj-component","oj-component-initnode","oj-complete","oj-animate-open","oj-animate-open-active","oj-animate-close","oj-animate-close-active","oj-animate-add","oj-animate-add-active","oj-animate-remove","oj-animate-remove-active","oj-animate-update","oj-animate-update-active"];class Rule{constructor(){this._ignore=null;this._metaLib=null}getName(){return RULENAME}getShortDescription(){return SHORT}getDescription(){return LONG}register(regCtx){var customOpts,i;if(customOpts=regCtx.ruleOpts.customOpts){if(this._ignore=customOpts.ignore){for(i=0;i<this._ignore.length;i++){this._ignore[i]=new RegExp(this._ignore[i])}}}this._metaLib=regCtx.utils.metaLib;StyleSelector.setAssertMsg(regCtx.utils.msgLib.assert);return{"class":this._onClass}}_onClass(ruleCtx,attrName,attrValue){var tagName,i,j,dataBindChecked=false,classes,style,sType;tagName=ruleCtx.tag;classes=getStyles(attrValue);for(i=0;i<classes.length;i++){style=classes[i];if(this._ignore){for(j=0;j<this._ignore.length;j++){if(this._ignore[j].test(style)){break}}if(j<this._ignore.length){continue}}if(_isIgnoreListed(style)){continue}sType=this._metaLib.getStyleOrigin(style);if(!sType){if(style.startsWith("oj-")){if(!this._metaLib.isStylesetStyle(style)){this._emitIssue(1,style,tagName,ruleCtx)}continue}}this._handleStyle(ruleCtx,style,sType)}}_handleStyle(ruleCtx,style,sType){var ss,tags,tagName,i;tagName=ruleCtx.tag;if(sType==="c"){if(ss=this._metaLib.getStyleSelector(style)){if(StyleSelector.match(ruleCtx,ss)){return true}this._emitIssueEx(ss,style,tagName,ruleCtx);return false}}if(sType==="j"||sType==="b"){ss=this._metaLib.getStyleSelector(style,sType==="j"||sType==="b");if(ss){if(StyleSelector.match(ruleCtx,ss)){return true}}else{tags=this._metaLib.getNonSSStyleElems(style,true);if(tags){for(i=0;i<tags.length;i++){if(tags[i]===tagName){return true}}}}}if(sType==="j"){if(ss){this._emitIssueEx(ss,style,tagName,ruleCtx)}else if(tags){this._emitIssue(2,style,tagName,ruleCtx,tags)}return false}tags=null;if(ss=this._metaLib.getStyleSelector(style,false)){if(StyleSelector.match(ruleCtx,ss)){return true}}if(ss){this._emitIssueEx(ss,style,tagName,ruleCtx);return false}return true}_emitIssue(num,style,tag,ruleCtx,extra1,extra2){var msg,issue,ss,i;switch(num){case 1:msg=`unknown style '${style}' found on <${tag}>`;break;case 2:msg=`style '${style}' cannot be applied to <${tag}> - only ${_fmt(num,extra1)}`;break;case 3:if(Array.isArray(extra1)){ss="";for(i=0;i<extra1.length;i++){if(i){ss+=", or "}ss+="'"+extra1[i]+"'"}}else{ss="'"+extra1+"'"}msg=`style '${style}' on <${tag}> is not matched by ${ss}`;break;case 5:msg=`style '${style}' can only be applied to <${extra1}> - not <${tag}>`;break;case 6:msg=`style '${style}' - <${tag}> must also contain style '${extra1.substring(1)}'`;break;case 7:msg=`'${style}' cannot be applied to <${tag}> : no style selector match (${extra1}) and no elem match (${_fmt(num,extra2)})`;break
|
|
6
|
+
const getStyles=require("./helpers/extractStylesFromClass");const StyleSelector=require("./helpers/style-selector");const RULENAME="oj-html-stylesel";const SHORT="A 'class' style must be applicable to the element on which it is declared";const LONG="A 'class' style must be a known style and its placement applicable to the element on which it is declared."+" Refer to the component documentation for the style selector defining the placement rules.";const SS_IGNORE_WILD=["oj-ux-","oj-sample-","oj-typography-"];const SS_IGNORE_LIST=["oj-label","oj-applayout-content","oj-visited","oj-disabled","oj-enabled","oj-read-only","oj-invalid","oj-warning","oj-info","oj-confirmation","oj-required","oj-indeterminate","oj-active","oj-selected","oj-hover","oj-focus","oj-focus-only","oj-focus-highlight","oj-default","oj-draggable","oj-drag","oj-drop","oj-active-drop","oj-valid-drop","oj-invalid-drop","oj-expanded","oj-collapsed","oj-right","oj-center","oj-left","oj-start","oj-end","oj-top","oj-middle","oj-bottom","oj-full-width","oj-hicontrast","oj-component","oj-component-initnode","oj-complete","oj-animate-open","oj-animate-open-active","oj-animate-close","oj-animate-close-active","oj-animate-add","oj-animate-add-active","oj-animate-remove","oj-animate-remove-active","oj-animate-update","oj-animate-update-active"];class Rule{constructor(){this._ignore=null;this._metaLib=null}getName(){return RULENAME}getShortDescription(){return SHORT}getDescription(){return LONG}register(regCtx){var customOpts,i;if(customOpts=regCtx.ruleOpts.customOpts){if(this._ignore=customOpts.ignore){for(i=0;i<this._ignore.length;i++){this._ignore[i]=new RegExp(this._ignore[i])}}}this._metaLib=regCtx.utils.metaLib;StyleSelector.setAssertMsg(regCtx.utils.msgLib.assert);return{"class":this._onClass}}_onClass(ruleCtx,attrName,attrValue){var tagName,i,j,dataBindChecked=false,classes,style,sType;tagName=ruleCtx.tag;classes=getStyles(attrValue);for(i=0;i<classes.length;i++){style=classes[i];if(this._ignore){for(j=0;j<this._ignore.length;j++){if(this._ignore[j].test(style)){break}}if(j<this._ignore.length){continue}}if(_isIgnoreListed(style)){continue}sType=this._metaLib.getStyleOrigin(style);if(!sType){if(style.startsWith("oj-")){if(!this._metaLib.isStylesetStyle(style)){this._emitIssue(1,style,tagName,ruleCtx)}continue}}this._handleStyle(ruleCtx,style,sType)}}_handleStyle(ruleCtx,style,sType){var ss,tags,tagName,i;tagName=ruleCtx.tag;if(sType==="c"){if(ss=this._metaLib.getStyleSelector(style)){if(StyleSelector.match(ruleCtx,ss)){return true}this._emitIssueEx(ss,style,tagName,ruleCtx);return false}}if(sType==="j"||sType==="b"){ss=this._metaLib.getStyleSelector(style,sType==="j"||sType==="b");if(ss){if(StyleSelector.match(ruleCtx,ss)){return true}}else{tags=this._metaLib.getNonSSStyleElems(style,true);if(tags){for(i=0;i<tags.length;i++){if(tags[i]===tagName){return true}}}}}if(sType==="j"){if(ss){this._emitIssueEx(ss,style,tagName,ruleCtx)}else if(tags){this._emitIssue(2,style,tagName,ruleCtx,tags)}return false}tags=null;if(ss=this._metaLib.getStyleSelector(style,false)){if(StyleSelector.match(ruleCtx,ss)){return true}}if(ss){this._emitIssueEx(ss,style,tagName,ruleCtx);return false}return true}_emitIssue(num,style,tag,ruleCtx,extra1,extra2){var msg,issue,ss,i;switch(num){case 1:msg=`unknown style '${style}' found on <${tag}>`;break;case 2:msg=`style '${style}' cannot be applied to <${tag}> - only ${_fmt(num,extra1)}`;break;case 3:if(Array.isArray(extra1)){ss="";for(i=0;i<extra1.length;i++){if(i){ss+=", or "}ss+="'"+extra1[i]+"'"}}else{ss="'"+extra1+"'"}msg=`style '${style}' on <${tag}> is not matched by ${ss}`;break;case 5:msg=`style '${style}' can only be applied to <${extra1}> - not <${tag}>`;break;case 6:msg=`style '${style}' - <${tag}> must also contain style '${extra1.substring(1)}'`;break;case 7:msg=`'${style}' cannot be applied to <${tag}> : no style selector match (${extra1}) and no elem match (${_fmt(num,extra2)})`;break}if(msg){issue=new ruleCtx.Issue(msg);ruleCtx.reporter.addIssue(issue.setMsgKey(RULENAME+(num>1?"_"+num:"")),ruleCtx)}}_emitIssueEx(ss,style,tagName,ruleCtx){var simple;simple=_isSimpleElemOrStyle(ss);simple=!simple?3:simple==="e"?5:6;this._emitIssue(simple,style,tagName,ruleCtx,ss)}};function _isIgnoreListed(style){var ret=false,i;for(i=0;i<SS_IGNORE_WILD.length;i++){if(style.startsWith(SS_IGNORE_WILD[i])){ret=true;break}}if(!ret){ret=SS_IGNORE_LIST.includes(style)}return ret};function _isSimpleElemOrStyle(ss){const COMMA=",";const DOT=".";const SPACE=" ";const GT=">";if(Array.isArray(ss)){if(ss.length===1){ss=ss[0]}else{return null}}ss=ss.trim();if(ss.includes(COMMA)||ss.includes(DOT,1)||ss.includes(SPACE)||ss.includes(GT)){return null}return ss.startsWith(DOT)?"s":"e"};function _fmt(n,extra){if(n===2||n===7){let s="";for(let i=0;i<extra.length;i++){if(i){s+=", ";if(extra.length>=2){if(i===extra.length-1){s+="or "}}}s+="<"+extra[i]+">"}return s}return"<"+extra[0]+">"};module.exports=Rule;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2023, 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-tabbar-edge";const DESCRIPTION="Vertical support in <oj-tab-bar> is deprecated in JET 15.0.0 (use <oj-navigation-list> instead). "+"Use of 'edge' property values 'start' or 'end' (or omitting 'edge') is not recommended, and the values 'top' or 'bottom' should be used.";const SHORT="Vertical support in <oj-tab-bar> is deprecated in JET 15.0.0, use 'edge' property values 'top' or 'bottom'";const EDGE="edge";const START="start";const END="end";const MSG_NOEDGE="Vertical support is deprecated (JET 15.0.0) : 'edge' property default value is 'start'. Specify 'top' or 'bottom'. <oj-navigation-list> is suggested for vertical layout.";const MSG_EDGE_START="The 'start' value for 'edge' attribute is not recommended (as of JET 15.0.0). Specify 'top' or 'bottom'. Specify 'top' or 'bottom'. <oj-navigation-list> is suggested for vertical layout.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT}register(){return{"<oj-tab-bar>":this._onTabBar}}_onTabBar(ruleCtx){var edge=ruleCtx.tagNode?.attribs[EDGE];if(!edge){ruleCtx.reporter.addIssue(new ruleCtx.Issue(MSG_NOEDGE),ruleCtx)}else if(edge===START){let issue=new ruleCtx.Issue(MSG_EDGE_START);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,EDGE);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
4
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
5
|
*/
|
|
6
|
-
const RULENAME="oj-html-unsup-theme";const SHORT_DESCRIPTION="Some web component elements and/or their attributes may not be supported in the specified JET theme";const DESCRIPTION=SHORT_DESCRIPTION+". Refer to the JET API documentation for the version being audited. "+"The theme used by the audit can be set by the JAF configuration property 'theme'.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._theme=regCtx.config.theme;this._metaLib=regCtx.utils.metaLib;return{"webcomp":this._onWebComp}}_onWebComp(ruleCtx,tag){var issue,attribs,attrib;if(!this._metaLib.isTagSupportedInTheme(tag)){issue=new ruleCtx.Issue(`<${tag}> is not supported in theme '${this._theme}'`);ruleCtx.reporter.addIssue(issue,ruleCtx)}attribs=ruleCtx.tagNode.attribs;if(attribs){for(attrib in attribs){this._fnAttrib(ruleCtx,attrib)}}}_fnAttrib(ruleCtx,attrib){if(!this._metaLib.isAttrSupportedInTheme(ruleCtx.tag,attrib)){let issue,attrPos;issue=new ruleCtx.Issue(`<${ruleCtx.tag}> attribute '${attrib}' is not supported in theme '${this._theme}'`);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=Rule;
|
|
6
|
+
const RULENAME="oj-html-unsup-theme";const SHORT_DESCRIPTION="Some web component elements and/or their attributes may not be supported in the specified JET theme";const DESCRIPTION=SHORT_DESCRIPTION+". Refer to the JET API documentation for the version being audited. "+"The theme used by the audit can be set by the JAF configuration property 'theme'.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._theme=regCtx.config.theme;this._metaLib=regCtx.utils.metaLib;return{"webcomp":this._onWebComp}}_onWebComp(ruleCtx,tag){var issue,attribs,attrib;if(!this._metaLib.isTagSupportedInTheme(tag)){issue=new ruleCtx.Issue(`<${tag}> is not supported in theme '${this._theme}'`);ruleCtx.reporter.addIssue(issue,ruleCtx)}attribs=ruleCtx.tagNode.attribs;if(attribs){for(attrib in attribs){this._fnAttrib(ruleCtx,attrib)}}}_fnAttrib(ruleCtx,attrib){if(!this._metaLib.isAttrSupportedInTheme(ruleCtx.tag,attrib)){let issue,attrPos;issue=new ruleCtx.Issue(`<${ruleCtx.tag}> attribute '${attrib}' is not supported in theme '${this._theme}'`);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
|