@samual/eslint-plugin-hackmud2

0.4.0 • Public • Published

@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).

Package Sidebar

Install

npm i @samual/eslint-plugin-hackmud2

Weekly Downloads

0

Version

0.4.0

License

MIT

Unpacked Size

11.2 kB

Total Files

22

Last publish

Collaborators

  • samual