Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

csshint

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csshint

lint your css code

  • 0.3.4
  • latest
  • stable
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

CSSHint

csshint npm version Coverage Status Dependency Status devDependency Status

CSSHint is a code review tool based on NodeJS. The current rules are based on ecomfe CSS STYLE SPEC. It also covers CSSLint rules.

After a period of code refactoring, we finally came to this version, in which CSS parser is replaced with postcss. In addition, we changed the way of implementation which was also able to improve the performance by a large margin. Meanwhile, the following global object has three attributes as follows:

  • global.CSSHINT_INVALID_ALL_COUNT: it is used to count the number of warn to serve max-error.
  • global.CSSHINT_HEXCOLOR_CASE_FLAG: it is used to record project's color value, whether the letters are small or capital. 0 is for small and 1 is for capital. This attribute is to serve unifying-color-case-sensitive.
  • global.CSSHINT_FONTFAMILY_CASE_FLAG: it is used to record whether font-family is small or capital to serve unifying-font-family-case-sensitive.

CONFIG Reference

Install & Update

CSSHint has been released on npm. It can be installed following the instructions.

$ [sudo] npm install csshint [-g]

Follow the following instruction if you are to update your CSSHint.

$ [sudo] npm update csshint [-g]

Usage

  • in CLI

      $ csshint -v   // show version
      $ csshint [filePath|dirPath]   // run csshint on file or dir
    
  • in Node.js

      /**
       * detect css file content
       *
       * @param {string} fileContent file content
       * @param {Object=} config config of rule, optional
       *
       * @return {Promise} Promise Object
       * reject and resolve arguments:
       * {
       * 		path: {string} file path
       * 		messages: {Array.<Object>} warning messages, [{ruleName, line, col, errorChar, message, colorMessage}]
       * }
       */
      exports.checkString(fileContent, config);
    
    
      /**
       * detect file
       *
       * @param {Object} file the object has path and content key
       * @param {Array} errors warning messages
       * @param {Function} done detect callback
       */
      check(file, errors, done);
    

TODO

  • Complete coverage csslint rule
  • support /* csshint-disable ruleName */ and /* csshint-enable ruleName1 */.

CHANGELOG

Keywords

FAQs

Package last updated on 09 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc