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

@team-triniti/eslint-plugin-triniti-conventions

v1.2.0

Published

Triniti eslint conventions

Downloads

5

Readme

eslint-plugin-triniti-conventions 🛠

At Triniti, we believe in writing clean, maintainable, and efficient code. Our ESLint conventions are tailored to ensure our codebase aligns with these principles. This set of rules ensure consistency and best practices across all our projects.

Why a consolidated set of rules and conventions?

  • Consistency: Centralising rules provides a consistent development and code review experience.
  • Best Practices: The conventions are based on our extensive experience building scalable systems and widely accepted best practices in the JavaScript community.
  • Maintainability: A single point of update ensures ease of maintenance. Any improvements benefit all projects.

Features 🌟

  • Naming convention: Enforces camelCase for filenames and variable names and ensures class names are in PascalCase.
  • Cyclomatic Complexity: Ensures functions are straightforward and maintainable by limiting the number of linearly independent paths through the source code.
  • No Duplicate Imports: Avoids confusion and ensures that all imports come from a unique source, making it easier to track down and refactor dependencies.
  • No Duplicate Strings: Encourages the use of constants, making the codebase easier to refactor and reduces the chance of typos.
  • Prevent Abbreviations: Aims for clarity and understandability by avoiding abbreviated variable names.
  • Maximum Parameters: Restricts the number of parameters a function can have, promoting functions that are focused and easier to understand.
  • No Cyclic Imports: Ensures a maintainable code structure by preventing circular dependencies which can lead to initialization issues.
  • Import Ordering: Organizes import statements for clarity and to easily identify external vs. internal dependencies.
  • Consistent Return: Enhances the predictability of functions by ensuring they either always return a value or always don't.
  • No Magic Numbers: Encourages named constants to improve readability and maintainability.
  • Max Lines Per Function: Promotes concise functions that do one thing and do it well.

Installation 🚀

npm install eslint-plugin-triniti-conventions --save-dev

Peer Dependencies:

Make sure to also install the required peer dependencies:

npm install eslint --save-dev

Usage 🔧

Once the plugin is installed, you can configure it in your .eslintrc:

{
  "extends": ["plugin:triniti-conventions/recommended"]
}

This configuration includes Triniti's conventions along with other recommended settings.

Rules 📜

For a complete list of rules, please refer to our configuration file.