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

jscsrc-guesser

v0.5.0

Published

Determine the JSCS ruleset some code currently follows

Downloads

3

Readme

jscsrc-guesser – JSCS configuration guesser

jscsrc-guesser is a tool that checks some code base and finds those JSCS rules the code base follows.

This version emits rules for JSCS 2.2.*.

Installation

$ npm install -g jscsrc-guesser

Usage

Just run jscsrc-guesser with your code path(s) as argument(s):

$ jscsrc-guesser bin/ lib/ tests/ > autogenerated.jscsrc

You can also pass some optional arguments you could pass to jscs:

$ jscsrc-guesser --esnext index.js > autogenerated.jscsrc

Known limitations

  • disallowSpaceBeforeSemicolon is not tried with allExcept values
  • requireNamedUnassignedFunctions is not tried with allExcept values
  • requireSpacesInsideArrayBrackets is not tried with allExcept values
  • requireSpacesInsideObjectBrackets is not tried with allExcept values
  • validateCommentPosition is not tried with allExcept values
  • requireCapitalizedComments is only tried with value true
  • requireOperatorBeforeLineBreak is only tried with value true
  • disallowOperatorBeforeLineBreak is only tried with value true
  • disallowMultipleVarDecl is only tried with value true
  • disallowSpaceAfterObjectKeys is only tried with value true
  • disallowCommaBeforeLineBreak is only tried with value true
  • requirePaddingNewlinesInBlocks is only tried with value true
  • disallowNewlineBeforeBlockStatements is only tried with value true
  • requireNewlineBeforeBlockStatements is only tried with value true
  • disallowSpacesInsideParentheses is only tried with value true
  • requireSpacesInsideParentheses is only tried with value all
  • safeContextKeyword is only tried for value _this and self
  • maximumNumberOfLines is only tried with a fixed set of values (50, 100, 200, 500, 1000, 2000)
  • maximumLineLength is only tried with a fixed set of values (72, 75, 80, 90, 100, 120) and neither tab size nor exceptions
  • requireSpaceBeforeBlockStatements is only tried with a fixed set of values (1, 2, 3, 4, 5)
  • requireBlocksOnNewline is only tried with a fixed set of minimum lines (0, 1, 2, 3, 4, 5)
  • validateParameterSeparator is only tried with a fixed set of values (',', ' ,', ', ')
  • validateIndentation is not tried with all valid configurations
  • validateNewlineAfterArrayElements is not tried with all valid configurations
  • jsDoc is not tried at all

Changelog

0.5.0 (2015-12-15)

  • Update to JSCS 2.2.*

0.4.0 (2015-12-02)

  • Update to JSCS 2.1.1

0.3.0 (2015-11-29)

  • Fix JSCS invocation by setting maxErrs to Infinity
  • Update to JSCS 2.0

0.2.0 (2015-11-20)

  • Don't include contradictory rules
  • Better handling of validateIndentation, maximumLineLength, requireAlignedObjectValues, validateLineBreaks, validateParameterSeparator
  • Update to JSCS 1.13

0.1.1 (2015-04-25)

  • Fix JSCS invocation
  • Show errors emitted by JSCS
  • Add JSCS check to npm test pipeline

0.1.0 (2015-04-22)

  • Initial version.

Todo

Fixes

  • Handle all different possible values for all rules
  • Fold multi-value options back to true

Features

  • Emit YAML
  • Compare to presets or existing .jscsrc, jscs.json or .jscs.yaml file
  • Sort rules in output alphabetically
  • Add i18n
  • Check which rules checked successfully instead of which rules didn't fail
  • Handle rules which failed rarely (for example by interactively proposing to add them to the output)

License

AGPL