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

jscs-spellcheck

v1.0.0

Published

JSCS Spellcheck Plugin

Downloads

4

Readme

Build Status Windows CI Coverage Status Dependency Status devDependency Status

JSCS Spellcheck — Spellcheck plugin for JSCS.

This JSCS plugin checks for words that can't be found in a dictionary, and tells you where they are so that you can spell them correctly. You can choose which dictionaries and languages to use. You can add more words and ignore existing ones. You can define exceptions for names used by 3rd parties. You can even restrict a word's usage to identifiers or property names only.

Installation

jscs-spellcheck can be installed using NPM and requires jscs.

Install it globally if you are using globally installed jscs:

npm install jscs-spellcheck --global

But better install it into your project:

npm install jscs-spellcheck --save-dev

Usage

To use, add these lines to your .jscsrc configuration file:

{
    "plugins": [ "jscs-spellcheck" ],
    "requireDictionaryWords": {
        "dictionaries": [ "english", "english/american" ]
    }
}

Rules

requireDictionaryWords

Only allow words defined in a dictionary or by you.

English language support is installed by default. To add additional languages, go to the installation directory of JSCS and run npm install wordlist-LANGUAGE, where LANGUAGE is the name of your language.

Type: Boolean or Object

Values:

  • true: use the "english" dictionary
  • Object:
    • dictionaries: (default ["english"]) array of dictionary names including "english", "english/american", "english/british" and "english/canadian"
    • allowWords: additional words allowed anywhere
    • allowWordsInIdentifiers: additional words allowed only in identifiers
    • allowWordsInProperties: additional words allowed only in properties
    • allowNames: whole names ignored by spellcheck
    • allowNamesAsIdentifiers: whole names ignored by spellcheck when used as identifiers
    • allowNamesAsProperties: whole names ignored by spellcheck when used as properties
    • excludeWords: words to exclude from the dictionaries

Example

"requireDictionaryWords": true

"requireDictionaryWords": {
    "dictionaries": [ "english", "english/american" ],
    "allowWords": [ "transclude" ],
    "allowWordsInProperties": [ "chmod" ],
    "allowNamesAsIdentifiers": [ "$stateParams", "util" ],
    "allowNamesAsProperties": [ "src" ],
    "excludeWords": [ "i" ]
}
Valid for mode true
var number = 1;
object['source'] = 2;
object.source = 3;
fileDirectory = 4;
Invalid for mode true
var num = 1;
obj['src'] = 2;
obj.src = 3;
fileDir = 4;
Valid for mode "dictionaries": [ "english/american" ], invalid for "english/british"
var color = 'papayawhip';
Valid for mode "dictionaries": [ "english/british" ], invalid for "english/american"
var colour = 'papayawhip';
Valid for mode "allowWords": [ "transclude" ]
var transclude = function() {};
var transcludeFunction = function() {};
return { transclude: function() {} };
Valid for mode "allowWordsInProperties": [ "chmod" ]
var mode = 0777;
fs.chmod('/', mode, function(error) {});
fs.chmodSync('/', mode);
Invalid for mode "allowWordsInProperties": [ "chmod" ]
var chmod = 0777;
Valid for mode "allowNamesAsIdentifiers": [ "$stateParams", "util" ]
var util = require('util');
function Controller($stateParams) {}
Invalid for mode "allowNamesAsIdentifiers": [ "$stateParams", "util" ]
var stringUtil = {};
var params = {};
Valid for mode "allowNamesAsProperties": [ "src" ]
element.src = 'https://youtu.be/dQw4w9WgXcQ';
Invalid for mode "allowNamesAsProperties": [ "src" ]
var data = { videoSrc: 'youtube' };
Invalid for mode "excludeWords": [ "i" ]
for (var i = 0; i < array.length; i++) {}

Error Suppression

You can also allow (and later disallow) words on a per-file (or per-line) basis:

// jscs:allowWords concat, dest, dist, src
grunt.initConfig({
    concat: {
        dist: {
            src: ['src/*.js'],
            dest: 'dist/scripts.js'
        }
    }
});
// jscs:allowWords mx
dsn.resolveMx('example.com', function (error, addresses) {
    var mx = addresses[0];
});
// jscs:disallowWords mx

var mx = Math.max(5, 0); // invalid