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 🙏

© 2022 – Pkg Stats / Ryan Hefner

@jsdevtools/eslint-config-modular

v8.0.4

Published

Modular ESLint configuration

Downloads

174

Readme

Modular ESLint Configuration

Cross-Platform Compatibility Build Status

Coverage Status Dependencies

npm License Buy us a tree

ESLint Modular is a shareable config for ESLint that's broken-up into different modules that can be mixed-and-matched to match the needs of your project.

Each module defines rules that are meant to be reasonable defaults and best practices, but you can easily extend or override any of the rules to suit your needs.

Related Projects

Installation

Run the following npm command to install ESLint and ESLint Modular as dev-dependencies of your project:

npm install eslint @jsdevtools/eslint-config-modular --save-dev

Usage

Shareable configs are designed to work with the extends feature of .eslintrc files. You can learn more about Shareable Configs on the official ESLint website.

To use ESLint Modular in your project, create an .eslintrc.yml file with the following contents:

.eslintrc.yml

extends:
  # These modules would be good for a Node.js project written in ES5
  - "@jsdevtools/modular/best-practices"
  - "@jsdevtools/modular/style"
  - "@jsdevtools/modular/node"
  - "@jsdevtools/modular/es5"

rules:
  # You can override or extend any rules here

Modules

Modular ESLint Configuration includes the following modules. Mix-and-match them as applicable to your project.

@jsdevtools/modular/best-practices (source)

This module contains rules that prevent accidental bugs, insecure code, and bad coding practices. You can use this module directly, or use any/all of its sub-modules.

@jsdevtools/modular/best-practices/bugs (source)

The rules in this module prevent syntax that is likely to lead to accidental bugs or runtime errors. Examples include not reassigning native objects, and using === instead of == for comparisons. Most of the rules in this file will raise an error if violated, but some less-severe ones will only raise warnings.

@jsdevtools/modular/best-practices/security (source)

These rules help enforce security best-practices such as avoiding the eval() statement and requiring "use strict" directives.

@jsdevtools/modular/browser (source)

This module configures ESLint to recognize browser globals, such as window, document, navigator, etc. It also contains rules that are specific to projects that are intended to run in web browsers, such as avoiding the alert() statement and requiring the use strict directive within a function.

@jsdevtools/modular/browser/jsx (source)

This module configures ESLint to parse JSX syntax. It also contains JSX-specific rules, such as enforcing the use of double-quotes in JSX attributes.

@jsdevtools/modular/es5 (source)

This module configures ESLint to parse EcmaScript 5 code. It also disables ES6-specific rules, such as using let instead of var.

@jsdevtools/modular/es6 (source)

This module configures ESLint to parse EcmaScript 6 (and newer) code. It also contains ES6-specific rules, such as not assigning to constants, calling super() in constructors, and using let instead of var.

@jsdevtools/modular/modules/cjs (source)

This module configures ESLint to parse your JavaScript files with script semantics rather than ES6 module semantics, since CommonJS modules are not "true" JavaScript modules.

@jsdevtools/modular/modules/esm (source)

This module configures ESLint to parse your JavaScript files with ES6 module semantics rather than script semantics. It also disallows the use strict directive, since ES6 modules are always strict.

@jsdevtools/modular/node (source)

This module configures ESLint to recognize Node.js globals, such as process, __dirname, Buffer, etc. It also contains rules that are specific to Node.js projects, such as avoding new require() syntax and disallowing concatenation with __dirname.

@jsdevtools/modular/style (source)

This module contains code-styling and consistency rules. You can use this module directly, or use any/all of its sub-modules.

@jsdevtools/modular/style/conventions (source)

The rules in this module enforce an opinionated set of conventions, such as using double-quotes and semi-colons.

@jsdevtools/modular/style/naming (source)

These rules enforce JavaScript naming conventions, such as camel-case variables and capitialized classes.

@jsdevtools/modular/style/syntax (source)

These rules disallow outdated, nonstandard, and confusing syntax. Examples include labels, the comma operator, and nonstandard multiline strings.

@jsdevtools/modular/style/whitespace (source)

This module enforces opinionated whitespace rules, such as two-space indentation, Stroustrup style opening braces, and commas at the end of the line.

@jsdevtools/modular/test (source)

This module configures ESLint to recognize globals that are defined by common test frameworks, such as describe, it, beforeEach, etc. It also disables rules that tend to cause problems with certain test frameworks.

Note: We recommend that you create a separate .eslintrc.yml file in your test folder. That way, it can use different modules and rules than the rest of your codebase.

License

ESLint Config Modular is 100% free and open-source, under the MIT license. Use it however you want.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Big Thanks To

Thanks to these awesome companies for their support of Open Source developers ❤

Travis CI SauceLabs Coveralls