From d70712a0dda0616c9fbabe08f6489396c225cf89 Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Thu, 1 Jun 2023 15:31:44 -0700 Subject: [PATCH] fix: addressing minor performance concerns with the prettier plugin (#684) --- packages/eslint-config/index.js | 23 +++++++++++++---------- packages/eslint-config/react.js | 3 +-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index 57ca87a0..326560db 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -8,13 +8,10 @@ module.exports = { 'plugin:import/errors', 'plugin:import/warnings', 'plugin:you-dont-need-lodash-underscore/compatible', - 'prettier', - 'prettier/prettier', + 'plugin:prettier/recommended', // This has to be the last rule added. ], - plugins: ['eslint-comments', 'import', 'node', 'prettier', 'unicorn'], + plugins: ['node', 'unicorn'], rules: { - 'arrow-body-style': 'off', - 'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }], 'eslint-comments/no-unused-disable': 'error', @@ -26,13 +23,13 @@ module.exports = { 'import/order': [ 'error', { - 'alphabetize': { + alphabetize: { order: 'asc', caseInsensitive: true, }, - 'groups': ['type', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'], + groups: ['type', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'], 'newlines-between': 'always', - 'warnOnUnassignedImports': true, + warnOnUnassignedImports: true, }, ], @@ -56,11 +53,17 @@ module.exports = { 'prefer-destructuring': 'off', - 'prettier/prettier': ['error', prettierConfig], + 'prettier/prettier': [ + 'error', + prettierConfig, + { + usePrettierrc: false, + }, + ], // The `eslint-config-airbnb-base` that we extend off of doesn't have any rules for catching for // templated strings that aren't templates. - 'quotes': ['error', 'single', { avoidEscape: true }], + quotes: ['error', 'single', { avoidEscape: true }], 'unicorn/catch-error-name': ['error', { ignore: ['^(error|err|e)$'] }], // "unicorn/consistent-function-scoping": "error", // Maybe? diff --git a/packages/eslint-config/react.js b/packages/eslint-config/react.js index 31cc13b5..477be3f0 100644 --- a/packages/eslint-config/react.js +++ b/packages/eslint-config/react.js @@ -1,6 +1,5 @@ module.exports = { extends: ['plugin:jsx-a11y/recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended'], - plugins: ['jsx-a11y', 'react'], env: { browser: true, }, @@ -10,7 +9,7 @@ module.exports = { extensions: ['.js', '.jsx'], }, }, - 'react': { + react: { version: 'detect', }, },