Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-plugin-communist-spelling

dprgarner69.3kISC1.0.0

Promote American values in variable names

eslint, eslintplugin, eslint-plugin, american, british, english, spelling, us, uk

readme

Build Status npm

eslint-plugin-communist-spelling

An ESLint plugin containing a single rule to catch variable names written in Communist Commonwealth English instead of American English. Keep them Reds out of decent American codebases.

function favouriteCountry({ colours = ["communist", "red"] }) {} // 👎😠☭
function favoriteCountry({ colors = ["red", "white", "blue"] }) {} // 👍🇺🇸🦅

...or, if you're a Godless Communist Commonwealther, the rule can be inverted to enforce Commonwealth spellings in your variable names.

In-depth documentation for the rule, the available options, and more examples of code are located here:

Installation

If using yarn:

yarn add -D eslint-plugin-communist-spelling

If using npm:

npm install --save-dev eslint-plugin-communist-spelling

Usage

Add communist-spelling to the plugins section of your .eslintrc configuration file, and communist-spelling/communist-spelling to the list of rules. You can omit the eslint-plugin- prefix:

{
    "plugins": ["communist-spelling"],
    "rules": {
        "communist-spelling/communist-spelling": "error"
    }
}

or, if using a YAML ESLint config file:

plugins:
    - communist-spelling
rules:
    communist-spelling/communist-spelling:
        - error

Releasing

Releases to NPM are performed via Travis when tagged commits are pushed to the repo. Create a new tagged commit and bump the version in package.json with:

npm version patch

and push the new commits and tags with:

git push && git push --tags

Acknowledgements

The JSON data for spelling differences was adapted from the American-British-English-Translator. The core functionality of the tree-traversing code was adapted from the camelCase rule included in the core ESLint package.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

[1.0.0] - 2019-11-02

Added

  • Changelog