Configuring code linting in ServiceNow

Recently, Pathways has been working to update our coding standards and establish a new code review process internally.
In the search for tools to aid us, we came across a great new feature in the New York release of ServiceNow: customizable linting for the script editor. A more detailed explanation of linting can be found at the preceding link, but, to summarize, a linter analyzes source code for programming or stylistic errors based on a set of predefined rules.
This feature can be modified by editing the glide.ui.syntax_editor.linter.eslint_config system property.

There are several baseline options configured, and nearly all options listed on the website for esLint, a popular JavaScript linter, can be implemented in ServiceNow.

 

An example of the above highlighted rule being applied:

 

 

*We recommend implementing this first in a sandbox or developer instance, as you may find some of ServiceNow’s baseline functions and wrappers do not align with your selected linting options, leading to frustration from your development team with excessive warnings\errors that would be encountered when editing these scripts.*

Michael James

Director of Practice - AI Solutions and ServiceNow Certified Technical Architect

Mike helps clients achieve their business objectives by helping architect and develop outcome-based AI solutions using the ServiceNow platform. With the ever-growing AI offerings provided by ServiceNow, Mike is responsible for making sure clients have the appropriate solution to help modernize and revolutionize their business as well as advising on leading practices and implementations.
 
In his spare time, Mike enjoys spending time with his family and following sports, especially Penn State athletics.

Learn how Pathways Consulting Group can work for you

Connect with a ServiceNow Expert

Contact Us

Name