npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lottie-lint

v1.2.0

Published

lottie json lint

Downloads

12

Readme

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 | 渐变描边兼容性 | incompatible | lottie Supported Features | | incompatible_layer_effects | 效果滤镜 | incompatible | lottie Supported Features | | incompatible_mask_mode | 蒙版的兼容性 | incompatible | lottie Supported Features | | incompatible_auto_orient | 自动定向 | incompatible | lottie Supported Features | | incompatible_time_remap | 时间重映射 | incompatible | lottie Supported Features | | warn_gradient_warn | 异常渐变 | warn | | | warn_fonts_json | 字体兼容性 | warn | 字体数据检测 | | warn_old_json_format | 插件版本5.5.0+兼容性 | warn | ae 插件版本识别;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 的警告