Created
June 22, 2020 20:39
-
-
Save Luke-Rogerson/64cfaa5305074b8bbc766ce06a4ba8dc to your computer and use it in GitHub Desktop.
Setup TypeScript, eslint and prettier in a new JavaScript project
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
generate: | |
@echo "Adding TypeScript as dependency..." | |
@yarn add typescript -D | |
@echo "Creating tsconfig..." | |
@npx tsconfig.json | |
@echo "Adding eslint and prettier dependencies..." | |
@yarn add eslint prettier eslint-config-airbnb-typescript-prettier -D | |
@echo "Creating eslint config..." | |
@touch .eslintrc.js | |
@echo "module.exports = {\n extends: ['airbnb-typescript-prettier'],\n rules: {\n // just say 'no' to default exports!\n 'import/prefer-default-export': 'off',\n 'import/no-default-export': 'error',\n }\n };" >> .eslintrc.js | |
@echo "Creating prettier config..." | |
@touch .prettierrc.js | |
@echo "module.exports = {\n trailingComma: 'es5',\n tabWidth: 4,\n semi: false,\n singleQuote: true,\n bracketSpacing: true,\n jsxBracketSameLine: false,\n printWidth: 120,\n endOfLine: 'lf'\n}" >> .prettierrc.js | |
@echo "----------------------------------------" | |
@echo "Finished!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment