npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hrax/eslint-plugin-now-best-practices

v0.0.2

Published

ESLint plugin to cover some of the Service Now Best Practices

Downloads

25

Readme

ServiceNow Best Practices ESLint Plugin Test

Set of Service Now technical best practice rules to highlight common errors that occur during development of Service Now applications.

This plugin is not a replacement for tools such as QualityClouds or other PMD tools.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install @hrax/eslint-plugin-now-best-practices:

$ npm install @hrax/eslint-plugin-now-best-practices --save-dev

Usage

Add @hrax/now-best-practices to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "@hrax/now-best-practices"
    ]
}

Rules

Add rule to the rules section of your .eslintrc configuration file.

{
    "rules": {
        "@hrax/now-best-practices/rule-name": 2
    }
}

| Rule name | Category | Description | | ------------------------ | -------------- | ----------- | | gslog-source | Best Practices | Enforce use of gs.log calls with 2 arguments | no-dotwalk-ref-id | Best Practices | Disallow dot-walking to the sys_id of reference field | no-encoded-query-literal | Strict Mode | Enforce use of GlideRecord.addEncodedQuery calls without hardcoded literals | no-encoded-query | Strict Mode | Disallow use of GlideRecord.addEncodedQuery calls | no-gslog | Strict Mode | Disallow use of gs.log calls | no-gsprint | Strict Mode | Disallow use of gs.print calls | no-gssql | Strict Mode | Disallow use of gs.sql calls | no-hardcoded-id | Best Practices | Disallow hardcoded Sys ID in Literals | no-rowcount | Best Practices | Disallow use of GlideRecord.getRowCount calls | no-synchronous-glideajax | Best Practices | Disallow use of of synchronous GlideAjax.getXMLWait and GlideAjax.getAnswer calls

Configurations

Add configuration to the extends section of your .eslintrc configuration file.

{
  "extends": ["plugin:@hrax/now-best-practices/configuration-name"]
}

recommended Configuration

| Rule name | Reports as | ------------------------ | ----------------------- | gslog-source | warning | no-dotwalk-ref-id | warning | no-encoded-query-literal | warning | no-gsprint | error | no-gssql | error | no-hardcoded-id | error | no-rowcount | error | no-synchronous-glideajax | warning

strict Configuration

| Rule name | Reports as
| ------------------------ | ----------------------- | no-dotwalk-ref-id | error | no-encoded-query | error | no-gslog | error | no-gsprint | error | no-gssql | error | no-hardcoded-id | error | no-rowcount | error | no-synchronous-glideajax | error

Environments

Add environment to the env section of your .eslintrc configuration file.

{
  "env": {
    "@hrax/now-best-practices/environment-name": true
  }
}

snow-server Environment

Service Now environment to register "common" server global variables available within Service Now platform.

| Global | Writable | References | ------------------------ | --------- | -------------- | global | false | Service Now global application scope | current | false | currently edited GlideRecord | previous | false | previous version of currently edited GlideRecord | action | false | type of current action | gs | false | global GlideSystem shortcut | Class | false | global Service Now Class implementation | AbstractAjaxProcessor | false | AJAX processor base class (Quebec) | GSLog | false | GSLog (Quebec) | GlideRecord | false | GlideRecord (Quebec) | GlideAggregate | false | GlideAggregate (Quebec) | GlideElement | false | GlideElement (Quebec) | GlideDateTime | false | GlideDateTime (Quebec) | GlideFilter | false | GlideFilter (Quebec) | GlideSchedule | false | GlideSchedule (Quebec) | GlideRecordUtil | false | GlideRecordUtil (Quebec) | JSUtil | false | JSUtil (Quebec) | ArrayUtil | false | ArrayUtil (Quebec) | DurationCalculator | false | DurationCalculator (Quebec) | j2js | false | j2js (Quebec) | JSON | false | JSON (Quebec) | JSONParser | false | JSONParser (Quebec) | g_scratchpad | false | variable for GlideFormScratchpad (Quebec)

snow-client Environment

Service Now environment to register "common" client global variables available within Service Now platform.

| Global | Writable | References | ------------------------ | --------- | -------------- | g_menu | false | variable for GlideMenu | g_item | false | variable for GlideMenu | g_list | false | variable for GlideList2 | g_form | false | variable for GlideForm (Quebec) | g_scratchpad | false | variable for GlideFormScratchpad (Quebec) | g_user | false | variable for GlideUser | GlideAjax | false | client GlideAjax (Quebec) | GlideDialogWindow | false | client GlideDialogWindow (Quebec) | GlideList2 | false | client GlideList2 (Quebec) | GlideMenu | false | client GlideMenu (Quebec) | GlideUser | false | client GlideUser (Quebec)

snow-sp Environment

Service Now environment to register "common" service portal global variables available within Service Now platform.

| Global | Writable | References | ------------------------ | --------- | -------------- | data | true | server variable in Service Portal | input | false | server variable in Service Portal | angular | false | server variable in Service Portal | $sp | false | server variable in Service Portal | spUtil | false | server variable in Service Portal | g_service_catalog | false | server variable in Service Portal | g_list | false | server variable in Service Portal | g_form | false | server variable in Service Portal | GlideAjax | false | server variable in Service Portal | GlideRecord | false | server variable in Service Portal