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

@disceomnes/eslint-config-base

v1.2.3

Published

Sharable eslint config with strict rules (limited formatting)

Downloads

23

Readme

Sharable eslint config with strict rules (limited formatting)

Links

Semver

  • Patch version is incremented when existing rule is changed but eslint version is the same
  • Minor version is incremented when config is updated to make use of new eslint rules or options. eslint dependency is also updated
  • See eslint semver policy

Main features

  • Rules are based on eslint version 8.21
  • Most rules are configured in the strictest way possible with some exceptions
  • Some rules are configured as warnings where a possible use case exists or when they are often broken during development
  • Strict mode errors are checked for
  • Most formatting rules are disabled
    • Some rules still conflict with prettier, notably no-mixed-operators
    • This config is meant to be used with dprint as formatter

Code smells

  • Maximum cyclomatic complexity is 3
  • Maximum nesting depth is 3
  • Maximum number of lines in a file is 300 (excluding empty lines & comments)
  • Maximum number of lines in a function is 50 (including empty lines & comments)
  • Maximum number of params in a function is 4
  • Maximum number of statements in a function is 20

Strictness

  • Variable initialization is required
  • Bitwise operators are forbidden
  • eval is forbidden
  • Short-hand type conversions are forbidden except for !! and +
  • Magic numbers are forbidden (except for basic integers such as 1)
  • Nested ternaries are allowed
  • Shadowing variables is forbidden
  • Explicit usage of undefined is forbidden (prefer null)
  • var keyword is forbidden so its associated rules are disabled
  • Constant assignment is preferred
  • A number of regex strictness rules are applied

Style rules

  • camelCase is enforced for variable names
  • Some non-specific variable names (e.g. res) are discouraged
  • Unused variables must be prefixed with _
  • Variable & property name length should not exceed 30 characters
  • comments are uncapitalized
  • Each variable declaration requires a separate keyword
  • Curly braces can be omitted after control statements if body is a single statement on the same line (if (foo) return)
  • Function expressions are forbidden (prefer function declarations)
  • Callbacks as arrow functions are preferred
  • Object destructuring is preferred
  • Imports are sorted
  • Object keys are sorted if there are more than 10 of them (empty lines can be used to reset sorting)
  • Blank lines are required between certain statement (e.g. before throw)