50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
import tseslint from '@typescript-eslint/eslint-plugin';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
import prettier from 'eslint-plugin-prettier';
|
|
import prettierConfig from 'eslint-config-prettier';
|
|
|
|
export default [
|
|
{
|
|
ignores: ['dist', 'node_modules'],
|
|
},
|
|
{
|
|
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
ecmaFeatures: { jsx: true },
|
|
sourceType: 'module',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tseslint,
|
|
'react-hooks': reactHooks,
|
|
'react-refresh': reactRefresh,
|
|
prettier,
|
|
},
|
|
rules: {
|
|
...js.configs.recommended.rules,
|
|
...tseslint.configs.recommended.rules,
|
|
...reactHooks.configs['recommended-latest'].rules,
|
|
...prettierConfig.rules,
|
|
'no-unused-vars': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{ varsIgnorePattern: '^[A-Z_]' },
|
|
],
|
|
'prettier/prettier': 'error',
|
|
'react-refresh/only-export-components': [
|
|
'warn',
|
|
{ allowConstantExport: true },
|
|
],
|
|
},
|
|
},
|
|
];
|