当前位置: 首页 > 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的使用
  • 【网络安全】社会工程学策略
  • 陈芋汐世界杯总决赛卫冕夺冠,全红婵无缘三大赛“全满贯”
  • 首日5金!中国队夺得跳水世界杯总决赛混合团体冠军
  • 缔造“水饺皇后”的香港,也是被移民塑造的香港
  • 苹果手机为何无法在美制造?全球供应链难迁移
  • 孙磊已任中国常驻联合国副代表、特命全权大使
  • 复星医药换帅:陈玉卿接棒吴以芳任董事长,吴以芳改任复星国际执行总裁