Giter VIP home page Giter VIP logo

standardx's Introduction

standardx

JavaScript Standard Style with custom tweaks

npm tests standard

Overview

This package allows users to follow JavaScript Standard Style, but deviate if needed. This can be done by adding an .eslintrc file to their project directory or by adding an "eslintConfig" attribute to your package.json. That eslint config will be layed on top of the standard ruleset.

If there is a standard attribute in your package.json for defining globals or ignoring files, rename it to standardx:

"standardx": {
    "global": [
      "chrome",
      "muon",
      "postMessage"
    ]
}

All other standard features remain intact (including --fix!)

Install

npm install standardx --global

Usage

Use standardx on the command line the same way you use standard:

Usage:
    standardx <flags> [FILES...]

    If FILES is omitted, then all JavaScript source files (*.js, *.jsx) in the current
    working directory are checked, recursively.

    Certain paths (node_modules/, coverage/, vendor/, *.min.js, bundle.js, and
    files/folders that begin with '.' like .git/) are automatically ignored.

    Paths in a project's root .gitignore file are also automatically ignored.

Flags:
        --fix       Automatically fix problems
    -v, --verbose   Show rule names for errors (to ignore specific rules)
        --version   Show current version
    -h, --help      Show usage information

Flags (advanced):
        --stdin     Read file text from stdin
        --global    Declare global variable
        --plugin    Use custom eslint plugin
        --env       Use custom eslint environment
        --parser    Use custom js parser (e.g. babel-eslint)

Configuring

Running standardx with no additional configuration is the same as running standard itself. (Except rename the "standard" property in package.json to "standardx" if you have one.)

If there are rules you would like turned off, modify the ruleset using eslint config. Check out Configuring eslint for more information.

Example: Allow snake_case by turning off the camelCase rule

Via: .eslintrc:

{
  "rules": {
    "camelcase": 0
  }
}

or via package.json:

{
  "name": "coolproject",
  "description": "My Cool Project",
  "version": "1.0.0",
  "author": "Fantastic Developer",
  "eslintConfig": {
    "rules": {
      "camelcase": 0
    }
  }
}

Now, running standardx (with no additional arguments) will allow snake_case without error!

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

MIT

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.