Skip to content

Commit 9a02db4

Browse files
authored
Sync Preact build config with reactpy-django (#1296)
2 parents 6930fc2 + 1e7d5d2 commit 9a02db4

25 files changed

+105
-188
lines changed

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"proseWrap": "never",
3+
"trailingComma": "all"
4+
}

src/js/README.md

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

src/js/bun.lockb

-45.5 KB
Binary file not shown.

src/js/eslint.config.mjs

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,25 @@
1-
import react from "eslint-plugin-react";
2-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
1+
import { default as eslint } from "@eslint/js";
32
import globals from "globals";
4-
import tsParser from "@typescript-eslint/parser";
5-
import path from "node:path";
6-
import { fileURLToPath } from "node:url";
7-
import js from "@eslint/js";
8-
import { FlatCompat } from "@eslint/eslintrc";
9-
10-
const __filename = fileURLToPath(import.meta.url);
11-
const __dirname = path.dirname(__filename);
12-
const compat = new FlatCompat({
13-
baseDirectory: __dirname,
14-
recommendedConfig: js.configs.recommended,
15-
allConfig: js.configs.all,
16-
});
3+
import tseslint from "typescript-eslint";
174

185
export default [
19-
...compat.extends(
20-
"eslint:recommended",
21-
"plugin:react/recommended",
22-
"plugin:@typescript-eslint/recommended",
23-
),
24-
{
25-
ignores: ["**/node_modules/", "**/dist/"],
26-
},
6+
eslint.configs.recommended,
7+
...tseslint.configs.recommended,
8+
{ ignores: ["**/node_modules/", "**/dist/"] },
279
{
28-
plugins: {
29-
react,
30-
"@typescript-eslint": typescriptEslint,
31-
},
32-
3310
languageOptions: {
3411
globals: {
3512
...globals.browser,
3613
...globals.node,
3714
},
38-
39-
parser: tsParser,
4015
ecmaVersion: "latest",
4116
sourceType: "module",
4217
},
43-
44-
settings: {
45-
react: {
46-
version: "detect",
47-
},
48-
},
49-
5018
rules: {
5119
"@typescript-eslint/ban-ts-comment": "off",
5220
"@typescript-eslint/no-explicit-any": "off",
5321
"@typescript-eslint/no-non-null-assertion": "off",
5422
"@typescript-eslint/no-empty-function": "off",
55-
"react/prop-types": "off",
5623
},
5724
},
5825
];

src/js/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
22
"devDependencies": {
3-
"@eslint/eslintrc": "^3.2.0",
4-
"@eslint/js": "^9.18.0",
5-
"@typescript-eslint/eslint-plugin": "^8.21.0",
6-
"@typescript-eslint/parser": "^8.21.0",
3+
"@eslint/js": "^9.29.0",
4+
"bun-types": "^1.2.16",
75
"eslint": "^9.18.0",
8-
"eslint-plugin-react": "^7.37.4",
96
"globals": "^15.14.0",
10-
"prettier": "^3.4.2"
7+
"prettier": "^3.4.2",
8+
"typescript-eslint": "^8.34.0"
119
},
1210
"license": "MIT",
1311
"scripts": {
14-
"lint": "prettier --check . && eslint",
15-
"format": "prettier --write . && eslint --fix"
12+
"format": "prettier --write . && eslint --fix",
13+
"lint": "prettier --check . && eslint"
1614
}
1715
}
420 Bytes
Binary file not shown.

src/js/packages/@reactpy/app/eslint.config.mjs

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

src/js/packages/@reactpy/app/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": "@reactpy/app",
3-
"description": "ReactPy's client-side entry point. This is strictly for internal use and is not designed to be distributed.",
4-
"license": "MIT",
52
"dependencies": {
63
"@reactpy/client": "file:../client",
74
"event-to-object": "file:../../event-to-object",
85
"preact": "^10.25.4"
96
},
7+
"description": "ReactPy's client-side entry point. This is strictly for internal use and is not designed to be distributed.",
108
"devDependencies": {
11-
"typescript": "^5.7.3",
129
"@pyscript/core": "^0.6",
13-
"morphdom": "^2"
10+
"morphdom": "^2",
11+
"typescript": "^5.8.3"
1412
},
13+
"license": "MIT",
14+
"name": "@reactpy/app",
1515
"scripts": {
1616
"build": "bun build \"src/index.ts\" --outdir=\"../../../../reactpy/static/\" --minify --sourcemap=\"linked\"",
1717
"checkTypes": "tsc --noEmit"

src/js/packages/@reactpy/app/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"extends": "../../../tsconfig.json",
32
"compilerOptions": {
3+
"composite": true,
44
"outDir": "dist",
5-
"rootDir": "src",
6-
"composite": true
5+
"rootDir": "src"
76
},
7+
"extends": "../../../tsconfig.json",
88
"include": ["src"],
99
"references": [
1010
{
-1.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)