@thebespokepixel/fishlint

Usage

Installation

npm install --global @thebespokepixel/fishlint

A very simple linter for fish shell scripting and function editing. Designed as a companion component for the Sublime-Linter package.

It's probably worth noting that fish's strength in being an interactive shell eg. a shell primarily designed for interacting with humans, not machines.

There's nothing to be gained using fish scripts where the interaction is going to be other scripts or machines. Fish shines when it's just you and the CLI locked in mortal combat at 2am.

Very much a work in progress… it works ok, but is still ignorant of custom functions and only provides warnings, not errors.

API

lint String

src/index.js

Lint an array of .fish file paths. Returns a linting signature as below.

bad.fish|7|3|W|Unknown command

Shows an warning occured in 'bad.fish', line 7, starting column 3 that was an unknown command.

unbalanced.fish|2|7|W|Unexpected end of string, quotes are not balanced

Shows an 'Unexpected end of string' warning in 'unbalanced.fish' on line 2, column 7.

lint(globs: (string | Array<string>)) → String
Parameters
globs ((string | Array<string>)) A single file, glob or array of file path globs.
Returns
String: A lint signature matching file.fish|line|column|type|description