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

@voxpelli/eslint-config

v22.0.0

Published

My personal ESLint config. Based on neostandard

Downloads

5,239

Readme

@voxpelli/eslint-config

npm version npm downloads neostandard javascript style Follow @voxpelli@mastodon.social

My personal ESLint config – a superset of the neostandard base config that I co-created and co-maintain.

This config contains a couple of more opinionated checks that I find helpful in my projects.

Install

To easily install correct peer dependencies, you can use install-peerdeps:

install-peerdeps --dev @voxpelli/eslint-config

Usage

Add an eslint.config.js (or eslint.config.mjs if your project is CJS) that exports this config:

export { default } from '@voxpelli/eslint-config';

If you need to configure something, instead do:

import { voxpelli } from '@voxpelli/eslint-config';

export default voxpelli({
  cjs: true,     // Ensures the config has rules fit for a CJS context rather than an ESM context
  noMocha: true, // By standard this config expects tests to be of the Mocha kind, but one can opt out
});

You can also do custom extensions:

import { voxpelli } from '@voxpelli/eslint-config';

export default [
  ...voxpelli({
    // Config options
  }),
  {
    // Custom ESLint config
  },
];

How does this differ from pure neostandard?

  • :stop_sign: = changed to error level
  • :warning: = changed to warn level
  • :mute: = deactivated
  • :wrench: = changed config

:wrench: Changed neostandard rules

  • :wrench: @stylistic/comma-danglechanged – set to enforce dangling commas in arrays, objects, imports and exports
  • :wrench: no-unused-varschanged – sets "args": "all", "argsIgnorePattern": "^_", because I personally don't feel limited by Express error handlers + wants to stay in sync with TypeScript noUnusedParameters

:heavy_plus_sign: Added ESLint core rules

  • :warning: func-style – disallows function declarations, good to be consistent with how functions are declared
  • :warning: no-console – warns on existence of console.log and similar, as they are mostly used for debugging and should not be committed
  • :stop_sign: no-constant-binary-expression – errors when binary expressions are detected to constantly evaluate a specific way
  • :stop_sign: no-nonoctal-decimal-escape – there's no reason not to ban it
  • :stop_sign: no-unsafe-optional-chaining – enforces one to be careful with .? and not use it in ways that can inadvertently cause errors or NaN results
  • :warning: no-warning-comments – warns of the existence of FIXME comments, as they should always be fixed before pushing
  • :stop_sign: object-shorthand – requires the use of object shorthands for properties, more tidy

:package: Added ESLint rule packages

:wrench: Overrides of added ESLint rule packages

:heavy_plus_sign: Additional standalone ESLint rules

  • :stop_sign: @stylistic/quote-props – requires properties to be quoted when needed but otherwise disallows it

  • :warning: es-x/no-exponential-operators – disallows the use of the ** operator, as that's in most cases a mistake and one really meant to write *

ESM specific rules

Unless one configures cjs: true these additional rules will be applied:

:wrench: Overrides of rules

  • :warning: func-style – enforces function declarations whenever an arrow function isn't used. Better to do export function foo () { than export const foo = function () {
  • :stop_sign: unicorn/prefer-modulechanged – restored to its plugin:unicorn/recommended value of error

Can I use this in my own project?

You may want to use neostandard instead, it's the general base config that I help maintain for the community.

I do maintain this project though as if multiple people are using it, so sure, you can use it, but its ultimate purpose is to support my projects.

I do follow semantic versioning, so the addition or tightening of any checks will trigger major releases whereas minor and patch releases should only ever have relaxation of rules and bug fixes.

Alternatives

See also