当前位置: 首页 > 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;
http://www.dtcms.com/a/152123.html

相关文章:

  • 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的使用
  • 【网络安全】社会工程学策略
  • LibrePhotos本地部署打造个人云相册安全存储和分享家庭照片(1)
  • 健康养生小窍门
  • 华为手机怎么进行音频降噪?音频降噪技巧分享:提升听觉体验
  • 缓存集群技术深度解析:从原理到实战
  • 基于Pytorch的深度学习-第二章
  • Qt UDP组播实现与调试指南
  • Vue+Flask豆瓣LSTM影评+推荐算法大数据可视化平台深度学习系统源码
  • 加密认证库openssl初始附带c/c++的使用源码
  • Linux之七大难命令(The Seven Difficult Commands of Linux)
  • 硬件工程师系列(十四)RS232自学设计分享