Skip to content

Commit 0ca0f1d

Browse files
authored
Change eslint config to support Preact (#291)
1 parent c0d16c4 commit 0ca0f1d

File tree

4 files changed

+18
-31
lines changed

4 files changed

+18
-31
lines changed

src/js/bun.lockb

20 KB
Binary file not shown.

src/js/eslint.config.mjs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import react from "eslint-plugin-react";
2-
import globals from "globals";
31
import path from "node:path";
2+
import globals from "globals";
43
import { fileURLToPath } from "node:url";
54
import js from "@eslint/js";
65
import { FlatCompat } from "@eslint/eslintrc";
@@ -13,13 +12,10 @@ const compat = new FlatCompat({
1312
allConfig: js.configs.all,
1413
});
1514

15+
// ESLint config for Preact project
1616
export default [
17-
...compat.extends("eslint:recommended", "plugin:react/recommended"),
17+
...compat.extends("eslint:recommended"),
1818
{
19-
plugins: {
20-
react,
21-
},
22-
2319
languageOptions: {
2420
globals: {
2521
...globals.browser,
@@ -29,15 +25,5 @@ export default [
2925
ecmaVersion: "latest",
3026
sourceType: "module",
3127
},
32-
33-
settings: {
34-
react: {
35-
version: "18.2.0",
36-
},
37-
},
38-
39-
rules: {
40-
"react/prop-types": "off",
41-
},
4228
},
4329
];

src/js/package.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
{
2-
"type": "module",
3-
"scripts": {
4-
"format": "prettier --write . && eslint --fix",
5-
"check": "prettier --check . && eslint"
6-
},
7-
"devDependencies": {
8-
"eslint": "^9.13.0",
9-
"eslint-plugin-react": "^7.37.1",
10-
"prettier": "^3.3.3",
11-
"bun-types": "^0.5.0"
12-
},
132
"dependencies": {
143
"@pyscript/core": "^0.6",
154
"@reactpy/client": "^0.3.2",
@@ -18,5 +7,19 @@
187
"preact": "^10.26.9",
198
"react": "npm:@preact/[email protected]",
209
"react-dom": "npm:@preact/[email protected]"
21-
}
10+
},
11+
"devDependencies": {
12+
"bun-types": "^0.5.0",
13+
"eslint": "^9.13.0",
14+
"eslint-config-preact": "^1.5.0",
15+
"prettier": "^3.3.3"
16+
},
17+
"eslintConfig": {
18+
"extends": "preact"
19+
},
20+
"scripts": {
21+
"check": "prettier --check . && eslint",
22+
"format": "prettier --write . && eslint --fix"
23+
},
24+
"type": "module"
2225
}

src/js/tsconfig.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"compilerOptions": {
3-
"allowImportingTsExtensions": true,
43
"allowJs": true,
54
"allowSyntheticDefaultImports": true,
65
"declaration": true,
@@ -14,7 +13,6 @@
1413
"module": "Preserve",
1514
"moduleDetection": "force",
1615
"moduleResolution": "bundler",
17-
"noEmit": true,
1816
"noEmitOnError": true,
1917
"noUnusedLocals": true,
2018
"paths": {

0 commit comments

Comments
 (0)