![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A fake template literal tag to trick syntax highlighters, linters and formatters into action.
A fake template literal tag to trick syntax highlighters, linters and formatters into action. Interpolations and escapes are tested.
For Node.js, to install fake-tag
with npm, run:
npm install fake-tag
For Deno and browsers, an example import map:
{
"imports": {
"fake-tag": "https://unpkg.com/fake-tag@5.0.0/fakeTag.mjs"
}
}
Then, import and use the template literal tag fakeTag
.
Tagging a GraphQL SDL string with gql
:
import gql from "fake-tag";
const typeDefs = gql`
"A foo."
type Foo {
"The \`Foo\` ID."
id: ID!
}
`;
Supported runtime environments:
^14.17.0 || ^16.0.0 || >= 18.0.0
.> 0.5%, not OperaMini all, not dead
.Non Deno projects must configure TypeScript to use types from the ECMAScript modules that have a // @ts-check
comment:
compilerOptions.allowJs
should be true
.compilerOptions.maxNodeModuleJsDepth
should be reasonably large, e.g. 10
.compilerOptions.module
should be "node16"
or "nodenext"
.The npm package fake-tag
features optimal JavaScript module design. These ECMAScript modules are exported via the package.json
field exports
:
A comment tag looks like this:
const QUERY = /* GraphQL */ `
{
foo
}
`;
They are far superior to a fake tag:
Unfortunately not all tools support them yet. prettier
has since v1.13.0, but eslint-plugin-graphql
at v3.1.0 still doesn’t.
String.raw
?This may be temptingly simple:
const gql = String.raw;
const QUERY = gql`
{
foo
}
`;
However, it doesn’t unescape characters. For the usage example, if you console.log(typeDefs)
before and after replacing the import with const 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!
}
5.0.0
^14.17.0 || ^16.0.0 || >= 18.0.0
.main
field.node:
URL scheme for Node.js builtin module imports in tests.jsconfig.json
:
compilerOptions.maxNodeModuleJsDepth
to 10
.compilerOptions.module
to nodenext
.actions/checkout
to v3.actions/setup-node
to v3.not IE > 0
from the Browserslist query.FAQs
A fake template literal tag to trick syntax highlighters, linters and formatters into action.
The npm package fake-tag receives a total of 14,109 weekly downloads. As such, fake-tag popularity was classified as popular.
We found that fake-tag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.