set up eslint and prettier
This commit is contained in:
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