Giter Site home page Giter Site logo

eslint-plugin-american-spelling's Introduction

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.

eslint-plugin-american-spelling's People

Contributors

dprgarner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.