Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fake-tag

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fake-tag

A fake template literal tag to trick linters and formatters into action.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37K
decreased by-48.1%
Maintainers
1
Weekly downloads
 
Created
Source

fake-tag

npm version Licence Github issues Github stars Travis status

A fake template literal tag to trick linters and formatters into action. Interpolations and escapes are tested.

This hack will be redundant once comment tags are supported by tools such as Prettier:

/* GraphQL */`
  {
    foo
  }
`

Install

Install with npm:

npm install fake-tag

Usage

Import and use the tag with the required name:

import gql from 'fake-tag'

const typeDefs = gql`
  "A foo."
  type Foo {
    "The \`Foo\` ID."
    id: ID!
  }
`

Why not String.raw?

It doesn’t unescape characters. For the usage example, if you console.log(typeDefs) before and after replacing the import withconst gql = String.raw you will see the difference in the type description markdown:

    "A foo."
    type Foo {
-     "The `Foo` ID."
+     "The \`Foo\` ID."
      id: ID!
    }

Keywords

FAQs

Package last updated on 30 Apr 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc