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

better-coding-script

v3.0.0

Published

A set of scripts to run in JavaScript and Typescript projects to easily parse your code through ESLint recommended rules and prettier. It also has specific rules for React projects (both JSX and TSX).

Downloads

13

Readme

Better Coding Script

npm version Codacy Badge

This package is a set of scripts to run in JavaScript and Typescript projects to parse your code easily through ESLint recommended rules and prettier. It also has specific rules for React projects (both JSX and TSX).

This is the initial idea, and I have already been using it for a long list of projects, so, decided to share it with the community.

Installation

npm install better-coding-script --save-dev

or

yarn add better-coding-script --dev

You can also install the package globally (-g) to run it in any project without adding a new dependency!

Style Guide

It uses an automatic code formatter called Prettier. Run bcs prettier after making any changes to the code.

Then, our linter will catch most issues that may exist in your code. You can check the status of your code styling by simply running bcs linc.

However, there are still some styles that the linter cannot pick up. If you are unsure about something, looking at Airbnb’s Style Guide will guide you in the right direction.

Usage

The main command is better-coding-script but there is a short/alias as bcs

npx better-coding-script <command> <option>

Or add a script to your packages.json

"command": "bcs <command> <option>"

API

lint       run ESLint for all files in the project (add --fix to apply the fixes)
linc       run ESLint for modified files only in the project (add --fix to apply the fixes)
prettier   run Prettier check for all files in the project
           Additional Options:
              check-changed    run Prettier check for modified files only in the project
              write            run Prettier and fix styling for all files in the project
              write-changed    run Prettier and fix styling for modified files only in the project

Using each command

  • bcs lint: run ESLint for all files in the project
  • bcs lint --fix: run ESLint for all files and fix the code when possible in the project
  • bcs linc: run ESLint for modified files only in the project
  • bcs linc --fix: run ESLint for modified files only and fix the code when possible in the project
  • bcs prettier: run Prettier check for all files in the project
  • bcs prettier check-changed: run Prettier check for modified files only in the project
  • bcs prettier write: run Prettier and fix styling for all files in the project
  • bcs prettier write-changed: run Prettier and fix styling for modified files only in the project
  • bcs -h: show list of commands
  • bcs -v: show version

ESLINT in your project

Create a file called .eslintrc.js and add the following content

module.exports = {
  extends: [require.resolve('better-coding-script')],
};

Other points

Code of Conduct

I decided to adopted (as Facebook) the [Contributor Covenant]https://www.contributor-covenant.org/) as our Code of Conduct, and we expect project participants to adhere to it. Please read the full text so that you can understand what actions will and will not be tolerated.

Semantic Versioning

Better Coding Script follows semantic versioning. We release patch versions for critical bugfixes, minor versions for new features or non-essential changes, and major versions for any breaking changes.

Branch Organization

Submit all changes directly to the master branch. We don’t use separate branches for development or for upcoming releases. We do our best to keep master in good shape, with all tests passing.