Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ESLint Fish Functions
# Wrap ESLint command to use global config
function eslint
command eslint --config ~/.config/.eslintrc.js $argv
end
# Personal utility to install ESLint in the current working directory
function yawn
if test (count $argv) -lt 1; or test $argv[1] = "--help"
printf "Don't yawn too loud now, I need a package name"
else if test (count $argv) -eq 1
switch $argv[1]
case 'eslint'
_install_eslint
case '*'
echo "Doesn't look like I have that package, try again."
end
else
echo $argv
end
end
# _internal_function to install ESLint, used by `yawn`
function _install_eslint
yarn add -D \
eslint babel-eslint eslint-loader \
prettier eslint-config-prettier eslint-plugin-prettier \
eslint-config-standard eslint-plugin-standard \
eslint-plugin-node \
eslint-plugin-jsx-a11y \
eslint-plugin-promise \
eslint-plugin-import \
eslint-plugin-react \
eslint-plugin-html \
;and cp ~/.config/.eslintrc.js .
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.