Skip to content

Commit

Permalink
chore: move type:check to lint hook (#3381)
Browse files Browse the repository at this point in the history
* refactor: move type:check to lint hook

- Removed type:check from pretest, build, and postbuild scripts
- Added type checking to lint command
- Improves development speed by reducing redundant type checks

Fixes #3248

* refactor: move type:check to lint hook- Removed type:check from pretest, build, and postbuild scripts- Added type checking to lint command- Improves development speed by reducing redundant type checksFixes #3248

* Add type:check to turbo tasks and update root package.json lint script

* Add type:check to turbo tasks and update root package.json lint script

* chore: add changeset for type checking updates

* Update packages/create-fuels/package.json

Co-authored-by: Peter Smith <[email protected]>

* Update .changeset/polite-seas-taste.md

Co-authored-by: Peter Smith <[email protected]>

* Update packages/fuel-gauge/package.json

Co-authored-by: Peter Smith <[email protected]>

* Update packages/fuels/package.json

Co-authored-by: Peter Smith <[email protected]>

* Update internal/benchmarks/package.json

Co-authored-by: Peter Smith <[email protected]>

* Update package.json

Co-authored-by: Peter Smith <[email protected]>

* Update .changeset/polite-seas-taste.md

Co-authored-by: Peter Smith <[email protected]>

* Update apps/docs-snippets/package.json

Co-authored-by: Peter Smith <[email protected]>

---------

Co-authored-by: Chad Nehemiah <[email protected]>
Co-authored-by: Peter Smith <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent 7f92490 commit 30585c1
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .changeset/polite-seas-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

chore: move type:check to lint hook
3 changes: 2 additions & 1 deletion apps/docs-snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "",
"private": true,
"scripts": {
"pretest": "./scripts/pretest.sh"
"pretest": "./scripts/pretest.sh",
"type:check": "tsc --noEmit"
},
"devDependencies": {
"@fuel-ts/account": "workspace:*",
Expand Down
3 changes: 0 additions & 3 deletions apps/docs-snippets/scripts/pretest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ pnpm fuels build

# Deploys projects (needed for loader bytecode)
pnpm fuels deploy

# Checks for type errors
pnpm tsc --noEmit
2 changes: 1 addition & 1 deletion internal/benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"scripts": {
"type:check": "tsc --noEmit",
"pretest": "run-s build:forc type:check",
"pretest": "run-s build:forc ",
"build:forc": "pnpm fuels build"
},
"license": "Apache-2.0",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@
"clinic:doctor": "clinic doctor --autocannon [ / ] -- node packages/${npm_config_package_name}/dist/profile.js",
"clinic:heap": "clinic heapprofiler --autocannon [ / ] -- node packages/${npm_config_package_name}/dist/profile.js",
"test:integration": "vitest --run --config vitest.node.config.mts $(scripts/tests-find.sh --integration)",
"lint": "run-s type:check-tests lint:check prettier:check",
"lint": "run-s type:check-tests lint:check prettier:check type:check",
"lint:check": "eslint . --ext .ts --max-warnings 0",
"lint:fix": "pnpm lint:check --fix",
"lint:md-links": "tsx ./scripts/lint-md-links",
"lint:package-jsons": "tsx ./scripts/lint-package-jsons",
"type:check": "turbo run type:check",
"type:check-tests": "tsc -p tsconfig.test.json",
"prettier:check": "prettier --check packages --check apps/docs-snippets",
"prettier:format": "prettier --write packages --check apps/docs-snippets",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"license": "Apache-2.0",
"scripts": {
"build": "run-s build:source type:check",
"build": "run-s build:source",
"build:source": "tsup",
"type:check": "tsc --noEmit",
"prepublishOnly": "tsx ./scripts/prepublish.ts"
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-gauge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"scripts": {
"pretest": "run-s build:forc build:process-predicates type:check",
"pretest": "run-s build:forc build:process-predicates",
"build:forc": "pnpm fuels build",
"build:process-predicates": "tsx ./scripts/process-predicates.ts",
"type:check": "tsc --noEmit"
Expand Down
2 changes: 1 addition & 1 deletion packages/fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"build:package": "tsup",
"build:browser": "pnpm vite build",
"build:minified": "pnpm uglifyjs --compress --mangle --output dist/browser.min.mjs -- dist/browser.mjs",
"postbuild": "run-s type:declarations type:check",
"postbuild": "run-s type:declarations",
"type:declarations": "tsc --emitDeclarationOnly -p tsconfig.dts.json",
"type:check": "tsc --noEmit",
"prepublishOnly": "cp ../../README.md ./README.md"
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "https://turborepo.org/schema.json",
"tasks": {
"type:check": {
"outputLogs": "errors-only"
},
"preinstall": {
"outputLogs": "new-only"
},
Expand Down

0 comments on commit 30585c1

Please sign in to comment.