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

@doghouse/dh-lint

v1.0.13

Published

DH Lint is a tool for generating project specific javascript and sass linting configuration files.

Downloads

354

Readme

DH Lint

DH Lint is a tool for generating project specific javascript and sass linting configuration files.


Install

npm install @doghouse/dh-lint --save-dev

Configure

DH Lint can be configured via the command line by running the following command in your project root:

npm exec dh-lint-install

you will then be prompted to answer a series of questions in order to set up the config files for your project:

  1. What framework is this project using?
  2. Would you like to generate an .eslintrc.yaml config file?
  3. Would you like to generate an sass-lint.yml config file?
  4. Would you like to generate a babel.config.js file?
  5. Would you like to update your package.json file with linting scripts?

The config files generated in your projects root directory both extend framework specific config files defined in this package. The generated files can be extended and overridden further by defining your own settings within them. For documentation on how to add your own rules or settings, click on the links listed under the Dependencies section of this README file.

The base eslint config file in this package extends from the eslint-config-airbnb

Stylelintrc.yml configuration

Dh-lint scans your stylesheets based on the chosen framework using Stylelint and Stylelint-scss. You have the flexibility to modify the config and make the required adjustments in the .stylelintrc.yml file. For instance,

---
  extends: "./node_modules/@doghouse/dh-lint/config/sasslint/laravel.yml"
  # Override rules 
  rules:
    comment-no-empty: null
    selector-class-pattern: null
    declaration-empty-line-before: null

Usage

If you opted to update your package.json file with linting scripts, then you may use the following commands to lint your project.

  1. npm run lint:js Will scan your javascript files and log any errors or warnings associated with your code.
  2. npm run lint:js-fix Will attempt to fix any errors that eslint has found with your code.
  3. npm run lint:sass Will scan your styles directory and log any errors or warnings associated with your stylesheets.
  4. npm run lint:sass-fix Will attempt to fix any errors that sass-lint has found within your stylesheets.
  5. npm run lint:vue Will scan your directory containing vue elements and log any errors or warnings associated with your vue components.
  6. npm run lint:vue-fix Will attempt to fix any errors that eslint has found within your vue components.
  7. npm run lint Will scan your directory containing sass, js and vue elements and log any errors or warnings associated with your assets.
  8. npm run lint-fix Will attempt to fix any errors that eslint has found within your stylesheets, js and vue components.

Note: If you choose to have your errors automatically fixed, you are still responsible for this code, So please review the changes made before you commit them.


Dependencies

This project depends on eslint for javascript linting and stylelint for sass linting.


Support

Currently supported frameworks are:

  1. Drupal 8|9|10
  2. Magento 2
  3. Laravel

If you wish to add support for other framework, please email Doghouse Agency. Otherwise feel free to create a pull request.