当前位置: 首页 > news >正文

Next.js v15 eslint 规则配置

在这里插入图片描述

问题
An empty interface declaration allows any non-nullish value, including literals like 0 and "".

  • If that’s what you want, disable this lint rule with an inline comment or configure the ‘allowInterfaces’ rule option.
  • If you want a type meaning “any object”, you probably want object instead.
  • If you want a type meaning “any value”, you probably want unknown instead.eslint@typescript-eslint/no-empty-object-type

新增 规则

 ...compat.config({rules: {"@typescript-eslint/no-empty-object-type": "off",},}),

or

...compat.config({rules: {allowInterfaces: 'with-single-extends'},}),
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);const compat = new FlatCompat({baseDirectory: __dirname,
});const eslintConfig = [...compat.extends("next/core-web-vitals", "next/typescript"),...compat.config({rules: {// "@typescript-eslint/no-empty-object-type": "off",allowInterfaces: "with-single-extends",},}),
];export default eslintConfig;

相关文章:

  • Spring Boot知识点详解
  • 27、Session有什么重⼤BUG?微软提出了什么⽅法加以解决?
  • 【基础】Node.js 介绍、安装及npm 和 npx功能了解
  • 如何快速高效学习Python?
  • 界面开发框架DevExpress XAF实践:如何在Blazor项目中集成.NET Aspire?(二)
  • (第三篇)Springcloud之Ribbon负载均衡
  • 精益数据分析(21/126):剖析创业增长引擎与精益画布指标
  • 从码云上拉取项目并在idea配置npm时完整步骤
  • 【Spring Boot】深入解析:#{} 和 ${}
  • 算法笔记.spfa算法(bellman-ford算法的改进)
  • 五、web自动化测试01
  • 电脑怎么强制退出程序回到桌面 详细操作步骤
  • 为什么要提出Null-text Inversion
  • 力扣热题100题解(c++)—矩阵
  • 深入详解人工智能数学基础——概率论中的KL散度在变分自编码器中的应用
  • Java面试实战:音视频场景下的微服务架构与缓存技术剖析
  • 26考研 | 王道 | 数据结构 | 第七章 查找
  • Windows下使用 VS Code + g++ 开发 Qt GUI 项目的完整指南
  • 2、DevEco Studio的使用
  • 【网络安全】社会工程学策略
  • 视觉周刊|2025上海车展的科技范
  • 出国留学、来华留学呈现双增新趋势,“00后留学生个性鲜明”
  • 龚曙光:散文家永远只有一个视角,就是“我与时代”
  • 政治局会议:创设新的结构性货币政策工具,设立新型政策性金融工具,支持科技创新、扩大消费、稳定外贸等
  • 何以中国|福建武夷山:千年茶道的文旅“破圈”与新生
  • 特斯拉季度利润暴跌71%,马斯克下月开始大幅减少为政府工作时间