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

eslint-config-colourbox

v2.0.1

Published

This package provides Colourbox's .eslintrc as an extensible shared config.

Downloads

90

Readme

eslint-config-colourbox

This package provides Colourbox's .eslintrc as an extensible shared config.

Based on eslint-config-airbnb

NPM

Usage

Install

npm install --save-dev eslint-config-colourbox

Configure

Create a .eslintrc in your project's root directory and add this:

{
    "extends": "colourbox"
}

Rules

The configuration extends AirBnb's eslint-config-airbnb ( https://github.com/airbnb/javascript) and adds our preferred configuration.

Differences between AirBnb and this configuration

Globals

window and console are valid globals.

indent: ['error', 4, {'SwitchCase': 1}]

This rule enforces a consistent indentation style. 4 spaces.

'react/forbid-prop-types': [1, { forbid: ['any'] }]

This rule forbids the use of 'vague prop types'; any, array, object. We encourage using arrayOf and shape instead of array and object, but in some cases we want to just use object and array, so we reduced the rule to only forbid the any type.

'react/jsx-indent-props': [2, 'first']

This option validates a specific indentation style for props.

'react/jsx-boolean-value': 0

This rule enforces style for boolean attributes.

Disabled, because we want to allow a more explicit syntax like <MyComponent bool={true} /> instead of having to write <MyComponent bool /> for the same.

'react/jsx-one-expression-per-line': 0

Disabled, allowing you to have multiple expressions, including plain text and whitespace, in 1 line.

'react/jsx-indent': [2, 4]

This rule enforces a consistent indentation style in JSX. 4 spaces.

'react/jsx-curly-brace-presence': 0

This rule controls the use of curly braces. It fails to allow '{ }' except when configuring the rule to ignore children completely, so we disables the rule.

It's an issue with eslint-plugin-react, so the rule should be enabled again when updating to the next stable version of eslint-plugin-react.

'import/no-unresolved': 0

Ensures an imported module can be resolved to a module on the local filesystem.

Disabled, doesn't work properly with webpack.

'class-methods-use-this': 0

Enforce that class methods utilize this

If a class method does not use this, it can sometimes be made into a static function.

Disabled, because it is sometimes difficult to use this in all methods of a class.

'max-len': 0

Disables line length linting. Read more about the options at https://eslint.org/docs/rules/max-len.

'jsx-a11y/click-events-have-key-events': 0

Disallows using onClick without onKey event.

Disabled. We want to be able add onClick attributes without additional events.

'jsx-a11y/no-static-element-interactions': 0

The AirBnb eslint configuration discourages adding actions to static elements, for example onclick on a div, without adding role and tabindex. We disabled the rule for convenience, and because we except to have very few or no visually impaired users using our stock image website.

This rule is closely related to jsx-a11y/no-noninteractive-element-interactions:

'jsx-a11y/no-noninteractive-element-interactions': 0

This rule enforces using natively interactive HTML elements for interaction, for example a button for click events, and not just any element like a div. The rule is closely related to the above rule and has been disabled.

'jsx-a11y/media-has-caption': 0

This rule reminds/forces developers to add tracks (captions, subtitles) to media. We do not (always) have such tracks and do not want to be forced into producing them, so we disabled the rule.

'react/no-danger': 0

Prevent usage of dangerous JSX properties.

Disabled. In some cases, we want to use it for editable content.

'no-restricted-syntax': [ 'ForStatement' ]

Disallows for loops. Full rule:

'no-restricted-syntax': [
    'error',
    'ForStatement',
    'ForInStatement',
    'ForOfStatement',
    'LabeledStatement',
    'WithStatement',
],

'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }]

Require parens in arrow function arguments.

Disabled. Require for block body or multiple parameters.

'react/jsx-props-no-spreading': 0

Disallow JSX props spreading

Disabled. In some cases, we want to use JSX props spreading.

'react/jsx-curly-newline': 0

Enforce linebreaks in curly braces in JSX attributes and expressions.

Disabled. Come on! Get a life, who cares.