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

@gp-technical/stack-pack-standard

v3.1.0

Published

Linting and formatting for the GP Stack

Downloads

61

Readme

stack-pack-standard

Provides tooling to support linting and formatting of GP Stack code.

Currently linting is done using the standard package and formatting uses prettier but this should not be relied on.

stack-pack-standard should be added as a dev dependency in all Stack packages and applications. The following should be added to the application's package.json:

"scripts": {
  "lint": "sp-lint",
  "precommit": "sp-lint-staged"
}

The functionality within stack-pack-standard will then be accessible from the command line via:

yarn lint

Or to invoke autofix on the linting errors use:

yarn lint --fix

Used in this way all errors that can be fixed by the tooling are fixed and the changed files are staged.

If you only want to lint certain parts of a package you can specify files or directories on the command line. Initial versions of stack-pack-standard just passed the arguments through but standard-engine expects globs which meant that using something like: yarn lint foo/bar/ resulted in nothing happening because the directory expanded to itself (not any files within the directory). This makes sense glob-wise but isn't what you might expect when you issued the command. To make things less unexpected directories passed in on the command line are now converted into globs like: foo/bar/**/*.{js,jsx}. This should result in all JavaScript files in and under the specified directory being linted which seems more useful behaviour.

The precommit script means that every file involved in a git commit will be run through the same linting and formatting (if its file type matches). Errors will abort the commit leaving the files staged.

One point to watch out for when committing is that commits made on partial files (staging chunks using git add -p) will result in the whole file being formatted. This is a known limitation of lint-staged (the package that stack-pack-standard uses to implement the precommit hook).

As well as being invoked from the command line and via precommit hooks the Atom editor (and probably others but I've only looked at Atom) can be configured to use stack-pack-standard's linting and formatting. Assuming that you already have linting enabled (via the linter package) you then need to install the linter-js-standard-engine package (https://atom.io/packages/linter-js-standard-engine) and configure it via package.json within your application as:

"standard-engine": "@gp-technical/stack-pack-standard"

You don't need to use Atom's prettier package to format Javascript files when using stack-pack-standard in this way. However you might want to use prettier to format other file types. To do this you need to override prettier's keybinding (the default one is shown below) only for Javascript files (but for both standard Javascript and JSX files):

'atom-text-editor[data-grammar="source js jsx"]:not([mini])':
  'ctrl-alt-f': 'Standard Engine:Fix File'

In-Atom auto-fixing can now be configured to happen on file save. To do this you need to install the Atom save-commands package (https://atom.io/packages/save-commands) plus stack-pack-standard >= 3.2.5. Save-commands uses a config file (save-commands.json) to determine the commands to be run on file save. Stack-pack-standard will (should!) install a sym link to this file when installed. It's probably wise to set save-commands to only show its console output if something goes wrong. To do this use the settings within save-commands.

Once the config file is present at the package root and save-commands is installed auto-fixing of JavaScript files should happen automatically on file save. In addition other files types will be automatically prettified on save (so if you have the prettier package installed you should probably not have it self to format on save to avoid potential conflicts).