@admc.com/eslint-plugin-sn
Version:
ESLint plugin for ServiceNow scriptlets
33 lines (25 loc) • 1.56 kB
Plain Text
Make new conversational alt(s) for catalog client scripts.
Move the curly rules to this one.
Give it its own global list and support only es5.
Reject setAbortAction in on-Before BRS.
Difficulty of this is, BR-trigger-type is not an input, so would have to do major
work on invocation, data-typing, and integration with higher-level apps.
Support fields:
sys_variable_value.value with document==sys_atf_step + variable.element==script
+ variable.model.name=='Run Server Side Script'
.variable isa sys_atf_variable isa var_dictionary
.model isa step-config
In 'Show XML' this is a nested <sys_variable_value> with .variable as above.
All the nested sys_variable_values are linked by svv.document=sys_atf_step + document_key=step-sid
Update rules for the ESLint API changes coming in version 9.0.0.
Search for sys_ux*.*script* sys_dictionaries to see if any other important ones.
user_criteria.script if advanced==true then: assign' answer' or eval bool like acl.
Don't use 'current', 'gs.getUser()', gs.getUserID(); so use user_id (a sys_id)
sys_ui_context_menu .condition, .dynamic_actions_script (server-side), .on_show_script, .action_script
Fork or enhance "mergeEslintHtml.js" to take input HTML strings instead of files.
Then snLint can support multiple HTML files directly.
Add fix capabilities
Consider how to implement these rules.
Most straight-forward would be to allow trigger-type-specific altscopes.
No insert/update in Before sys_scripts
No other-GR insert/update in Before sys_transform_scripts