Skip to content

Commit

Permalink
update template-react-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Dec 11, 2023
1 parent e6c2563 commit 96c44fd
Show file tree
Hide file tree
Showing 12 changed files with 178 additions and 286 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"setup": "scripts/runTemplates.sh 'pnpm install'",
"postbuild": "shebang-trim dist/index.js dist/index.cjs",
"prettify": "prettier --write src/ templates/",
"lint": "scripts/runTemplates.sh 'npm run lint'",
"prettycheck": "scripts/runTemplates.sh 'npm run prettycheck'",
"typecheck": "scripts/runTemplates.sh 'npm run typecheck'",
"lint": "scripts/runTemplates.sh 'npm run lint' --ignore astro",
"prettycheck": "scripts/runTemplates.sh 'npm run prettycheck' --ignore astro",
"typecheck": "scripts/runTemplates.sh 'npm run typecheck' --ignore astro",
"test": "npm run lint && npm run prettycheck && npm run typecheck",
"prepublishOnly": "npm run build"
},
Expand Down
11 changes: 10 additions & 1 deletion scripts/runTemplates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@ do
--eval)
eval="$1"
shift;;
--ignore)
ignore="$1"
shift;;
--bail)
bail=1
esac
done

allTemplates=$(find templates -maxdepth 1 -mindepth 1 -type d | awk -F'/' 'NF!=1{print $2}' | sort -u)
if [[ -z $ignore ]]; then
ignore="none"
fi

allTemplates=$(find templates -maxdepth 1 -mindepth 1 -type d -not -iname "template-${ignore}*" | awk -F'/' 'NF!=1{print $2}' | sort -u)

for template in ${allTemplates[@]}; do
cd templates/${template}
Expand Down
4 changes: 0 additions & 4 deletions templates/template-react-ts/.eslintrc

This file was deleted.

5 changes: 5 additions & 0 deletions templates/template-react-ts/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["@mgcrea/react"],
root: true,
};
4 changes: 0 additions & 4 deletions templates/template-react-ts/.prettierrc

This file was deleted.

5 changes: 5 additions & 0 deletions templates/template-react-ts/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import("prettier").Config} */
export default {
printWidth: 111,
plugins: ["prettier-plugin-organize-imports"],
};
2 changes: 1 addition & 1 deletion templates/template-react-ts/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
11 changes: 5 additions & 6 deletions templates/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "tsc && vite build",
"preview": "vite preview",
"prettify": "prettier --write src/ test/",
"lint": "eslint src/ test/",
"lint": "eslint src/ test/ --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"prettycheck": "prettier --check src/ test/",
"typecheck": "tsc --noEmit",
"spec": "vitest --run",
Expand All @@ -21,22 +21,21 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@mgcrea/eslint-config-react": "^0.9.3",
"@mgcrea/eslint-config-react": "^0.9.4",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@tsconfig/vite-react": "^2.0.1",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@types/testing-library__jest-dom": "^5.14.9",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.55.0",
"happy-dom": "^12.10.3",
"prettier": "^3.1.0",
"prettier": "^3.1.1",
"prettier-plugin-organize-imports": "^3.2.4",
"typescript": "^5.3.3",
"vite": "^5.0.7",
"vitest": "^1.0.3"
"vitest": "^1.0.4",
"vitest-dom": "^0.1.1"
}
}

0 comments on commit 96c44fd

Please sign in to comment.