diff --git a/.dependency-cruiser.cjs b/.dependency-cruiser.cjs
index b7de80a70de..40a9785aeaf 100644
--- a/.dependency-cruiser.cjs
+++ b/.dependency-cruiser.cjs
@@ -1,6 +1,17 @@
/** @type {import('dependency-cruiser').IConfiguration} */
module.exports = {
forbidden: [
+ {
+ name: "only-type-imports",
+ severity: "error",
+ comment: "Files in enums and @types may only use type imports.",
+ from: {
+ path: ["(^|/)src/@types", "(^|/)src/enums"],
+ },
+ to: {
+ dependencyTypesNot: ["type-only"],
+ },
+ },
{
name: "no-circular-at-runtime",
severity: "warn",
@@ -31,6 +42,8 @@ module.exports = {
"[.]d[.]ts$", // TypeScript declaration files
"(^|/)tsconfig[.]json$", // TypeScript config
"(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$", // other configs
+ // anything in src/@types
+ "(^|/)src/@types/",
],
},
to: {},
diff --git a/.github/test-filters.yml b/.github/test-filters.yml
index 89f4322adea..fc52e85082c 100644
--- a/.github/test-filters.yml
+++ b/.github/test-filters.yml
@@ -1,7 +1,8 @@
all:
- - "src/**"
- - "test/**"
- - "public/**"
+ # Negations syntax from https://github.com/dorny/paths-filter/issues/184#issuecomment-2786521554
+ - "src/**/!(*.{md,py,sh,gitkeep,gitignore})"
+ - "test/**/!(*.{md,py,sh,gitkeep,gitignore})"
+ - "public/**/!(*.{md,py,sh,gitkeep,gitignore})"
# Workflows that can impact tests
- ".github/workflows/test*.yml"
- ".github/test-filters.yml"
@@ -11,9 +12,4 @@ all:
- "vite*" # vite.config.ts, vite.vitest.config.ts, vitest.workspace.ts
- "tsconfig*.json" # tsconfig.json tweaking can impact compilation
- "global.d.ts"
- - ".env*"
- # Blanket negations for files that cannot impact tests
- - "!**/*.py" # No .py files
- - "!**/*.sh" # No .sh files
- - "!**/*.md" # No .md files
- - "!**/.git*" # .gitkeep and family
+ - ".env*"
\ No newline at end of file
diff --git a/.github/workflows/test-shard-template.yml b/.github/workflows/test-shard-template.yml
index a1146cb3497..98836bd335a 100644
--- a/.github/workflows/test-shard-template.yml
+++ b/.github/workflows/test-shard-template.yml
@@ -19,19 +19,20 @@ on:
jobs:
test:
- name: Shard ${{ inputs.shard }} of ${{ inputs.totalShards }}
+ # We can't use dynmically named jobs until https://github.com/orgs/community/discussions/13261 is implemented
+ name: Shard
runs-on: ubuntu-latest
if: ${{ !inputs.skip }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4.2.2
with:
- submodules: 'recursive'
+ submodules: "recursive"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
- node-version-file: '.nvmrc'
- cache: 'npm'
+ node-version-file: ".nvmrc"
+ cache: "npm"
- name: Install Node.js dependencies
run: npm ci
- name: Run tests
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index f04a1987eff..c3b9666caa9 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -25,6 +25,7 @@ jobs:
- name: checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
+ id: filter
with:
filters: .github/test-filters.yml
@@ -33,10 +34,10 @@ jobs:
needs: check-path-change-filter
strategy:
matrix:
- shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ shard: [1, 2, 3, 4, 5]
uses: ./.github/workflows/test-shard-template.yml
with:
project: main
shard: ${{ matrix.shard }}
- totalShards: 10
- skip: ${{ needs.check-path-change-filter.outputs.all == 'false'}}
+ totalShards: 5
+ skip: ${{ needs.check-path-change-filter.outputs.all != 'true'}}
diff --git a/biome.jsonc b/biome.jsonc
index 3385614635c..82ce7c308dc 100644
--- a/biome.jsonc
+++ b/biome.jsonc
@@ -31,8 +31,6 @@
"src/overrides.ts",
// TODO: these files are too big and complex, ignore them until their respective refactors
"src/data/moves/move.ts",
- "src/data/abilities/ability.ts",
- "src/field/pokemon.ts",
// this file is just too big:
"src/data/balance/tms.ts"
@@ -43,9 +41,6 @@
// TODO: Remove if we ever get down to 0 circular imports
"organizeImports": { "enabled": false },
"linter": {
- "ignore": [
- "src/phases/move-effect-phase.ts" // TODO: unignore after move-effect-phase refactor
- ],
"enabled": true,
"rules": {
"recommended": true,
@@ -58,7 +53,7 @@
},
"style": {
"noVar": "error",
- "useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome
+ "useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome
"useBlockStatements": "error",
"useConst": "error",
"useImportType": "error",
@@ -73,9 +68,9 @@
},
"suspicious": {
"noDoubleEquals": "error",
- // While this would be a nice rule to enable, the current structure of the codebase makes this infeasible
+ // While this would be a nice rule to enable, the current structure of the codebase makes this infeasible
// due to being used for move/ability `args` params and save data-related code.
- // This can likely be enabled for all non-utils files once these are eventually reworked, but until then we leave it off.
+ // This can likely be enabled for all non-utils files once these are eventually reworked, but until then we leave it off.
"noExplicitAny": "off",
"noAssignInExpressions": "off",
"noPrototypeBuiltins": "off",
@@ -92,6 +87,19 @@
"noUselessSwitchCase": "off", // Explicit > Implicit
"noUselessConstructor": "warn", // TODO: Refactor and make this an error
"noBannedTypes": "warn" // TODO: Refactor and make this an error
+ },
+ "nursery": {
+ "noRestrictedTypes": {
+ "level": "error",
+ "options": {
+ "types": {
+ "integer": {
+ "message": "This is an alias for 'number' that can provide false impressions of what values can actually be contained in this variable. Use 'number' instead.",
+ "use": "number"
+ }
+ }
+ }
+ }
}
}
},
diff --git a/index.html b/index.html
index 111464b5e5c..d503617c13c 100644
--- a/index.html
+++ b/index.html
@@ -145,6 +145,5 @@
-