Skip to content

Commit d3ddbad

Browse files
author
Esteban Ordano
committed
chore: warning-free, vulnerability-free install; jest 30 without ts-jest
npm install went from 22 audit vulnerabilities (2 critical), 5 engine warnings and 13 deprecation warnings to 0/0/1 (string-similarity, only fixable in @dcl/eslint-config). overrides pin patched transitives (protobufjs, semver, minimatch, zod, ajv, test-exclude, brace-expansion, js-yaml); jest 30 compiles tests through babel-jest instead of ts-jest; eslint 9 flat config keeps the project-local rules; node builtins replace uuid, glob, colorette, portfinder, fp-future, open, prompts, undici and text-encoding; snapshots regenerated (protobufjs 7.6.3 shifts bundle sizes).
1 parent 0f012e0 commit d3ddbad

80 files changed

Lines changed: 7612 additions & 11325 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 42 deletions
This file was deleted.

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ The repo is orchestrated via **`make`** (the Makefile is the source of truth —
4949
The full Jest suite is slow. For faster iteration, scope to a path pattern:
5050

5151
```bash
52-
node_modules/.bin/jest --colors --forceExit --testPathPattern='test/sdk-commands'
53-
node_modules/.bin/jest --colors --forceExit --testPathPattern='test/ecs'
54-
node_modules/.bin/jest --colors --forceExit --testPathPattern='test/react-ecs'
55-
node_modules/.bin/jest --colors --forceExit --testPathPattern='test/snapshots'
52+
node_modules/.bin/jest --colors --forceExit --testPathPatterns='test/sdk-commands'
53+
node_modules/.bin/jest --colors --forceExit --testPathPatterns='test/ecs'
54+
node_modules/.bin/jest --colors --forceExit --testPathPatterns='test/react-ecs'
55+
node_modules/.bin/jest --colors --forceExit --testPathPatterns='test/snapshots'
5656
```
5757

5858
### Per-package typecheck

eslint.config.mjs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { FlatCompat } from '@eslint/eslintrc'
2+
import path from 'path'
3+
import { fileURLToPath } from 'url'
4+
5+
// @dcl/eslint-config still publishes an eslintrc-style config; wrap it for eslint 9.
6+
const compat = new FlatCompat({ baseDirectory: path.dirname(fileURLToPath(import.meta.url)) })
7+
8+
export default [
9+
...compat.config({
10+
extends: '@dcl/eslint-config/sdk',
11+
parserOptions: {
12+
project: [
13+
'packages/@dcl/ecs/tsconfig.json',
14+
'packages/@dcl/sdk-commands/tsconfig.json',
15+
'packages/@dcl/sdk/tsconfig.json',
16+
'packages/@dcl/playground-assets/tsconfig.json',
17+
'packages/@dcl/react-ecs/tsconfig.json',
18+
'scripts/tsconfig.json',
19+
'test/tsconfig.json',
20+
'test/ecs/snippets/tsconfig.json'
21+
]
22+
}
23+
}),
24+
{
25+
rules: {
26+
'no-param-reassign': 'warn',
27+
'no-console': 'error',
28+
'@typescript-eslint/no-unused-vars': [
29+
'warn',
30+
{
31+
ignoreRestSiblings: true,
32+
argsIgnorePattern: '^_',
33+
varsIgnorePattern: '^_|ReactEcs',
34+
caughtErrorsIgnorePattern: '^_'
35+
}
36+
]
37+
}
38+
},
39+
{
40+
files: ['packages/@dcl/ecs/**/*.ts', 'packages/@dcl/sdk/**/*.ts', 'scripts/**/*.ts', 'test/**/*.ts'],
41+
rules: { 'no-console': 'off' }
42+
},
43+
{
44+
ignores: [
45+
'**/*.gen.ts',
46+
'**/dist/**',
47+
'**/node_modules/**',
48+
'**/*.d.ts',
49+
'**/*.js',
50+
'packages/@dcl/ecs/dist/**',
51+
'packages/@dcl/ecs/src/components/generated',
52+
'packages/@dcl/js-runtime',
53+
'packages/@dcl/playground-assets/dist',
54+
'packages/@dcl/sdk/dist/**',
55+
'packages/@dcl/sdk/internal/**',
56+
'packages/@dcl/sdk/testing/**',
57+
'test/sdk/simple-scene',
58+
'tmp'
59+
]
60+
}
61+
]

jest.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ module.exports = {
33
moduleFileExtensions: ['ts', 'js', 'tsx', 'jsx'],
44
transform: {
55
'^.+\\.(js|jsx|ts|tsx)$': [
6-
'ts-jest',
6+
'babel-jest',
77
{
8-
tsconfig: 'test/tsconfig.json'
8+
presets: [['@babel/preset-typescript', { isTSX: true, allExtensions: true, onlyRemoveTypeImports: true }]],
9+
plugins: [
10+
'@babel/plugin-transform-modules-commonjs',
11+
'@babel/plugin-transform-dynamic-import',
12+
['@babel/plugin-transform-react-jsx', { pragma: 'ReactEcs.createElement' }]
13+
]
914
}
1015
]
1116
},

0 commit comments

Comments
 (0)