Skip to content

Instantly share code, notes, and snippets.

@AlexZeitler
Last active May 2, 2021 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexZeitler/0c400fe38e06fd2a42b93d540ff568fd to your computer and use it in GitHub Desktop.
Save AlexZeitler/0c400fe38e06fd2a42b93d540ff568fd to your computer and use it in GitHub Desktop.
TypeScript + React + Tailwind + VS Code Project settings
root = false
[**/**.{yml,ts,tsx,js,json,jsx,html}]
indent_style = space
indent_size = 2
insert_final_newline = true
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended'
],
env: {
node: true,
mocha: true,
es6: true
},
plugins: ['@typescript-eslint', 'prettier'],
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
module.exports = {
printWidth: 80,
tabWidth: 2,
singleQuote: true,
quoteProps: 'as-needed',
trailingComma: 'none',
bracketSpacing: true,
semi: false,
useTabs: false,
jsxBracketSameLine: false,
proseWrap: 'never'
}
@tailwind base;
@tailwind components;
@tailwind utilities;
module.exports = {
extends: ['@commitlint/config-conventional']
}
#!/usr/bin/env bash
# Usage: ./install.sh <TARGET_PATH> (without trailing /)
TARGET=$1
echo "Installing files to ${TARGET}"
read -p "Are you sure? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "OK"
cp .editorconfig .eslintrc.js .prettierrc.js .nvmrc commitlint.config.js postcss.config.js tailwind.config.js "${TARGET}"
cp App.css "${TARGET}/src/"
mkdir "${TARGET}/.vscode" && cp settings.json "${TARGET}/.vscode/"
cd "${TARGET}"
yarn add --dev typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-import eslint-plugin-prettier prettier eslint-watch @commitlint/cli @commitlint/config-conventional @types/node@14 jest @types/jest tailwindcss@latest @tailwindcss/forms postcss@latest autoprefixer@latest
git ignore node,jetbrains+all,visualstudiocode,macos >>.gitignore
npx husky-init && yarn
rm .husky/pre-commit
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit $1'
fi
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}
{
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
plugins: [require('@tailwindcss/forms')],
variants: {
extend: {
opacity: ['disabled']
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment