From 158facd53460e9d697efa29eb6d39259b6a9570e Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sun, 4 Dec 2022 16:32:15 -0700 Subject: [PATCH] eslint: fix prettier config --- .eslintrc.js | 25 +++++++------------------ .prettierrc.json | 9 +++++++++ 2 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 .prettierrc.json diff --git a/.eslintrc.js b/.eslintrc.js index 77547d879..a0bb5e9eb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,9 +1,3 @@ -const prettier = { - singleQuote: true, - jsxSingleQuote: true, - printWidth: 120, -}; - /** @type {import('eslint').Linter.Config} */ module.exports = { parser: '@typescript-eslint/parser', @@ -21,20 +15,15 @@ module.exports = { version: 'detect', }, linkComponents: [ - {name: 'Link', linkAttribute: 'to'}, - {name: 'NavLink', linkAttribute: 'to'}, + { name: 'Link', linkAttribute: 'to' }, + { name: 'NavLink', linkAttribute: 'to' }, ], }, env: { browser: true, es6: true, }, - plugins: [ - 'react', - 'react-hooks', - 'prettier', - '@typescript-eslint', - ], + plugins: ['react', 'react-hooks', 'prettier', '@typescript-eslint'], extends: [ // 'standard', 'eslint:recommended', @@ -44,7 +33,7 @@ module.exports = { ], rules: { eqeqeq: 'error', - 'prettier/prettier': ['error', prettier], + 'prettier/prettier': ['error', {}, { usePrettierrc: true }], // TypeScript can infer this significantly better than eslint ever can. 'react/prop-types': 0, 'react/display-name': 0, @@ -56,7 +45,7 @@ module.exports = { // @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use 'no-use-before-define': 0, '@typescript-eslint/no-use-before-define': 'warn', - '@typescript-eslint/no-unused-vars': ['warn', {argsIgnorePattern: '^_', varsIgnorePattern: '^_'}], - '@typescript-eslint/ban-ts-comment': ['error', {'ts-expect-error': 'allow-with-description'}], - } + '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], + '@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': 'allow-with-description' }], + }, }; diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..d000a2241 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,9 @@ +{ + "printWidth": 120, + "tabWidth": 4, + "useTabs": false, + "semi": true, + "singleQuote": true, + "jsxSingleQuote": true, + "endOfLine": "lf" +}