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

@ryanatkn/eslint-config

v0.1.2

Published

an ESLint config for TypeScript, Svelte, and Prettier

Downloads

780

Readme

@ryanatkn/eslint-config

an ESLint config for TypeScript, Svelte, and Prettier

npm i -D @ryanatkn/eslint-config

This ESLint config is designed to complement TypeScript and Prettier, so all redundant rules are disabled. It extends no other configs, so wysiwyg in index.cjs.

To distinguish linting problems from type errors while editing, all of the rules are set to warn, not error, and users are expected run eslint --max-warnings 0 to treat them as errors when desired. There may be a better way to do this, but it works well to get yellow squigglies in text editors for linting problems while reserving red for type errors.

Got questions or proposed changes? Open issues!

setup

Install ESLint dev dependencies with TypeScript and Svelte plugins:

npm i -D eslint \
	@typescript-eslint/eslint-plugin @typescript-eslint/parser \
	eslint-plugin-svelte \
	@ryanatkn/eslint-config

Then add the following to your project's package.json or an ESLint config file:

{
	// ...package.json stuff
	"eslintConfig": {
		"root": true,
		"extends": "@ryanatkn"
	}
}

vscode setup

To make the VSCode ESLint plugin work with Svelte, add the following to VSCode's settings.json:

{
	// ctrl+shift+P then `> Preferences: Open Settings (JSON)`
	// ...other config
	"eslint.validate": ["svelte", "javascript", "javascriptreact"]
}

See also the eslint-plugin-svelte integrations docs.

overrides

Every ESLint config has opinions. This project is somewhat strict, because it's easier to disable rules than it is to enable ones that are invisibly disabled, but we don't want it to be too opinionated. We're happy to discuss proposed changes in the issues, and to override any defaults, use the rules property in your config:

{
	"eslintConfig": {
		"root": true,
		"extends": "@ryanatkn",
		"rules": {
			"no-param-reassign": 0, // disable an enabled rule
			"no-console": 1 // enable a disabled rule
		}
	}
}

features

One useful opt-in feature is implemented with the following:

'no-warning-comments': [1, {terms: ['todo block']}],

This can be used to leave notes to yourself while you develop a set of changes, and combined with CI, you'll be blocked from merging until they're all resolved:

// TODO BLOCK
// TODO BLOCK do the thing
// todo block is case insensitive

develop

See index.cjs and the ESLint docs.

Rules are current through [email protected] and @typescript-eslint/[email protected].

publish

This repo uses changesets:

changeset # add a changeset
changeset version # when ready to publish
changeset publish
git add .
git commit -am vX.Y.Z
git push
git push --tags

See the official docs for npm version and npm publish.

credits 🐢🐢🐢

ESLint@typescript-eslint/eslint-plugineslint-plugin-svelteTypeScriptSveltePrettier & more

license 🐦

public domain ⚘ The Unlicense