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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@digitoimistodude/stylelint-config

v1.0.0

Published

Dude's shareable stylelint config for SCSS

Readme

Dude Coding Standards (DCS)

[!NOTE] Please note: The Dude Coding Standard is a work in progress. We're in the process of replacing WordPress-Core standard in dudestack with our own DSC standard, the one you are currently looking at (internal reference: DEV-624). This PHPCS standard is used by Dude staff and may not provide additional value for external developers.

version WordPress PHP GitHub Actions Workflow Status

PHP_CodeSniffer and Stylelint rules for WordPress theme and plugin development at Digitoimisto Dude Oy.

This repository contains:

  • PHPCS standard (DCS) - via Composer
  • Stylelint config - via npm

PHPCS Installation

composer require --dev digitoimistodude/dude-coding-standards

The standard will be automatically registered with PHP_CodeSniffer via the Composer installer plugin.

Usage

In phpcs.xml

Create a phpcs.xml in your project root:

<?xml version="1.0"?>
<ruleset>
  <rule ref="DCS"/>
</ruleset>

Command line

phpcs --standard=DCS path/to/your/code

With custom configuration

You can override rules in your project's phpcs.xml:

<?xml version="1.0"?>
<ruleset>
  <rule ref="DCS">
    <!-- Exclude specific rules if needed -->
    <exclude name="DCS.PHP.ForbiddenFunctions"/>
  </rule>

  <!-- Add project-specific patterns to exclude -->
  <exclude-pattern>*/some-legacy-folder/*</exclude-pattern>
</ruleset>

What's included

DCS is based on WordPress Coding Standards with Dude-specific customizations:

Code style

  • 2-space indentation instead of tabs
  • Short array syntax [] allowed (instead of array())
  • Relaxed commenting requirements
  • Flexible function formatting with spaces
  • ...and more in the future

Security

All WordPress security sniffs are enabled:

  • WordPress.Security.NonceVerification
  • WordPress.Security.ValidatedSanitizedInput
  • WordPress.Security.EscapeOutput
  • And more...

PHP compatibility

Checks code compatibility with > PHP 8.3 using PHPCompatibilityWP.

Development functions

error_log() and print_r() are allowed but flagged as warnings to remind you to review before deployment.

Excluded rules

The following WordPress rules are excluded for Dude's workflow:

  • Yoda conditions (WordPress.PHP.YodaConditions)
  • Strict file naming (WordPress.Files.FileName)
  • Tab indentation (Generic.WhiteSpace.DisallowSpaceIndent)
  • Long array syntax requirement (Universal.Arrays.DisallowShortArraySyntax)
  • See DCS/ruleset.xml for the full list

Adding forbidden functions

To add more forbidden functions to your project, create a custom sniff or override in your phpcs.xml:

<rule ref="Generic.PHP.ForbiddenFunctions">
  <properties>
    <property name="forbiddenFunctions" type="array">
      <element key="my_deprecated_function" value="new_function"/>
    </property>
  </properties>
</rule>

Development and local testing

If you want to test DCS locally before the package is published, first install dependencies in dude-coding-standards:

cd /path/to/dude-coding-standards
composer install

Then add path repository to your project's composer.json:

{
  "repositories": [
    {
      "type": "path",
      "url": "../dude-coding-standards"
    }
  ],
  "require-dev": {
    "digitoimistodude/dude-coding-standards": "@dev"
  }
}

Run composer update in your project:

composer update digitoimistodude/dude-coding-standards

Note: Path repositories create symlinks, so any changes you make to dude-coding-standards are instantly available in your test project without reinstalling.

Check that DCS is available:

./vendor/bin/phpcs -i
# Should show: ... DCS ...

Create phpcs.xml in your project, can be as simple as this:

<?xml version="1.0"?>
<ruleset>
  <rule ref="DCS"/>
</ruleset>

Run phpcs:

# From the dev project
./vendor/bin/phpcs --standard=phpcs.xml path/to/your/code

# By using the global version
phpcs --standard=phpcs.xml path/to/your/code

You can also run phpcs directly from dude-coding-standards against your project:

cd /path/to/dude-coding-standards

# From the dev project
./vendor/bin/phpcs --standard=DCS /path/to/your/project/

# By using the global version
phpcs --standard=DCS /path/to/your/project/

Check the standard itself for development:

phpcs --standard=phpcs.xml DCS/

Stylelint Config

Installation

npm install --save-dev @digitoimistodude/stylelint-config stylelint

Usage

Create .stylelintrc in your project root:

{
  "extends": "@digitoimistodude/stylelint-config"
}

Overriding rules

{
  "extends": "@digitoimistodude/stylelint-config",
  "rules": {
    "declaration-no-important": null
  }
}

See stylelint.config.js for all rules.


References