@compiled/eslint-plugin
Advanced tools
Comparing version 0.13.2 to 0.13.3
import type { Comment, ImportDeclaration } from 'estree'; | ||
/** | ||
* 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). | ||
* 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". | ||
*/ | ||
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 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). | ||
* 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". | ||
*/ | ||
@@ -24,3 +16,3 @@ const findJsxPragma = (comments, compiledImports) => { | ||
for (const comment of comments) { | ||
const match = utils_1.JSX_ANNOTATION_REGEX.exec(comment.value); | ||
const match = /@jsx (\w+)/.exec(comment.value); | ||
if (match) { | ||
@@ -27,0 +19,0 @@ jsxPragma = comment; |
{ | ||
"name": "@compiled/eslint-plugin", | ||
"version": "0.13.2", | ||
"version": "0.13.3", | ||
"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.0" | ||
"@compiled/utils": "^0.9.1" | ||
}, | ||
@@ -26,0 +26,0 @@ "devDependencies": { |
@@ -1,15 +0,7 @@ | ||
import { JSX_ANNOTATION_REGEX } from '@compiled/utils'; | ||
import type { Comment, ImportDeclaration } from 'estree'; | ||
/** | ||
* 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). | ||
* 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". | ||
*/ | ||
@@ -27,3 +19,3 @@ export const findJsxPragma = ( | ||
for (const comment of comments) { | ||
const match = JSX_ANNOTATION_REGEX.exec(comment.value); | ||
const match = /@jsx (\w+)/.exec(comment.value); | ||
if (match) { | ||
@@ -30,0 +22,0 @@ jsxPragma = comment; |
Sorry, the diff of this file is not supported yet
398166
9569
Updated@compiled/utils@^0.9.1