Socket
Socket
Sign inDemoInstall

amphtml-validator-rules

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    amphtml-validator-rules

Get all the rules that the `amphtml-validator` uses.


Version published
Weekly downloads
13
Maintainers
1
Install size
336 kB
Created
Weekly downloads
 

Readme

Source

amphtml-validator-rules

Get all the rules that the amphtml-validator uses.

Purpose

Easy way to inspect the definition of certain AMPHTML components. Makes it convenient for other libraries that are built on top of AMPHTML, like react-amphtml.

Example

const { tags } = require('amphtml-validator-rules');

console.log((
  tags.filter(({ tagName }) => tagName.toLowerCase() === 'template')
));

Prints the following:

[
  {
    htmlFormat: [],
    tagName: 'TEMPLATE',
    specName: null,
    extensionSpec: null,
    requiresExtension: ['amp-mustache'],
    mandatory: false,
    mandatoryAlternatives: null,
    unique: false,
    uniqueWarning: false,
    mandatoryParent: null,
    mandatoryAncestor: null,
    mandatoryAncestorSuggestedAlternative: null,
    disallowedAncestor: ['TEMPLATE'],
    descendantTagList: null,
    alsoRequiresTagWarning: [],
    satisfies: [],
    requires: [],
    deprecation: null,
    deprecationUrl: null,
    attrs: [167],
    attrLists: [],
    cdata: null,
    childTags: null,
    siblingsDisallowed: false,
    mandatoryLastChild: false,
    referencePoints: [],
    specUrl: null,
    ampLayout: null,
  },
]

Development

To build amphtml-validator-rules Docker is needed because the validation rules require Python and Protobuf to compile. Once, those are installed, build by running npm run prepublishOnly.

Keywords

FAQs

Last updated on 08 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc