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

@compiled/eslint-plugin

Package Overview
Dependencies
Maintainers
4
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compiled/eslint-plugin - npm Package Compare versions

Comparing version 0.13.4 to 0.13.5

13

dist/utils/jsx.d.ts
import type { Comment, ImportDeclaration } from 'estree';
/**
* Return the "@ jsx jsx" JSX pragma (i.e. a comment that has special
* meaning to the TypeScript compiler), if it exists AND if jsx is
* imported from "@compiled/react".
* Return the JSX pragma, which looks like this:
*
* /** @ jsx jsx * /
*
* ... if it exists AND if jsx is imported from "@compiled/react".
*
* The JSX pragma is a special comment at the _beginning_ of the file
* used to find the jsx namespace in TypeScript. It is also used by Babel's
* @babel/plugin-transform-react-jsx to override the function used
* when converting JSX syntax to plain JS (React.createElement by default).
*/
export declare const findJsxPragma: (comments: Comment[], compiledImports: ImportDeclaration[]) => Comment | undefined;
export declare const findJsxImportSourcePragma: (comments: Comment[]) => Comment | undefined;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findJsxImportSourcePragma = exports.findJsxPragma = void 0;
const utils_1 = require("@compiled/utils");
/**
* Return the "@ jsx jsx" JSX pragma (i.e. a comment that has special
* meaning to the TypeScript compiler), if it exists AND if jsx is
* imported from "@compiled/react".
* Return the JSX pragma, which looks like this:
*
* /** @ jsx jsx * /
*
* ... if it exists AND if jsx is imported from "@compiled/react".
*
* The JSX pragma is a special comment at the _beginning_ of the file
* used to find the jsx namespace in TypeScript. It is also used by Babel's
* @babel/plugin-transform-react-jsx to override the function used
* when converting JSX syntax to plain JS (React.createElement by default).
*/

@@ -16,3 +24,3 @@ const findJsxPragma = (comments, compiledImports) => {

for (const comment of comments) {
const match = /@jsx (\w+)/.exec(comment.value);
const match = utils_1.JSX_ANNOTATION_REGEX.exec(comment.value);
if (match) {

@@ -19,0 +27,0 @@ jsxPragma = comment;

{
"name": "@compiled/eslint-plugin",
"version": "0.13.4",
"version": "0.13.5",
"description": "A familiar and performant compile time CSS-in-JS library for React.",

@@ -23,3 +23,3 @@ "homepage": "https://compiledcssinjs.com/docs/pkg-eslint-plugin",

"dependencies": {
"@compiled/utils": "^0.9.1"
"@compiled/utils": "^0.9.2"
},

@@ -26,0 +26,0 @@ "devDependencies": {

@@ -0,7 +1,15 @@

import { JSX_ANNOTATION_REGEX } from '@compiled/utils';
import type { Comment, ImportDeclaration } from 'estree';
/**
* Return the "@ jsx jsx" JSX pragma (i.e. a comment that has special
* meaning to the TypeScript compiler), if it exists AND if jsx is
* imported from "@compiled/react".
* Return the JSX pragma, which looks like this:
*
* /** @ jsx jsx * /
*
* ... if it exists AND if jsx is imported from "@compiled/react".
*
* The JSX pragma is a special comment at the _beginning_ of the file
* used to find the jsx namespace in TypeScript. It is also used by Babel's
* @babel/plugin-transform-react-jsx to override the function used
* when converting JSX syntax to plain JS (React.createElement by default).
*/

@@ -19,3 +27,3 @@ export const findJsxPragma = (

for (const comment of comments) {
const match = /@jsx (\w+)/.exec(comment.value);
const match = JSX_ANNOTATION_REGEX.exec(comment.value);
if (match) {

@@ -22,0 +30,0 @@ jsxPragma = comment;

Sorry, the diff of this file is not supported yet

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