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

@svengreb/eslint-config-base

v0.12.0

Published

The opinionated, yet universally applicable JavaScript code style guide base rules as an extensible shared ESLint configuration

Downloads

67

Readme

This package implements the base rules of the opinionated, yet universally applicable JavaScript code style guide as an extensible ESLint configuration with plugin support for Prettier.

Getting Started

To enable support for React and JSX A11Y plugin rules as well as compatibility integrations for other projects like Prettier, use the shareable rule configuration package @svengreb/eslint-config.

Note that this package uses npm version 7.7.0 or higher as the main package manager, but the documentations also include instructions to work with Yarn (classic / v1).

Installation

Add the package as development dependency to your project:

# With npm...
npm install --save-dev @svengreb/eslint-config-base

# or Yarn.
yarn add --dev @svengreb/eslint-config-base

Note that peer dependencies, like the remark-lint package itself, are only installed automatically when using a npm version equal or higher than 7.0.0, otherwise they must be installed separately like described in the peer dependencies section below. See the Node distribution index for more information about which npm version is bundled with which Node version.

Peer Dependencies

Next to all base ESLint rules, the default export also contains rules related to ECMAScript 6+ including the import and export features as well as compatibility integrations for other projects like Prettier. Therefore this package depends on the eslint-plugin-import, eslint-plugin-prettier, prettier and eslint packages that are defined as peer dependencies.

npm versions >=7.0.0

As of npm version 7.0.0, peer dependencies are installed automatically and does not require any additional steps.

npm versions >=5.0.0 <7.0.0

For npm version equal to or higher than 5.0.0 (pre-bundled with Node.js 8) but less than 7.0.0, all peer dependencies can be auto-installed using the pre-bundled npx package:

npx install-peerdeps --dev @svengreb/eslint-config-base
npm versions <5.0.0

If you’re using a npm version less than 5.0.0, the npx package is not pre-bundled, but users can either simply install the npx package globally to run the above command or use the install-peerdeps helper package locally/globally to let it handle the installation of all peer dependencies:

# Install and use the "install-peerdeps" helper package locally...
npm install install-peerdeps
./node_modules/.bin/install-peerdeps --dev @svengreb/eslint-config-base

# ...or globally.
npm install --global install-peerdeps
install-peerdeps --dev @svengreb/eslint-config-base

To install all peer dependencies manually without npx or any helper package, the npm info command can be used to get a list of all packages and their versions:

# List the names and versions of all peer dependencies...
npm info "@svengreb/eslint-config-base" peerDependencies

# ...and install each listed package manually.
npm install PACKAGE@VERSION
Using Yarn instead of npm

If you’re not using npm but Yarn, peer dependencies can be installed by either adding them manually or using the install-peerdeps helper package:

# Either add all packages manually by listing all required names and their versions and install them manually...
yarn info @svengreb/eslint-config-base peerDependencies
yarn add --dev remark-lint #...

# ...or use the "install-peerdeps" helper package.
yarn add --dev install-peerdeps
yarn run install-peerdeps --dev @svengreb/eslint-config-base

Usage

This package provides a shareable configuration preset that can be used by extending the ESLint configuration file. Add @svengreb/eslint-config-base and/or any of the additional entry points to the extends array in your .eslintrc configuration file:

module.exports = {
  extends: [
    /* Provides support for all ESLint core rules. */
    "@svengreb/eslint-config-base",
    /*
     * Optional entry point to enable support for projects using Prettier.
     * Note that this must always be placed after the `@svengreb/eslint-config-base` preset to take precedence,
     * otherwise it won't prevent errors due to useless and possibly conflicting rules!
     */
    "@svengreb/eslint-config-base/prettier",
  ],
};

Entry Points

This package provides multiple entry points that can be composed especially for the projects they are used in:

  • @svengreb/eslint-config-base — The default entry point that support for all ESLint core rules.
  • @svengreb/eslint-config-base/prettier — Entry point to enable support for Prettier through eslint-plugin-prettier and the officially recommended Prettier ESLint configuration eslint-config-prettier. It disables possibly conflicting rules and rules that definitely not needed when using Prettier for code formatting. There is also additional support when Prettier is used for React based projects by extending the special prettier/react configuration that also disables specific react/ and JSX rules. See the @svengreb/eslint-config package to use React specific rules. Note that this configuration should always be placed after @svengreb/eslint-config-base in order to override conflicting rules, otherwise the @svengreb/eslint-config-base preset will take precedence leaving conflicting rules untouched!

Contributing

Please read the contribution guidelines of the JavaScript style guide project for detailed information.