set up eslint and prettier

This commit is contained in:
2026-02-12 20:54:14 +01:00
parent 759e336956
commit 316055652f
60 changed files with 12758 additions and 2724 deletions

View File

@@ -0,0 +1,3 @@
import { tanstackConfig } from "@tanstack/eslint-config";
export default [...tanstackConfig];

View File

@@ -0,0 +1,20 @@
{
"name": "@zendegi/eslint-config",
"version": "0.0.0",
"private": true,
"type": "module",
"exports": {
"./base": "./base.js",
"./react": "./react.js"
},
"dependencies": {
"@tanstack/eslint-config": "^0.3.4",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.0",
"eslint-plugin-react-hooks": "^5.1.0"
},
"peerDependencies": {
"eslint": "^9.0.0",
"typescript": "^5.0.0"
}
}

38
packages/eslint-config/react.js vendored Normal file
View File

@@ -0,0 +1,38 @@
import jsxA11y from "eslint-plugin-jsx-a11y";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import baseConfig from "./base.js";
export default [
...baseConfig,
{
files: ["**/*.tsx", "**/*.jsx"],
...react.configs.flat.recommended,
...react.configs.flat["jsx-runtime"],
settings: {
react: { version: "detect" },
},
rules: {
...react.configs.flat.recommended.rules,
...react.configs.flat["jsx-runtime"].rules,
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
},
},
{
files: ["**/*.tsx", "**/*.jsx"],
plugins: { "react-hooks": reactHooks },
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
},
{
files: ["**/*.tsx", "**/*.jsx"],
...jsxA11y.flatConfigs.recommended,
rules: {
...jsxA11y.flatConfigs.recommended.rules,
"jsx-a11y/label-has-associated-control": ["error", { assert: "either" }],
},
},
];