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

eslint-plugin-strk

v1.0.0

Published

Custom ESLint rules for Sitetracker development standards and best practices

Readme

eslint-plugin-strk

Custom ESLint rules for Sitetracker development standards and best practices.

Quick Setup

1. Install the plugin

npm install --save-dev eslint-plugin-strk

2. Update your ESLint configuration

For Lightning Web Components (most common):

Edit your .eslintrc.json file in your LWC directory (e.g., force-app/main/default/lwc/.eslintrc.json):

{
  "extends": ["@salesforce/eslint-config-lwc/recommended"],
  "plugins": ["strk"],
  "rules": {
    "strk/early-exit": "error",
    "strk/no-label-literal": "error",
    "strk/no-async-connectedcallback": "error",
    "strk/no-empty-object-init": "error",
    "strk/require-mocks-import": "error",
    "strk/require-apex-mocks-centralization": "error",
    "strk/no-component-mock-in-tests": "error",
    "strk/require-leading-comment-for-jest": "error"
  },
  "overrides": [
    {
      "files": ["*.test.js"],
      "rules": {
        "@lwc/lwc/no-unexpected-wire-adapter-usages": "off"
      },
      "env": {
        "node": true
      }
    }
  ]
}

3. Verify it's working

Run ESLint on a file to confirm the rules are active:

npx eslint your-file.js

You should see Sitetracker-specific linting errors if any of the rules are violated.

VS Code Setup (Red Squiggles)

To see ESLint errors as red squiggles in VS Code:

Required Extensions

  • ESLint (dbaeumer.vscode-eslint) - Shows linting errors in real-time
  • Salesforce Extension Pack (salesforce.salesforcedx-vscode) - For LWC support

Setup Steps

  1. Install extensions from VS Code marketplace
  2. Install the plugin (step 1 above)
  3. Restart VS Code
  4. Test with sample code:
// This should show red squiggles:
const obj = {}; // Violates strk/no-empty-object-init

// This should also show red squiggles:
if (someCondition) {
    doSomething();
}
// No else or early return - violates strk/early-exit

Verification

  • Red squiggles should appear under violating code
  • Problems panel (Cmd+Shift+M) shows Sitetracker-specific errors
  • Auto-fix on save available for some rules

VS Code Troubleshooting

No red squiggles?

  • Check "ESLint: Show Output Channel" in Command Palette
  • Reload VS Code window: "Developer: Reload Window"
  • Verify file paths match: src/main/default/lwc/ or 2gp-packages/*/force-app/main/default/lwc/

Configuration Notes

  • Rule severity: All rules are set to "error" by default. You can change them to "warn" if preferred.
  • Selective rules: You can enable only specific rules by removing unwanted ones from the rules section.
  • Rule documentation: Each rule links to our Development Standards when violated.

Troubleshooting

"Plugin not found" error?

  • Ensure you've installed the plugin: npm install --save-dev eslint-plugin-strk

Rules not working?

  • Check your ESLint config syntax with: npx eslint --print-config your-file.js
  • Ensure your files match the patterns ESLint is checking

Updates

When new versions are released, update with:

npm update eslint-plugin-strk

For detailed information about Sitetracker development standards: Development and Test Standards