From e35838dab761243a0ece4afda045d2a2edf2beb8 Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Wed, 1 Nov 2023 17:08:38 -0500 Subject: [PATCH] chore: add eslint-plugin-no-attribute-string-literals (#5086) * chore: add eslint-plugin-no-attribute-string-literals * chore: update workshop eslint configs for i18n adds "no-attribute-string-literals/no-attribute-string-literals": "off" --- .eslintrc.cjs | 388 +++++++++++------- package.json | 1 + .../changeIndicators/__workshop__/.eslintrc | 7 +- .../collapseMenu/__workshop__/.eslintrc | 7 +- .../commandList/__tests__/.eslintrc | 7 +- .../commandList/__workshop__/.eslintrc | 7 +- .../components/image/__workshop__/.eslintrc | 7 +- .../previewCard/__workshop__/.eslintrc | 7 +- .../previews/__workshop__/.eslintrc | 7 +- .../rovingFocus/__workshop__/.eslintrc | 7 +- .../textWithTone/__workshop__/.eslintrc | 7 +- .../userAvatar/__workshop__/.eslintrc | 7 +- .../src/core/field/__workshop__/.eslintrc | 7 +- .../src/core/form/__workshop__/.eslintrc | 7 +- .../formField/__workshop__/.eslintrc | 7 +- .../PortableText/__workshop__/.eslintrc | 7 +- .../_legacyDefaultParts/__tests__/.eslintrc | 7 +- .../core/form/inputs/__workshop__/.eslintrc | 7 +- .../form/inputs/files/__workshop__/.eslintrc | 7 +- .../src/core/preview/__workshop__/.eslintrc | 7 +- .../src/core/schema/__workshop__/.eslintrc | 7 +- .../core/store/_legacy/__workshop__/.eslintrc | 7 +- .../store/_legacy/authStore/providerLogos.tsx | 6 +- .../studio/components/navbar/NavDrawer.tsx | 10 +- .../components/navbar/__workshop__/.eslintrc | 7 +- .../navbar/search/__workshop__/.eslintrc | 7 +- .../sanity/src/desk/__workshop__/.eslintrc | 7 +- .../components/pane/__workshop__/.eslintrc | 3 +- .../document/statusBar/__workshop__/.eslintrc | 7 +- .../document/timeline/__workshop__/.eslintrc | 7 +- yarn.lock | 5 + 31 files changed, 354 insertions(+), 234 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1343cedd28e5..e84c6093c6ef 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,19 +1,37 @@ +/* eslint-disable */ +// @ts-check 'use strict' -const baseConfig = { +const extensions = ['.cjs', '.mjs', '.js', '.jsx', '.ts', '.tsx'] + +/** @type {import('eslint').Linter.Config} */ +const config = { + root: true, env: { node: true, browser: true, }, extends: [ + 'plugin:boundaries/recommended', 'sanity', 'sanity/react', 'sanity/import', + 'sanity/typescript', + 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'prettier', ], parser: '@typescript-eslint/parser', - plugins: ['import', '@typescript-eslint', 'prettier', 'react', 'tsdoc', 'i18next'], + plugins: [ + 'boundaries', + 'import', + '@typescript-eslint', + 'prettier', + 'react', + 'tsdoc', + 'i18next', + 'no-attribute-string-literals', + ], ignorePatterns: [ '**/etc/*', '**/.sanity/*', @@ -38,7 +56,6 @@ const baseConfig = { 'import/no-named-as-default-member': 'off', 'import/no-unresolved': 'off', 'prettier/prettier': 'error', - 'react/jsx-filename-extension': ['error', {extensions: ['.jsx']}], 'sort-imports': 'off', // prefer import/order 'tsdoc/syntax': 'error', 'react-hooks/rules-of-hooks': 'error', @@ -50,186 +67,257 @@ const baseConfig = { ], 'react/no-unescaped-entities': 'off', 'react/jsx-uses-react': 'warn', - 'i18next/no-literal-string': 2, - }, - settings: { - 'import/extensions': ['.cjs', '.mjs', '.js', '.jsx', '.ts', '.tsx'], - 'import/parsers': { - '@typescript-eslint/parser': ['.cjs', '.mjs', '.js', '.jsx', '.ts', '.tsx'], - }, - 'import/resolver': { - typescript: { - alwaysTryTypes: true, - project: [ - 'dev/*/tsconfig.json', - 'examples/*/tsconfig.json', - 'packages/@sanity/*/tsconfig.json', - 'packages/*/tsconfig.json', - ], - }, - }, - react: {version: '18.0.0'}, - }, -} - -module.exports = { - ...baseConfig, - - overrides: [ - // TypeScript files - { - files: ['*.{ts,tsx}'], - extends: [ - 'plugin:boundaries/recommended', - 'sanity', - 'sanity/react', - 'sanity/import', - 'sanity/typescript', - 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', - 'prettier', - ], - plugins: ['boundaries', 'import', '@typescript-eslint', 'prettier', 'react', 'tsdoc'], - rules: { - ...baseConfig.rules, - '@typescript-eslint/no-dupe-class-members': ['error'], - '@typescript-eslint/no-shadow': ['error'], - '@typescript-eslint/no-unused-vars': ['warn'], - 'boundaries/element-types': [ - 2, + 'i18next/no-literal-string': ['error'], + 'no-attribute-string-literals/no-attribute-string-literals': [ + 'error', + { + ignore: [ { - default: 'disallow', - rules: [ - { - // export - from: 'sanity/_internal', - allow: ['sanity/_internal__contents'], - }, - { - from: 'sanity/_internal__contents', - allow: ['sanity', 'sanity/_internal__contents'], - }, - { - // export - from: 'sanity/cli', - allow: ['sanity/cli__contents'], - }, - { - from: 'sanity/cli__contents', - allow: ['sanity/cli__contents'], - }, - { - // export - from: 'sanity', - allow: ['sanity__contents'], - }, - { - from: 'sanity__contents', - allow: ['sanity__contents', 'sanity/router'], - }, - { - // export - from: 'sanity/desk', - allow: ['sanity/desk__contents'], - }, - { - from: 'sanity/desk__contents', - allow: ['sanity', 'sanity/desk__contents', 'sanity/router'], - }, - { - // export - from: 'sanity/router', - allow: ['sanity/router__contents'], - }, - { - from: 'sanity/router__contents', - allow: ['sanity/router__contents'], - }, + components: ['svg', 'path', 'g', 'circle', 'option', 'meta', 'link', 'rect'], + componentPatterns: ['^motion\\.', 'Svg', 'Motion'], + attributePatterns: ['^data-', 'Key', 'Mode'], + valuePatterns: ['^data-'], + attributes: [ + 'align', + 'aria-autocomplete', + 'aria-controls', + 'aria-hidden', + 'aria-live', + 'as', + 'assetType', + 'autoComplete', + 'autoFocus', + 'axis', + 'className', + 'direction', + 'display', + 'fill', + 'flex', + 'forwardedAs', + 'height', + 'href', + 'i18nKey', + 'id', + 'intent', + 'justify', + 'key', + 'key', + 'lang', + 'language', + 'layout', + 'mode', + 'mode', + 'overflow', + 'path', + 'pattern', + 'placement', + 'portal', + 'referrerPolicy', + 'rel', + 'role', + 'scheme', + 'selectionType', + 'sizing', + 'src', + 'step', + 'stroke', + 'target', + 'textOverflow', + 'tone', + 'type', + 'viewBox', + 'weight', + 'width', + 'wrap', + 'zOffset', + ], + values: [ + '_blank', + 'after', + 'before', + 'bottom', + 'center', + 'default', + 'dialog', + 'error', + 'false', + 'first', + 'from', + 'horizontal', + 'info', + 'left', + 'me', + 'numeric', + 'online', + 'popover', + 'right', + 'second', + 'sidebar', + 'test', + 'to', + 'top', + 'topbar', + 'transparent', + 'true', + 'viewport', + 'warning', ], }, ], - 'no-undef': 'off', - 'no-dupe-class-members': 'off', // doesn't work with TS overrides - 'no-shadow': 'off', - 'no-unused-vars': 'off', - 'react/jsx-filename-extension': ['error', {extensions: ['.tsx']}], - }, - settings: { - ...baseConfig.settings, - 'boundaries/elements': [ + }, + ], + '@typescript-eslint/no-dupe-class-members': ['error'], + '@typescript-eslint/no-shadow': ['error'], + '@typescript-eslint/no-unused-vars': ['warn'], + 'boundaries/element-types': [ + 'error', + { + default: 'disallow', + rules: [ { - type: 'sanity', - pattern: ['packages/sanity/exports/index.ts'], - mode: 'full', + // export + from: 'sanity/_internal', + allow: ['sanity/_internal__contents'], }, { - type: 'sanity__contents', - pattern: ['packages/sanity/src/core/**/*.*'], - mode: 'full', + from: 'sanity/_internal__contents', + allow: ['sanity', 'sanity/_internal__contents'], }, { - type: 'sanity/_internal', - pattern: ['packages/sanity/exports/_internal.ts'], - mode: 'full', + // export + from: 'sanity/cli', + allow: ['sanity/cli__contents'], }, { - type: 'sanity/_internal__contents', - pattern: ['packages/sanity/src/_internal/**/*.*'], - mode: 'full', + from: 'sanity/cli__contents', + allow: ['sanity/cli__contents'], }, { - type: 'sanity/cli', - pattern: ['packages/sanity/exports/cli.ts'], - mode: 'full', + // export + from: 'sanity', + allow: ['sanity__contents'], }, { - type: 'sanity/cli__contents', - pattern: ['packages/sanity/src/cli/**/*.*'], - mode: 'full', + from: 'sanity__contents', + allow: ['sanity__contents', 'sanity/router'], }, { - type: 'sanity/desk', - pattern: ['packages/sanity/exports/desk.ts'], - mode: 'file', + // export + from: 'sanity/desk', + allow: ['sanity/desk__contents'], }, { - type: 'sanity/desk__contents', - pattern: ['packages/sanity/src/desk/**/*.*'], - mode: 'file', + from: 'sanity/desk__contents', + allow: ['sanity', 'sanity/desk__contents', 'sanity/router'], }, { - type: 'sanity/router', - pattern: ['packages/sanity/exports/router.ts'], - mode: 'full', + // export + from: 'sanity/router', + allow: ['sanity/router__contents'], }, { - type: 'sanity/router__contents', - pattern: ['packages/sanity/src/router/**/*.*'], - mode: 'full', + from: 'sanity/router__contents', + allow: ['sanity/router__contents'], }, ], - 'boundaries/include': ['packages/sanity/exports/*.*', 'packages/sanity/src/**/*.*'], }, + ], + 'no-undef': 'off', + 'no-dupe-class-members': 'off', // doesn't work with TS overrides + 'no-shadow': 'off', + 'no-unused-vars': 'off', + }, + settings: { + 'import/extensions': extensions, + 'import/parsers': { + '@typescript-eslint/parser': extensions, }, - - // CommonJS files - { - files: ['*.cjs'], - parserOptions: { - sourceType: 'script', + 'import/resolver': { + typescript: { + alwaysTryTypes: true, + project: [ + 'dev/*/tsconfig.json', + 'examples/*/tsconfig.json', + 'packages/@sanity/*/tsconfig.json', + 'packages/*/tsconfig.json', + ], + }, + }, + 'boundaries/include': ['packages/sanity/exports/*.*', 'packages/sanity/src/**/*.*'], + 'boundaries/elements': [ + { + type: 'sanity', + pattern: ['packages/sanity/exports/index.ts'], + mode: 'full', + }, + { + type: 'sanity__contents', + pattern: ['packages/sanity/src/core/**/*.*'], + mode: 'full', + }, + { + type: 'sanity/_internal', + pattern: ['packages/sanity/exports/_internal.ts'], + mode: 'full', + }, + { + type: 'sanity/_internal__contents', + pattern: ['packages/sanity/src/_internal/**/*.*'], + mode: 'full', + }, + { + type: 'sanity/cli', + pattern: ['packages/sanity/exports/cli.ts'], + mode: 'full', + }, + { + type: 'sanity/cli__contents', + pattern: ['packages/sanity/src/cli/**/*.*'], + mode: 'full', + }, + { + type: 'sanity/desk', + pattern: ['packages/sanity/exports/desk.ts'], + mode: 'file', + }, + { + type: 'sanity/desk__contents', + pattern: ['packages/sanity/src/desk/**/*.*'], + mode: 'file', }, + { + type: 'sanity/router', + pattern: ['packages/sanity/exports/router.ts'], + mode: 'full', + }, + { + type: 'sanity/router__contents', + pattern: ['packages/sanity/src/router/**/*.*'], + mode: 'full', + }, + ], + react: {version: '18.0.0'}, + }, + overrides: [ + // Test files + { + files: [`**/*/test/**/*`, '**/*/__tests__/**/*', '**/*.test.{js,ts,tsx}'], + env: {jest: true}, rules: { - ...baseConfig.rules, - strict: ['error', 'global'], + 'i18next/no-literal-string': 'off', + 'no-attribute-string-literals/no-attribute-string-literals': 'off', }, }, - // Test files + // Files to disable i18n literals, { - files: ['./test/**/*.js', './test/*.js', '*.test.{js,ts,tsx}'], - env: {jest: true}, + files: ['./**/*/__workshop__/**/*', './dev/**/*', './examples/**/*'], + rules: { + 'i18next/no-literal-string': 'off', + 'no-attribute-string-literals/no-attribute-string-literals': 'off', + }, }, ], - - root: true, } + +module.exports = config diff --git a/package.json b/package.json index 92e71d1b49bf..af59ad5dd551 100644 --- a/package.json +++ b/package.json @@ -122,6 +122,7 @@ "eslint-plugin-boundaries": "^3.4.0", "eslint-plugin-i18next": "^6.0.3", "eslint-plugin-import": "^2.28.1", + "eslint-plugin-no-attribute-string-literals": "^1.0.0", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", diff --git a/packages/sanity/src/core/changeIndicators/__workshop__/.eslintrc b/packages/sanity/src/core/changeIndicators/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/changeIndicators/__workshop__/.eslintrc +++ b/packages/sanity/src/core/changeIndicators/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/collapseMenu/__workshop__/.eslintrc b/packages/sanity/src/core/components/collapseMenu/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/collapseMenu/__workshop__/.eslintrc +++ b/packages/sanity/src/core/components/collapseMenu/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/commandList/__tests__/.eslintrc b/packages/sanity/src/core/components/commandList/__tests__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/commandList/__tests__/.eslintrc +++ b/packages/sanity/src/core/components/commandList/__tests__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/commandList/__workshop__/.eslintrc b/packages/sanity/src/core/components/commandList/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/commandList/__workshop__/.eslintrc +++ b/packages/sanity/src/core/components/commandList/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/image/__workshop__/.eslintrc b/packages/sanity/src/core/components/image/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/image/__workshop__/.eslintrc +++ b/packages/sanity/src/core/components/image/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/previewCard/__workshop__/.eslintrc b/packages/sanity/src/core/components/previewCard/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/previewCard/__workshop__/.eslintrc +++ b/packages/sanity/src/core/components/previewCard/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/previews/__workshop__/.eslintrc b/packages/sanity/src/core/components/previews/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/previews/__workshop__/.eslintrc +++ b/packages/sanity/src/core/components/previews/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/rovingFocus/__workshop__/.eslintrc b/packages/sanity/src/core/components/rovingFocus/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/rovingFocus/__workshop__/.eslintrc +++ b/packages/sanity/src/core/components/rovingFocus/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/textWithTone/__workshop__/.eslintrc b/packages/sanity/src/core/components/textWithTone/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/textWithTone/__workshop__/.eslintrc +++ b/packages/sanity/src/core/components/textWithTone/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/components/userAvatar/__workshop__/.eslintrc b/packages/sanity/src/core/components/userAvatar/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/components/userAvatar/__workshop__/.eslintrc +++ b/packages/sanity/src/core/components/userAvatar/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/field/__workshop__/.eslintrc b/packages/sanity/src/core/field/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/field/__workshop__/.eslintrc +++ b/packages/sanity/src/core/field/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/form/__workshop__/.eslintrc b/packages/sanity/src/core/form/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/form/__workshop__/.eslintrc +++ b/packages/sanity/src/core/form/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/form/components/formField/__workshop__/.eslintrc b/packages/sanity/src/core/form/components/formField/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/form/components/formField/__workshop__/.eslintrc +++ b/packages/sanity/src/core/form/components/formField/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/form/inputs/PortableText/__workshop__/.eslintrc b/packages/sanity/src/core/form/inputs/PortableText/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/__workshop__/.eslintrc +++ b/packages/sanity/src/core/form/inputs/PortableText/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/form/inputs/PortableText/_legacyDefaultParts/__tests__/.eslintrc b/packages/sanity/src/core/form/inputs/PortableText/_legacyDefaultParts/__tests__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/_legacyDefaultParts/__tests__/.eslintrc +++ b/packages/sanity/src/core/form/inputs/PortableText/_legacyDefaultParts/__tests__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/form/inputs/__workshop__/.eslintrc b/packages/sanity/src/core/form/inputs/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/form/inputs/__workshop__/.eslintrc +++ b/packages/sanity/src/core/form/inputs/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/form/inputs/files/__workshop__/.eslintrc b/packages/sanity/src/core/form/inputs/files/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/form/inputs/files/__workshop__/.eslintrc +++ b/packages/sanity/src/core/form/inputs/files/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/preview/__workshop__/.eslintrc b/packages/sanity/src/core/preview/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/preview/__workshop__/.eslintrc +++ b/packages/sanity/src/core/preview/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/schema/__workshop__/.eslintrc b/packages/sanity/src/core/schema/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/schema/__workshop__/.eslintrc +++ b/packages/sanity/src/core/schema/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/store/_legacy/__workshop__/.eslintrc b/packages/sanity/src/core/store/_legacy/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/store/_legacy/__workshop__/.eslintrc +++ b/packages/sanity/src/core/store/_legacy/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/store/_legacy/authStore/providerLogos.tsx b/packages/sanity/src/core/store/_legacy/authStore/providerLogos.tsx index 5f6cb95f0db6..cd98859d92c3 100644 --- a/packages/sanity/src/core/store/_legacy/authStore/providerLogos.tsx +++ b/packages/sanity/src/core/store/_legacy/authStore/providerLogos.tsx @@ -3,7 +3,7 @@ import React from 'react' import styled, {css} from 'styled-components' import type {AuthProvider} from '../../../config' -const GithubRoot = styled.svg(({theme}: {theme: Theme}) => { +const GithubRootSvg = styled.svg(({theme}: {theme: Theme}) => { const {fg} = theme.sanity.color.base return css` @@ -18,7 +18,7 @@ const CustomImage = styled.img` ` const GithubLogo = () => ( - ( viewBox="0 0 438.55 438.55" > - + ) const GoogleLogo = () => ( diff --git a/packages/sanity/src/core/studio/components/navbar/NavDrawer.tsx b/packages/sanity/src/core/studio/components/navbar/NavDrawer.tsx index 49c7791cbe78..deb91b3addb6 100644 --- a/packages/sanity/src/core/studio/components/navbar/NavDrawer.tsx +++ b/packages/sanity/src/core/studio/components/navbar/NavDrawer.tsx @@ -45,7 +45,7 @@ const Root = styled(Layer)` height: 100%; ` -const Backdrop = styled(motion(Card))` +const BackdropMotion = styled(motion(Card))` position: absolute; top: 0; left: 0; @@ -54,7 +54,7 @@ const Backdrop = styled(motion(Card))` background: var(--card-shadow-penumbra-color); ` -const InnerCard = styled(motion(Card))` +const InnerCardMotion = styled(motion(Card))` position: relative; pointer-events: all; flex-direction: column; @@ -131,7 +131,7 @@ export const NavDrawer = memo(function NavDrawer(props: NavDrawerProps) { {isOpen && ( - - )} - + )} diff --git a/packages/sanity/src/core/studio/components/navbar/__workshop__/.eslintrc b/packages/sanity/src/core/studio/components/navbar/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/studio/components/navbar/__workshop__/.eslintrc +++ b/packages/sanity/src/core/studio/components/navbar/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/core/studio/components/navbar/search/__workshop__/.eslintrc b/packages/sanity/src/core/studio/components/navbar/search/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/__workshop__/.eslintrc +++ b/packages/sanity/src/core/studio/components/navbar/search/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/desk/__workshop__/.eslintrc b/packages/sanity/src/desk/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/desk/__workshop__/.eslintrc +++ b/packages/sanity/src/desk/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/desk/components/pane/__workshop__/.eslintrc b/packages/sanity/src/desk/components/pane/__workshop__/.eslintrc index 52a029a60171..103a0ab0257c 100644 --- a/packages/sanity/src/desk/components/pane/__workshop__/.eslintrc +++ b/packages/sanity/src/desk/components/pane/__workshop__/.eslintrc @@ -1,6 +1,7 @@ { "rules": { "no-nested-ternary": "off", - "i18next/no-literal-string": "off" + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" } } diff --git a/packages/sanity/src/desk/panes/document/statusBar/__workshop__/.eslintrc b/packages/sanity/src/desk/panes/document/statusBar/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/desk/panes/document/statusBar/__workshop__/.eslintrc +++ b/packages/sanity/src/desk/panes/document/statusBar/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/packages/sanity/src/desk/panes/document/timeline/__workshop__/.eslintrc b/packages/sanity/src/desk/panes/document/timeline/__workshop__/.eslintrc index 5f309c9fc0c4..72418294dd06 100644 --- a/packages/sanity/src/desk/panes/document/timeline/__workshop__/.eslintrc +++ b/packages/sanity/src/desk/panes/document/timeline/__workshop__/.eslintrc @@ -1,5 +1,6 @@ { - "rules": { - "i18next/no-literal-string": "off" - } + "rules": { + "i18next/no-literal-string": "off", + "no-attribute-string-literals/no-attribute-string-literals": "off" + } } diff --git a/yarn.lock b/yarn.lock index 35a038c3e317..eab6a06cf0ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7466,6 +7466,11 @@ eslint-plugin-jsx-a11y@^6.7.1: object.fromentries "^2.0.6" semver "^6.3.0" +eslint-plugin-no-attribute-string-literals@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-attribute-string-literals/-/eslint-plugin-no-attribute-string-literals-1.0.0.tgz#8b09178922fa20047d1b23166f4e3839acc649f1" + integrity sha512-agpa3mK8H3e/nvlGzgIPc8kz6/lQIK9M1CiEQO5H3Rj3ujyhl39016oGz1wJjB4EKf2KoKowcfbUoWWh0G70Cw== + eslint-plugin-prettier@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz#6887780ed95f7708340ec79acfdf60c35b9be57a"