Git Product home page Git Product logo

eslint-plugin-hackmud's Introduction

eslint-plugin-hackmud2

npm license npm

Linting rules for hackmud scripts.

Features

  • Permits and validates code enclosure in single top-level anonymous function
  • Permits subscript syntax #fs.user.script(), #4s.user.script()
  • Limited validation of subscript syntax
  • Permits #db calls
  • Defines hackmud globals _START, _TIMEOUT, _ST, _TO, _END
  • Permits #D, #G, and #FMCL preprocessor directives

This plugin is somewhat hackish, at the moment - the largest caveat is that linted scripts should not contain $S_, $DB_, $G, $D, or $FMCL.

Installation

Install the ESLint linter and eslint-plugin-hackmud2, either locally (in the directory containing your scripts, or an ancestor of it) or globally - if you don't know the difference I recommend the latter:

$ npm install --global eslint eslint-plugin-hackmud2

Usage

To activate eslint-plugin-hackmud2, create a .eslintrc.json configuration file in the root work directories containing the script sources which you'd like to lint (or configure your linter/editor's linter plugin to use the configuration file in the location of your choice).

Add hackmud2 to the plugins section of your .eslintrc.json configuration file, and "plugin:hackmud2/recommended" as the base configuration:

{
  "plugins": [
    "hackmud2"
  ],
  "extends": "plugin:hackmud2/recommended"
}

If your scripts reside in the standard hackmud/{user}/scripts directories, most ESLint consumers should pick up on a single configuration file in the common hackmud directory.

Command line usage

$ eslint myscript.js

IDE Support

Many popular editors and IDEs support ESLint integration to provide visual indicators for validation rules. Try searching for how to enable ESLint support for your editor if it is not listed below.

Atom

Install the Linter and linter-eslint packages:

$ apm install linter
$ apm install linter-eslint

If you installed eslint/eslint-plugin-hackmud2 globally, check the "Use global ESLint installation" option in Settings > Packages > linter-eslint > Settings.

Visual Studio Code

Enable ESLint linting in your Workspace's settings - I also recommend disabling VSCode's TypeScript validation engine to suppress extraneous warnings. If it doesn't exist already, create a .vscode directory in your workspace root containing a settings.json file. Add the following lines:

{
    "javascript.validate.enable": false,
    "eslint.enable": true
}

Supported Rules

TODO

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.