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

@batterii/eslint-config-vurvey-node

v0.4.0

Published

ESLint configuration for Vurvey Node.js projects

Downloads

21

Readme

@batterii/eslint-config-vurvey-node

Contains ESLint configuration for Vurvey Node.js projects. This configuration extends base configurations located in @batterii/eslint-config-vurvey.

Usage

To use this config, first install it and its peer dependencies as dev dependencies. Then, create a file called .eslintrc.yaml at the root of the repository with the following contents:

extends: "@batterii/eslint-config-vurvey-node"

Finally, create scripts in your package.json for running the linter:

{
	"scripts": {
		"lint": "eslint . --ext .ts",
		"lintfix": "eslint . --ext .ts --fix"
	}
}

Running these scripts will lint all files in the repo with a .ts extension.

If needed on a per-project basis, you can make changes to the configuration within the .eslintrc.yaml file. As a general rule, however, shareable configuration should be preferred to help ensure code style consistency between different repositories.

Modules

This package contains three modules, described below. For simplicity and for ESLint support, they are written as CommonJS modules in plain JavaScript.

base.js

This module contains the base config for Node.js projects, which extends the base config from @batterii/eslint-config-vurvey. Unless modified by a derived config, rules in this config will be enforced for all .ts files in Vurvey Node.js projects.

test.js

This module contains overrides which are applied to the main config for linting automated test files with .test.ts or .spec.ts extensions, mostly relaxing rules from the main config instead of adding more restrictions. This is because such test code has a different purpose than production-ready code, so we need not be as strict with it.

This test config extends the test config from @batterii/eslint-config-vurvey. It does not extend the main config from this package or the base config from @batterii/eslint-config-vurvey. This allows us to apply them as overrides without duplicating our config inheritance path, which otherwise could cause some annoying or unpredictable behavior.

index.js

This module extends base.js and adds the overrides from test.js for files with the .test.ts and .spec.ts extensions. It is the file which is used when referencing @batterii/eslint-config-vurvey-node in our Node.js projects. For organizational purposes, it should not be changed to contain any rule definitions of its own. It should also not be extended by other configs.

Proposing Changes

Linter rules like these are a team effort. All developers subject to these rules should feel free to propose changes so that we can arrive a set of common rules that work for everyone. To do this, simply open a pull request and give other affected devs the opportunity to discuss in comments.

For organization and tracking purposes, pull requests to this repo should focus on changing a small number of rules at a time. This will help keep discussion focused on individual conventions and concerns.

Note that the rules in this repo only affect our front end React repositories. In order to make changes to common rules, see @batterii/eslint-config-vurvey.

Publishing

npm version and npm publish can be used to publish this package as normal. These should be run in the latest main branch by someone with write access to the package on NPM. When doing so, a preversion script will lint the repo and a prepublishOnly script will automatically push the verison number commmit and tag to the GitHub repo.

Note that ESLint configuration changes can have massive effects on other developers and code bases. When publishing a new version of this package, a breaking release should be made if one or more rules changes has the potential to produce new linter errors (not warnings) which cannot be auto-fixed by ESLint's --fix flag.

Doing this will enable developers of affected repositories to upgrade to the breaking versions and address the new errors when they are able.