forked from paulolramos/eslint-prettier-airbnb-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint-prettier-config.sh
executable file
·39 lines (29 loc) · 1.13 KB
/
eslint-prettier-config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
YELLOW='\033[1;33m'
GREEN='\033[1;32m'
LCYAN='\033[1;36m'
NC='\033[0m' # No Color
echo -e "${GREEN}Starting Style Formatting Configuration... ${NC}"
echo -e "1/5 ${LCYAN}Local ESLint & Prettier Installation... ${NC}"
npm install -D [email protected] prettier
echo -e "2/5 ${YELLOW}Airbnb Configuration Installation... ${NC}"
npm install -D eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-import eslint-plugin-react
echo -e "3/5 ${LCYAN}Disabling ESLint Formatting... ${NC}"
npm install -D eslint-config-prettier eslint-plugin-prettier [email protected] eslint-config-react-app
echo -e "4/5 ${YELLOW}Creating ESLint JSON... ${NC}"
touch .eslintrc.json
echo '{
"extends": ["airbnb", "prettier", "react-app", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"],
"jsx-a11y/href-no-hash": [0],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
}
}' >> .eslintrc.json
echo -e "5/5 ${YELLOW}Creating Custom Prettier Config... ${NC}"
touch .prettierrc
echo '{
"printWidth": 100,
"singleQuote": true
}' >> .prettierrc
echo -e "${GREEN}Done! ${NC}"