采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
运行npx eslint --init 无法生成.eslintrc.js,生成了eslint.config.mjs,怎么使用?
这是我的配置,供参考:
import globals from "globals"; import pluginJs from "@eslint/js"; import tseslint from "typescript-eslint"; import pluginReactConfig from "eslint-plugin-react/configs/recommended.js"; import { fixupConfigRules } from "@eslint/compat"; export default [ {files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]}, { languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } }, {languageOptions: { globals: globals.browser }}, pluginJs.configs.recommended, ...tseslint.configs.recommended, ...fixupConfigRules(pluginReactConfig), ];
都是 eslint 的配置文件,配置内容都是一样的。
格式可参考 https://eslint.org/docs/latest/use/configure/configuration-files
运行npm run lint 提示: > react-ts-demo@0.1.0 lint > eslint 'src/**/*.+(js/|ts|jsx|tsx)' Oops! Something went wrong! :( ESLint: 8.57.1 No files matching the pattern "src/**/*.+(js/|ts|jsx|tsx)" were found. Please check for typing mistakes in the pattern.
登录后可查看更多问答,登录/注册
React18+TS4+Antd5+Next.js13 ,B端+C 端,完整业务
1.6k 12
386 8
391 8
570 8
719 7
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号