补间轻松和ESLINT
Tweenmax ease and ESLINT
本文关键字:ESLINT 更新时间:2023-09-26
我正在使用 Babel 的 ES6 transpiller 和 Tweenmax 作为我的动画库,它提供了一些存储缓动曲线的对象,例如 Back
、Sine
等。
问题是我也在使用 Eslint,这些缓动对象违反了 no-undef 规则(我不想禁用)。
JS示例:
import TweenMax from 'gsap';
TweenMax.fromTo('.header__logo', .5, {y: -70, alpha: 0}, {y: 0, alpha: 1, delay: .4, ease: Back.easeOut});
安慰:
97:98 error "Back" is not defined no-undef
98:110 error "Back" is not defined no-undef
99:109 error "Back" is not defined no-undef
105:85 error "Sine" is not defined no-undef
107:117 error "Back" is not defined no-undef
108:125 error "Back" is not defined no-undef
127:96 error "Sine" is not defined no-undef
133:98 error "Back" is not defined no-undef
134:151 error "Back" is not defined no-undef
159:103 error "Sine" is not defined no-undef
160:111 error "Sine" is not defined no-undef
165:97 error "Back" is not defined no-undef
166:109 error "Back" is not defined no-undef
167:108 error "Back" is not defined no-undef
问题
如何让 TweenMax 缓动与 Eslint 一起使用?
好的,我已经想通了。
最快的方法是将 GSAP 变量添加到 .eslintrc 文件中的 globals
属性中
"globals": {
"TimelineLite" : false,
"TimelineMax" : false,
"TweenLite" : false,
"TweenMax" : false,
"Back" : false,
"Bounce" : false,
"Circ" : false,
"Cubic" : false,
"Ease" : false,
"EaseLookup" : false,
"Elastic" : false,
"Expo" : false,
"Linear" : false,
"Power0" : false,
"Power1" : false,
"Power2" : false,
"Power3" : false,
"Power4" : false,
"Quad" : false,
"Quart" : false,
"Quint" : false,
"RoughEase" : false,
"Sine" : false,
"SlowMo" : false,
"SteppedEase" : false,
"Strong" : false,
"Draggable" : false,
"SplitText" : false,
"VelocityTracker" : false,
"CSSPlugin" : false,
"ThrowPropsPlugin" : false,
"BezierPlugin" : false
}
从绿袜子论坛检索的属性
相关文章:
- eslint:“;分析错误:意外的“”标记;
- Eslint禁用行引发错误
- 补间轻松和ESLINT
- ESLint prefer-arrow-callback on array.map
- Eslint,如何在Javascript中接受const和arrow函数
- 如何使用ESLint 2禁用某些ES2015功能
- Eslint-脚本和模块的SourceType混合体
- eslint在git上预调试
- 扩展ESLint中的多个推荐配置
- ESLint在Angular应用程序中抱怨GreenSock
- Gulp eslint 找不到我的 .eslintrc 文件
- 如何在Yeoman Web应用程序中配置eslint
- 解析错误 关键字导入是保留的(SublimeLinter-contrib-eslint)
- ESLint 分析错误:意外的令牌
- 自定义 eslint 规则抛出意外的保留字
- ESlint 在与开头相同的列上强制使用函数等的右括号
- ESLint 错误无不需要的三元
- 如何使用 ESLint 适应 GSAP 的命名空间黑客攻击
- ESLint 无多空格允许在对象声明中
- ESLint “max-len” 忽略模式的问题