Skip to content

samualtnorman/eslint-plugin-hackmud2

 
 

Repository files navigation

@samual/eslint-plugin-hackmud2

Linting rules for hackmud scripts.

This is a fork of vacoon/bosconian-dynamics/Aniketos's package of the same name that enables checking of TypeScript files.

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

  1. Make sure you have Node.js installed.
  2. Open a terminal and cd to the folder containing your scripts.
  3. Run npm install -D eslint @samual/eslint-plugin-hackmud2.
  4. Create .eslintrc.json in that folder and dump the following into it:
    {
    	"plugins": [ "@samual/eslint-plugin-hackmud2" ],
    	"extends": "plugin:@samual/eslint-plugin-hackmud2/recommended"
    }

You can find out how to configure your editor to recognise eslint. Then when you open that folder in your editor, you'll have linting.

If you don't actually want editor integration, you can just run npx eslint path/to/script.js every time you want to lint a script (must be run from the folder with .eslintrc.json).

About

Linting rules for hackmud scripts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%