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} */ /** @type {import('eslint').Linter.Config} */
module.exports = { module.exports = {
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
@ -29,12 +23,7 @@ module.exports = {
browser: true, browser: true,
es6: true, es6: true,
}, },
plugins: [ plugins: ['react', 'react-hooks', 'prettier', '@typescript-eslint'],
'react',
'react-hooks',
'prettier',
'@typescript-eslint',
],
extends: [ extends: [
// 'standard', // 'standard',
'eslint:recommended', 'eslint:recommended',
@ -44,7 +33,7 @@ module.exports = {
], ],
rules: { rules: {
eqeqeq: 'error', eqeqeq: 'error',
'prettier/prettier': ['error', prettier], 'prettier/prettier': ['error', {}, { usePrettierrc: true }],
// TypeScript can infer this significantly better than eslint ever can. // TypeScript can infer this significantly better than eslint ever can.
'react/prop-types': 0, 'react/prop-types': 0,
'react/display-name': 0, 'react/display-name': 0,
@ -58,5 +47,5 @@ module.exports = {
'@typescript-eslint/no-use-before-define': 'warn', '@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': 'allow-with-description' }], '@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"
}