Last active
February 16, 2023 13:01
-
-
Save atkinsio/731e20d6ae5a1bbb20d9d9ef0960a29f to your computer and use it in GitHub Desktop.
[Install ESLint & Prettier] #eslint #prettier #npm #bash
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
#!/bin/bash | |
npm install -D eslint prettier | |
npm install -D eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-import eslint-plugin-react babel-eslint | |
npm install -D eslint-config-prettier eslint-plugin-prettier | |
> ".eslintrc.js" | |
echo 'module.exports = { | |
"extends": [ | |
"airbnb", | |
"plugin:prettier/recommended", | |
"prettier/react" | |
], | |
"env": { | |
"browser": true, | |
"commonjs": true, | |
"es6": true, | |
"jest": true, | |
"node": true | |
}, | |
"rules": { | |
"no-console": "off", | |
"jsx-a11y/href-no-hash": ["off"], | |
"react/jsx-filename-extension": ["warn", { "extensions": [".js", ".jsx"] }], | |
"max-len": [ | |
"warn", | |
{ | |
"code": 100, | |
"tabWidth": 2, | |
"comments": 100, | |
"ignoreComments": false, | |
"ignoreTrailingComments": true, | |
"ignoreUrls": true, | |
"ignoreStrings": true, | |
"ignoreTemplateLiterals": true, | |
"ignoreRegExpLiterals": true | |
} | |
] | |
} | |
}' >> .eslintrc.js | |
> .prettierrc.js | |
echo 'module.exports = { | |
"printWidth": 100, | |
"singleQuote": true, | |
"trailingComma": "none" | |
}' >> .prettierrc.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment