Skip to content

Change eslint config to support Preact #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/js/bun.lockb
Binary file not shown.
20 changes: 3 additions & 17 deletions src/js/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import react from "eslint-plugin-react";
import globals from "globals";
import path from "node:path";
import globals from "globals";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
Expand All @@ -13,13 +12,10 @@ const compat = new FlatCompat({
allConfig: js.configs.all,
});

// ESLint config for Preact project
export default [
...compat.extends("eslint:recommended", "plugin:react/recommended"),
...compat.extends("eslint:recommended"),
{
plugins: {
react,
},

languageOptions: {
globals: {
...globals.browser,
Expand All @@ -29,15 +25,5 @@ export default [
ecmaVersion: "latest",
sourceType: "module",
},

settings: {
react: {
version: "18.2.0",
},
},

rules: {
"react/prop-types": "off",
},
},
];
27 changes: 15 additions & 12 deletions src/js/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
{
"type": "module",
"scripts": {
"format": "prettier --write . && eslint --fix",
"check": "prettier --check . && eslint"
},
"devDependencies": {
"eslint": "^9.13.0",
"eslint-plugin-react": "^7.37.1",
"prettier": "^3.3.3",
"bun-types": "^0.5.0"
},
"dependencies": {
"@pyscript/core": "^0.6",
"@reactpy/client": "^0.3.2",
Expand All @@ -18,5 +7,19 @@
"preact": "^10.26.9",
"react": "npm:@preact/[email protected]",
"react-dom": "npm:@preact/[email protected]"
}
},
"devDependencies": {
"bun-types": "^0.5.0",
"eslint": "^9.13.0",
"eslint-config-preact": "^1.5.0",
"prettier": "^3.3.3"
},
"eslintConfig": {
"extends": "preact"
},
"scripts": {
"check": "prettier --check . && eslint",
"format": "prettier --write . && eslint --fix"
},
"type": "module"
}
2 changes: 0 additions & 2 deletions src/js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"compilerOptions": {
"allowImportingTsExtensions": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"declaration": true,
Expand All @@ -14,7 +13,6 @@
"module": "Preserve",
"moduleDetection": "force",
"moduleResolution": "bundler",
"noEmit": true,
"noEmitOnError": true,
"noUnusedLocals": true,
"paths": {
Expand Down