58 lines
1.2 KiB
JavaScript
58 lines
1.2 KiB
JavaScript
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const prettierOptions = JSON.parse(
|
|
fs.readFileSync(path.resolve(__dirname, '.prettierrc'), 'utf8')
|
|
)
|
|
|
|
module.exports = {
|
|
parser: '@typescript-eslint/parser',
|
|
plugins: [
|
|
'@typescript-eslint',
|
|
'react',
|
|
'react-hooks',
|
|
'eslint-plugin-import',
|
|
'prettier',
|
|
],
|
|
env: {
|
|
browser: true,
|
|
},
|
|
extends: [
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:react/recommended',
|
|
'plugin:prettier/recommended',
|
|
],
|
|
parserOptions: {
|
|
project: ['tsconfig.json'],
|
|
ecmaVersion: 2020,
|
|
sourceType: 'module',
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
'react/jsx-filename-extension': [
|
|
'warn',
|
|
{
|
|
extensions: ['.jsx', '.tsx'],
|
|
},
|
|
],
|
|
'react/prop-types': 'off',
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
'@typescript-eslint/no-empty-interface': [
|
|
'warn',
|
|
{
|
|
allowSingleExtends: false,
|
|
},
|
|
],
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
}
|