diff --git a/packages/codemods/src/helpers/index.ts b/packages/codemods/src/helpers/index.ts index 4250f2d021..e451cbbd1e 100644 --- a/packages/codemods/src/helpers/index.ts +++ b/packages/codemods/src/helpers/index.ts @@ -1,5 +1,5 @@ import { errorMessage, infoMessage, logMessage } from './message'; import { _dirname } from './path'; -import { removeCircleBrackets } from './removeCircleBrackets'; +import { removeParentheses } from './removeParentheses'; -export { _dirname, errorMessage, infoMessage, logMessage, removeCircleBrackets }; +export { _dirname, errorMessage, infoMessage, logMessage, removeParentheses }; diff --git a/packages/codemods/src/helpers/removeCircleBrackets.ts b/packages/codemods/src/helpers/removeParentheses.ts similarity index 96% rename from packages/codemods/src/helpers/removeCircleBrackets.ts rename to packages/codemods/src/helpers/removeParentheses.ts index c941385986..0810cde5e1 100644 --- a/packages/codemods/src/helpers/removeCircleBrackets.ts +++ b/packages/codemods/src/helpers/removeParentheses.ts @@ -6,7 +6,7 @@ const REG_RETURN = /return\s+\((\s+)\(<([^\s>]+)/g; -export const removeCircleBrackets = (string: string): string => { +export const removeParentheses = (string: string): string => { const matches: IterableIterator = string.matchAll(REG_RETURN); let result = ''; diff --git a/packages/codemods/src/transforms/v3/web-react/button-isSquare-prop-name.ts b/packages/codemods/src/transforms/v3/web-react/button-isSquare-prop-name.ts index 65edc53bf2..f2ed23eb87 100644 --- a/packages/codemods/src/transforms/v3/web-react/button-isSquare-prop-name.ts +++ b/packages/codemods/src/transforms/v3/web-react/button-isSquare-prop-name.ts @@ -1,5 +1,5 @@ import { API, FileInfo } from 'jscodeshift'; -import { removeCircleBrackets } from '../../../helpers'; +import { removeParentheses } from '../../../helpers'; const transform = (fileInfo: FileInfo, api: API) => { const j = api.jscodeshift; @@ -45,7 +45,7 @@ const transform = (fileInfo: FileInfo, api: API) => { } } - return removeCircleBrackets(root.toSource()); + return removeParentheses(root.toSource()); }; export default transform; diff --git a/packages/codemods/src/transforms/v3/web-react/buttonLink-isSquare-prop-name.ts b/packages/codemods/src/transforms/v3/web-react/buttonLink-isSquare-prop-name.ts index 8fdbd6a727..3851325d99 100644 --- a/packages/codemods/src/transforms/v3/web-react/buttonLink-isSquare-prop-name.ts +++ b/packages/codemods/src/transforms/v3/web-react/buttonLink-isSquare-prop-name.ts @@ -1,5 +1,5 @@ import { API, FileInfo } from 'jscodeshift'; -import { removeCircleBrackets } from '../../../helpers'; +import { removeParentheses } from '../../../helpers'; const transform = (fileInfo: FileInfo, api: API) => { const j = api.jscodeshift; @@ -45,7 +45,7 @@ const transform = (fileInfo: FileInfo, api: API) => { } } - return removeCircleBrackets(root.toSource()); + return removeParentheses(root.toSource()); }; export default transform; diff --git a/packages/codemods/src/transforms/v3/web-react/heading-elementType-prop.ts b/packages/codemods/src/transforms/v3/web-react/heading-elementType-prop.ts index 1f9293c98a..2247d84520 100644 --- a/packages/codemods/src/transforms/v3/web-react/heading-elementType-prop.ts +++ b/packages/codemods/src/transforms/v3/web-react/heading-elementType-prop.ts @@ -1,5 +1,5 @@ import { API, FileInfo } from 'jscodeshift'; -import { removeCircleBrackets } from '../../../helpers'; +import { removeParentheses } from '../../../helpers'; const transform = (fileInfo: FileInfo, api: API) => { const j = api.jscodeshift; @@ -44,7 +44,7 @@ const transform = (fileInfo: FileInfo, api: API) => { } } - return removeCircleBrackets(root.toSource()); + return removeParentheses(root.toSource()); }; export default transform; diff --git a/packages/codemods/src/transforms/v3/web-react/link-underlined-prop.ts b/packages/codemods/src/transforms/v3/web-react/link-underlined-prop.ts index 57e95e6144..b859f3f0b1 100644 --- a/packages/codemods/src/transforms/v3/web-react/link-underlined-prop.ts +++ b/packages/codemods/src/transforms/v3/web-react/link-underlined-prop.ts @@ -8,7 +8,7 @@ import { ImportDeclaration, JSXOpeningElement, } from 'jscodeshift'; -import { removeCircleBrackets } from '../../../helpers'; +import { removeParentheses } from '../../../helpers'; const transform = (fileInfo: FileInfo, api: API): string => { const j: JSCodeshift = api.jscodeshift; @@ -62,7 +62,7 @@ const transform = (fileInfo: FileInfo, api: API): string => { }); } - return removeCircleBrackets(root.toSource()); + return removeParentheses(root.toSource()); }; export default transform;