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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tokens-studio/configs

v0.2.3

Published

The official configs for Tokens Studio, such as Prettier, ESLint, TSConfig etc.

Downloads

773

Readme

Configs

This repository contains the default Tokens Studio configs for developing in TypeScript, whether that's Node or Browser:

  • ESLint config for v9 -> @tokens-studio/configs/eslint
  • Prettier config for v3 -> @tokens-studio/configs/prettier
  • TypeScript config for v5 -> @tokens-studio/configs/typescript

Important: ESLint v9 has quite a lot of breaking changes because it's using the "flat config", see migration guidelines.

You may get a warning for ESLint's React auto detect version setting, because React may not be installed. Since the React specific rules are only relevant when you are using this in a React project, don't worry about the warning if you're not.

ESLint extend

We use ESLint v9 Flat config, which is the modern way to use, extend and share ESLint.

We are currently stuck with CJS config because of react and react-hooks plugins being CJS-only.

const studioConfig = require('@tokens-studio/configs/eslint');

module.exports = [
	...studioConfig,
	{
		rules: {
			// overrides here
		},
	},
];

Prettier extend

There is almost no valid reason for extending our Prettier settings. Please discuss changing our settings with the rest of the team first.

If you absolutely must for some reason, make sure to provide a comment as to why:

import sharedConfig from '@tokens-studio/configs/prettier';

export default {
	...sharedConfig,
	// absolutely needed in this project because the JS parser does not support semicolons
	semi: false,
};

Read more about Prettier's philosophy, in a nutshell its goal is to avoid pointless discussions about subjective taste about code formatting, which is why it's best to "just pick something" and go auto-pilot from there.

The reason we override the useTabs and singleQuotes is because it has objective benefits with regards to working with HTML attributes (uses double quotes) inside JS files (templating) and tabs has major a11y benefits and allows developers to standardize the tabs yet have their editors change the tab display width to their preference.

TSConfig extend

{
	"$schema": "https://json.schemastore.org/tsconfig",
	"extends": "@tokens-studio/configs/typescript"
}

Peer Dependencies

These configs rely on various dependencies e.g. the ESLint config contains plugins / rules configurations that rely on dependencies. They have been configured as peerDependencies, latest NPM should install those by default if missing, but allow to easily use compatible local installations if you have those.

It is recommended to explicitly add eslint, prettier and typescript as devDependencies if you use their binaries in your package, this is less "magic" than relying on the fact that NPM happens to install peerDependencies when they are missing.