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

linter-js-cloudformation-yaml

v2.3.1

Published

Linter plugin for YAML, using js-yaml

Downloads

3

Readme

linter-js-cloudformation-yaml

This is a fork of the linter-js-yaml package. It will parse your YAML as well as the newly released CloudFormation YAML files in Atom with cloudformation-js-yaml-schema through js-yaml, exposing any issues reported.

Great care has been put into making sure the schema can be updated separately from the linter, since it is changed frequently by AWS. The schema includes the correct YAML type through trial and error since it is not documented by AWS. New tags will be added to the schema, and this package will update in turn. Please feel free to open a PR on cloudformation-js-yaml-schema to gain support if I don't get to it before you do.

Example

The following template will produce an error: cft_error

AWSTemplateFormatVersion: "2010-09-09"
Description: Demo Linux Stack
Metadata:
  AWS::CloudFormation::Interface:
    ParameterGroups:
      -
        Label:
          default: Instance Configuration
        Parameters:
          - LaunchInstance
          - ImageId
          - InstanceType
          - KeyName
          - VolumeSize
Parameters:
  ImageId:
    Type: AWS::EC2::Image::Id
    Default: ami-f173cc91
  InstanceType:
    Type: String
    Default: t2.large
  KeyName:
    Type: AWS::EC2::KeyPair::KeyName
    Default: ec2-keypair
  VolumeSize:
    Type: Number
    Default: 8
  LaunchInstance:
    Default: false
    AllowedValues:
      - true
      - false
Conditions:
  DoLaunchInstance: !Equals !Ref LaunchInstance true  #this will error in linter
Resources:
  LinuxBox:
    Type: AWS::EC2::Instance
    Condition: DoLaunchInstance
    CreationPolicy:
      ResourceSignal:
        Timeout: PT25M
    Metadata:
      AWS::CloudFormation::Init:
        config:
          packages:
            yum:
              htop: []
    Properties:
      InstanceInitiatedShutdownBehavior: stop
      ImageId: !Ref ImageId
      InstanceType: !Ref InstanceType
      KeyName: !Ref KeyName
      IamInstanceProfile: !Ref InstanceProfile
      Monitoring: false
      NetworkInterfaces:
        -
          DeleteOnTermination: true
          Description: !Sub LinuxBox Primary Netint from ${AWS::StackName}
          DeviceIndex: 0
          SubnetId: !Ref InstanceSubnetId
          AssociatePublicIpAddress: false
          GroupSet:
            - !Ref LinuxSecurityGroup
      BlockDeviceMappings:
        -
          DeviceName: /dev/sda1
          Ebs:
            VolumeType: gp2
            DeleteOnTermination: true
            VolumeSize: !Ref VolumeSize
      UserData:
        Fn::Base64: !Sub |
           #!/bin/bash -xe
           yum update -y aws-cfn-bootstrap
           /opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --region ${AWS::Region}
           /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource WebServerGroup --region ${AWS::Region}

Installation

$ apm install linter-js-cloudformation-yaml

Settings

You can add additional custom tags and configure linter-js-cloudformation-yaml by editing ~/.atom/config.cson (choose Open Your Config in Atom menu) or in Preferences:

'linter-js-cloudformation-yaml':
  'customTags': [
    "!yaml"
    "!include"
  ]
  • customTags: List of YAML custom tags. (Default: scalar)