eslint: fix prettier config

This commit is contained in:
Matthew Penner 2022-12-04 16:32:15 -07:00
parent dd69652942
commit 158facd534
No known key found for this signature in database
2 changed files with 16 additions and 18 deletions

View file

@ -1,9 +1,3 @@
const prettier = {
singleQuote: true,
jsxSingleQuote: true,
printWidth: 120,
};
/** @type {import('eslint').Linter.Config} */
module.exports = {
parser: '@typescript-eslint/parser',
@ -29,12 +23,7 @@ module.exports = {
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,
@ -58,5 +47,5 @@ module.exports = {
'@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' }],
}
},
};

9
.prettierrc.json Normal file
View file

@ -0,0 +1,9 @@
{
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"endOfLine": "lf"
}