From 58d5c07f3ebcb38c89421c0212f7e86c8ab8292c Mon Sep 17 00:00:00 2001 From: Anna Vo Date: Fri, 3 Nov 2023 12:04:17 -0500 Subject: [PATCH] prettier --- .changeset/honest-lemons-glow.md | 3 ++- packages/eslint-plugin-widen/README.md | 2 +- packages/eslint-plugin-widen/src/rules/jsx-fragments.ts | 8 ++++---- packages/eslint-plugin-widen/src/rules/jsx-import.ts | 6 +++--- packages/eslint-plugin-widen/src/rules/patterns-18.ts | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.changeset/honest-lemons-glow.md b/.changeset/honest-lemons-glow.md index 8d57eb8..7a4094d 100644 --- a/.changeset/honest-lemons-glow.md +++ b/.changeset/honest-lemons-glow.md @@ -3,4 +3,5 @@ 'eslint-plugin-widen': major --- -Updates all versions to latest with major version updates for @typescript-eslint and eslint-plugin-jest +Updates all versions to latest with major version updates for @typescript-eslint +and eslint-plugin-jest diff --git a/packages/eslint-plugin-widen/README.md b/packages/eslint-plugin-widen/README.md index d63053b..70be903 100644 --- a/packages/eslint-plugin-widen/README.md +++ b/packages/eslint-plugin-widen/README.md @@ -29,7 +29,7 @@ Add the following to your `.eslintrc` file. ✔: Enabled in the `recommended` configuration.\ 🔧: Fixable with [`eslint --fix`](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems). -| ✔ | 🔧 | Rule | Description | +| ✔ | 🔧 | Rule | Description | | :-: | :-: | -------------------------------------------- | ------------------------------------------------------------------------------------------- | | | 🔧 | [widen/jsx-fragments](docs/jsx-fragments.md) | Enforce usage of JSX fragment longhand to allow for compatibility with Emotion. | | | 🔧 | [widen/jsx-import](docs/jsx-import.md) | Enforces all files to use the `jsx` pragma from `@emotion/react` when using the `css` prop. | diff --git a/packages/eslint-plugin-widen/src/rules/jsx-fragments.ts b/packages/eslint-plugin-widen/src/rules/jsx-fragments.ts index 93c5571..67f48f2 100644 --- a/packages/eslint-plugin-widen/src/rules/jsx-fragments.ts +++ b/packages/eslint-plugin-widen/src/rules/jsx-fragments.ts @@ -4,7 +4,7 @@ import { JSXFragment } from 'estree-jsx' import { docsURL } from '../utils' const isImportDeclaration = ( - node: ESTree.Node + node: ESTree.Node, ): node is ESTree.ImportDeclaration => node.type === 'ImportDeclaration' export default { @@ -46,11 +46,11 @@ export default { return [ fixer.replaceText( fragment.openingFragment as unknown as ESTree.Node, - `<${tag}>` + `<${tag}>`, ), fixer.replaceText( fragment.closingFragment as unknown as ESTree.Node, - `` + ``, ), ] }, @@ -74,7 +74,7 @@ export default { fix(fixer) { return fixer.insertTextAfter( node.specifiers[node.specifiers.length - 1], - ', Fragment' + ', Fragment', ) }, messageId: 'missingImport', diff --git a/packages/eslint-plugin-widen/src/rules/jsx-import.ts b/packages/eslint-plugin-widen/src/rules/jsx-import.ts index 0e37b27..9bfba97 100644 --- a/packages/eslint-plugin-widen/src/rules/jsx-import.ts +++ b/packages/eslint-plugin-widen/src/rules/jsx-import.ts @@ -19,14 +19,14 @@ function addJsxImport(fixer: Rule.RuleFixer, node: ESTree.ImportDeclaration) { return fixer.insertTextAfter( specifier, - specifier.type === 'ImportSpecifier' ? ', jsx' : ', { jsx }' + specifier.type === 'ImportSpecifier' ? ', jsx' : ', { jsx }', ) } function removeReactImport( source: SourceCode, fixer: Rule.RuleFixer, - node: ESTree.ImportDeclaration + node: ESTree.ImportDeclaration, ) { const specifier = node.specifiers.find((spec) => spec.local.name === 'React') if (!specifier) return [] @@ -52,7 +52,7 @@ function applyRemainingFix( source: SourceCode, fixer: Rule.RuleFixer, hasPragma: boolean, - emotionReactImport: ESTree.ImportDeclaration | null + emotionReactImport: ESTree.ImportDeclaration | null, ) { const fix = (hasPragma ? '' : '/** @jsx jsx */\n') + diff --git a/packages/eslint-plugin-widen/src/rules/patterns-18.ts b/packages/eslint-plugin-widen/src/rules/patterns-18.ts index 0834e4f..f40efc9 100644 --- a/packages/eslint-plugin-widen/src/rules/patterns-18.ts +++ b/packages/eslint-plugin-widen/src/rules/patterns-18.ts @@ -102,7 +102,7 @@ const oldVariables = new Set([ function reportCssVariable( context: Rule.RuleContext, node: ESTree.Node, - value: string + value: string, ) { const regex = /var\((--[a-z-]+)(,.*)?\)/g const matches = value.matchAll(regex) @@ -170,7 +170,7 @@ export default { fix: (fixer) => fixer.replaceText( attribute as unknown as ESTree.Node, - 'status="' + statusMap[color] + '"' + 'status="' + statusMap[color] + '"', ), messageId: 'statusProp', node,