Skip to content

Instantly share code, notes, and snippets.

@josefaidt
Created January 29, 2019 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josefaidt/ed9dcc84164243c5f03b9340161acd26 to your computer and use it in GitHub Desktop.
Save josefaidt/ed9dcc84164243c5f03b9340161acd26 to your computer and use it in GitHub Desktop.
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