Created
January 29, 2019 14:39
-
-
Save josefaidt/ed9dcc84164243c5f03b9340161acd26 to your computer and use it in GitHub Desktop.
ESLint Fish Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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