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

@effective/eslint-config

v5.4.7

Published

ESLint Config for TypeScript and ReactJS

Downloads

870

Readme

Effective / ESLint-Config

Sponsored by License Version Build Downloads

Introducing @effective/eslint-config—your definitive ESLint configuration package. By synthesizing the most effective practices and presets from industry-leading sources including React, XO, and TypeScript ESLint, Effective ESLint offers a premier linting solution that stands on the shoulders of giants. This configuration is meticulously crafted to enhance your development workflow, ensuring that your code is not only clean and efficient but also meets the highest standards of coding excellence.

Key Features

  • Comprehensive Configurations: Effective ESLint integrates a variety of top-tier ESLint presets into one unified configuration, offering the best practices from the ESLint community. This approach ensures you have a comprehensive and effective linting setup.
  • Fully Customizable: With the understanding that each project is unique, Effective ESLint is built to be fully customizable. It allows for easy adjustment or deactivation of specific rules to fit your project's needs, providing a perfect mix of guideline enforcement and creative latitude.
  • Streamlined Integration: Effective ESLint is designed to be user-friendly, streamlining the setup process. Its configuration facilitates quick integration, allowing you to refine your codebase efficiently, without the complexities of intricate setups.
  • Enhanced Efficiency: Effective ESLint enhances the linting process by combining multiple presets into one, which not only eases management but also improves the linter's startup time. This results in a quicker and more productive development workflow.
  • Local Preset: Effective ESLint includes local rules that enhance code consistency, specifically for imports, JSX code, and enforcing sensible defaults to maintain low code complexity.
  • Community-Driven Development: The development of Effective ESLint is community-driven, emphasizing continuous improvement and inclusivity. Contributions from the community are highly encouraged, helping to keep our configurations up-to-date with the latest coding standards and practices.

Installation

To use @effective/eslint-config in your project, you need to install it via npm, yarn or pnpm. Ensure you have ESLint installed in your project; if not, you can install it alongside this package.

npm install @effective/eslint-config eslint --save-dev
# or
yarn add @effective/eslint-config eslint --dev
# or
pnpm add @effective/eslint-config eslint --dev

Usage

After installation, you can configure ESLint to use @effective/eslint-config by adding it to your eslint.config.js (flat configuration) file:

import { main } from "@effective/eslint-config"

export default [
  main

  // room for custom overrides
]

There is also a main import as an alternative to recommended which does not include any of the listed addons.

Rules

You can check the full resolution table here which shows which rules are active and from where.

Approach

All starts with eslint:recommended the built-in recommendations list from ESLint.

Collections

Effective ESLint incorporates rules from the following collections to establish a comprehensive linting foundation:

  1. XO: Constituting over 50% of Effective ESLint's preset, XO provides a robust, TypeScript-centric base. It stands out for its thorough approach and specialized focus on TypeScript.
  2. TypeScript ESLint: Effective ESLint utilizes the strict and stylistic rules from TypeScript ESLint, opting for the type-enhanced versions. While there is significant overlap with XO rules, XO typically enforces stricter standards, offering finer-grained exceptions and options.

Framework Collections

Effective ESLint embraces best practices by integrating presets from leading React frameworks:

  1. Create React App: Focused on React (including JSX-A11Y), the CRA preset offers a well-rounded, common-sense-oriented foundation for React development.
  2. NextJS: Specializes in framework-agnostic rules, specifically excluding @next/plugin-specific rules.
  3. Remix: Enhances Effective ESLint's presets with standards from the Remix framework.

Plugins

Effective ESLint is further enriched by recommended rules from these plugins:

  1. React Plugin & React Hooks: Integrates all recommended rules not already part of CRA, including warnings on deprecated APIs, the use of string refs, and more.
  2. JSX-A11Y: Adopts all recommended accessibility rules from the JSX-A11Y plugin.
  3. Unicorn Plugin: Implements all recommended practices from the Unicorn plugin to promote superior coding patterns.
  4. Node: A maintained fork of the original Node.js plugin, with all recommended ESM Node.js rules enabled.
  5. JSDoc: Enables all recommended JSDoc rules, excluding those starting with required-. This reflects the TypeScript project's reliance on the type system over extensive JSDoc comments.
  6. RegExp Plugin: All recommended RegExp rules are enabled to ensure expressions are both efficient and error-free.

Local Preset

The local preset option was introduced to enable non-code moderation capabilities, addressing the limitations of a purely priority-based approach. In certain situations, this single-faceted method proves insufficient, such as when a specific setting from one preset should prevail due to its more common usage, despite conflicting with a higher-priority preset. The local preset currently encompasses four categories:

  • import: Automates the sorting and grouping of import statements.
  • naming: Implements XO-based naming conventions for variables and functions but adds support for uppercase global constants.
  • quality: Establishes sensible defaults for various code quality metrics, such as complexity, file size, and type definition styles.
  • react: Promotes a unified coding style for JSX, enhancing readability and maintainability.

These enhancements are part of the local preset, which predominantly builds upon the foundations set by existing presets, as previously mentioned.

Focussed on React/TypeScript

Effective ESLint globally excludes specific namespaces/plugins to maintain focus and avoid conflicts:

  1. vue/*: Tailored for ReactJS, hence all Vue-related rules are excluded.
  2. flowtype/*: Dedicated to TypeScript, omitting all Flowtype-related rules.
  3. @next/*: Framework-specific rules, such as those from NextJS, are avoided to prevent conflicts in diverse environments.
  4. import/*: Given its reduced relevance in TypeScript projects, the import plugin is not very utilized in most presets nowadays. It is also relatively slow in execution for TypeScript code.

Disabled Formatting

Effective ESLint employs Prettier's configuration to disable any stylistic/formatting rules that could conflict with Prettier's guidelines. This encompasses core ESLint rules and those from React and TypeScript plugins.

License

Apache License; Version 2.0, January 2004

Copyright

Copyright 2024Sebastian Software GmbH