set up eslint and prettier
This commit is contained in:
3
packages/eslint-config/base.js
Normal file
3
packages/eslint-config/base.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import { tanstackConfig } from "@tanstack/eslint-config";
|
||||
|
||||
export default [...tanstackConfig];
|
||||
20
packages/eslint-config/package.json
Normal file
20
packages/eslint-config/package.json
Normal 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
38
packages/eslint-config/react.js
vendored
Normal 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" }],
|
||||
},
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user