Skip to content

Instantly share code, notes, and snippets.

@ezy
Forked from atkinsio/lint.sh
Created March 30, 2020 03:48
Show Gist options
  • Save ezy/fef036a8d79436b250d7da50ccef614a to your computer and use it in GitHub Desktop.
Save ezy/fef036a8d79436b250d7da50ccef614a to your computer and use it in GitHub Desktop.
[Install ESLint & Prettier] #eslint #prettier #npm #bash
#!/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