代码拉取完成,页面将自动刷新
import globals from "./server/node_modules/globals/index.js"
import eslintRecommended from "./server/node_modules/@eslint/js/src/index.js"
import eslintConfigPrettier from "./server/node_modules/eslint-config-prettier/index.js"
import prettier from "./server/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js"
import react from "./server/node_modules/eslint-plugin-react/index.js"
import reactRefresh from "./server/node_modules/eslint-plugin-react-refresh/index.js"
import reactHooks from "./server/node_modules/eslint-plugin-react-hooks/index.js"
import ftFlow from "./server/node_modules/eslint-plugin-ft-flow/dist/index.js"
import hermesParser from "./server/node_modules/hermes-eslint/dist/index.js"
const reactRecommended = react.configs.recommended
const jsxRuntime = react.configs["jsx-runtime"]
export default [
eslintRecommended.configs.recommended,
eslintConfigPrettier,
{
ignores: ["**/*.test.js"],
languageOptions: {
parser: hermesParser,
parserOptions: {
ecmaFeatures: { jsx: true }
},
ecmaVersion: 2020,
sourceType: "module",
globals: {
...globals.browser,
...globals.es2020,
...globals.node
}
},
linterOptions: { reportUnusedDisableDirectives: true },
settings: { react: { version: "18.2" } },
plugins: {
ftFlow,
react,
"jsx-runtime": jsxRuntime,
"react-hooks": reactHooks,
prettier
},
rules: {
...reactRecommended.rules,
...reactHooks.configs.recommended.rules,
...ftFlow.recommended,
"no-unused-vars": "warn",
"no-undef": "warn",
"no-empty": "warn",
"no-extra-boolean-cast": "warn",
"prettier/prettier": "warn"
}
},
{
files: ["frontend/src/**/*.js"],
plugins: {
ftFlow,
prettier
},
rules: {
"prettier/prettier": "warn"
}
},
{
files: [
"server/endpoints/**/*.js",
"server/models/**/*.js",
"server/swagger/**/*.js",
"server/utils/**/*.js",
"server/index.js"
],
rules: {
"no-undef": "warn"
}
},
{
files: ["frontend/src/**/*.jsx"],
plugins: {
ftFlow,
react,
"jsx-runtime": jsxRuntime,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
prettier
},
rules: {
...jsxRuntime.rules,
"react/prop-types": "off", // FIXME
"react-refresh/only-export-components": "warn"
}
}
]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。