1.2.0 • Published 2 years ago

lottie-lint v1.2.0

Weekly downloads
82
License
MIT
Repository
-
Last release
2 years ago

lottie lint travis ci

use

// es module
import linter from 'lottie-lint';
const { json, reports } = linter(lottie json);

// node.js
const linter = require('lottie-lint');
const { json, reports } = linter.default(lottie json);

lint rules

规则名属性等级说明
info_mask_mode蒙版info
info_layertype_shape形状的性能优化info
incompatible_gradient_strokes渐变描边兼容性incompatiblelottie Supported Features
incompatible_layer_effects效果滤镜incompatiblelottie Supported Features
incompatible_mask_mode蒙版的兼容性incompatiblelottie Supported Features
incompatible_auto_orient自动定向incompatiblelottie Supported Features
incompatible_time_remap时间重映射incompatiblelottie Supported Features
warn_gradient_warn异常渐变warn
warn_fonts_json字体兼容性warn字体数据检测
warn_old_json_format插件版本5.5.0+兼容性warnae 插件版本识别;5.5.0+ 的判断建议
warn_layertype_solid纯色模块warn
warn_matte_not_suggested遮罩层error当前图层存在遮罩层,建议使用蒙版替代
error_invalid_layer无效图层error当前图层进场时间大于动画结束时间,建议删除图层

附:规则详细说明 https://www.yuque.com/lottie/lint

等级

  • error: 错误,渲染错误,务必处理
  • warn: 警告,建议优化
  • info: 提示,通常存在优化空间
  • incompatible: 兼容性问题

report 对象

// 的坐标系表示出来
interface report {
  // 提示的文本内容
  message: string;
  // 类型,枚举: 'error', 'warn', 'info', 'incompatible'
  type: string;
  // ['iOS', 'Web', 'Android']
  incompatible: string[];
  // 规则名称
  rule: string;
  // 层命名
  name: string;
  // 当前对象的坐标系
  element: element;
  // 当前对象父级节点的坐标系
  parentElement: element;
}
// more see `index.d.ts`

附: 坐标系的表达: https://www.yuque.com/lottie/xdrbsp/zg967e

TODO

  • 更好的lint位置提示
  • lint 添加 Expressions 的警告
1.2.0

2 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.0.1

6 years ago