【发布时间】:2022-01-12 16:57:41
【问题描述】:
我在我的 Angular 项目中使用 am4themes_animated,并且正在转向 eslint 而不是 tslint。
import am4themes_animated from '@amcharts/amcharts4/themes/animated';
但是,ESlint 给出以下错误。
Identifier 'am4themes_animated' is not in camel case camelcase
我曾尝试使用像 import am4themes_animated as am4themesAnimated from '@amcharts/amcharts4/themes/animated'; 这样的别名,但它不允许这样做。
这可能是一个非常新手的问题,但如果有人可以提供帮助,我将不胜感激。谢谢。 (这里是我的第一个问题,边走边学,如有错误请见谅)
更新:
import * as am4themesAnimated 不起作用,因为我需要将常量作为这样的参数传递:am4core.useTheme(am4themes_animated);
【问题讨论】:
-
你可以试试
import * as am4themesAnimated from '@amcharts/amcharts4/themes/animated'; -
您好,尝试了您的方法,但不起作用。
am4themes_animated将在此处作为参数(类型为 ITheme)传递:am4core.useTheme(am4themes_animated);
标签: angular typescript eslint typescript-eslint