| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- 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';
- import react from 'eslint-plugin-react';
- import importPlugin from 'eslint-plugin-import';
- import jsxA11y from 'eslint-plugin-jsx-a11y';
- export default [
- { ignores: ['dist/**/*', 'node_modules/**/*', 'public/**/*'] },
- js.configs.recommended,
- ...tseslint.configs.recommended,
- {
- files: ['**/*.{ts,tsx}'],
- languageOptions: {
- ecmaVersion: 2020,
- globals: {
- ...globals.browser,
- ...globals.node,
- Recordable: 'readonly',
- ImportMetaEnv: 'readonly',
- BuildCompression: 'readonly',
- },
- parser: tseslint.parser,
- parserOptions: {
- ecmaFeatures: {
- jsx: true,
- },
- sourceType: 'module',
- project: ['./tsconfig.json'],
- tsconfigRootDir: '.',
- },
- },
- plugins: {
- 'react-hooks': reactHooks,
- 'react-refresh': reactRefresh,
- react: react,
- import: importPlugin,
- 'jsx-a11y': jsxA11y,
- '@typescript-eslint': tseslint.plugin,
- },
- rules: {
- ...reactHooks.configs.recommended.rules,
- 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
- 'react/react-in-jsx-scope': 'off',
- 'react/prop-types': 'off',
- '@typescript-eslint/explicit-module-boundary-types': 'off',
- '@typescript-eslint/no-explicit-any': 'off',
- '@typescript-eslint/no-unused-vars': [
- 'warn',
- {
- argsIgnorePattern: '^_',
- varsIgnorePattern: '^_',
- ignoreRestSiblings: true,
- },
- ],
- 'import/order': [
- 'error',
- {
- groups: [
- 'builtin',
- 'external',
- 'internal',
- 'parent',
- 'sibling',
- 'index',
- 'object',
- 'type',
- ],
- pathGroups: [
- {
- pattern: 'react',
- group: 'external',
- position: 'before',
- },
- {
- pattern: '@/**',
- group: 'internal',
- position: 'before',
- },
- ],
- pathGroupsExcludedImportTypes: ['react'],
- 'newlines-between': 'always',
- alphabetize: {
- order: 'asc',
- caseInsensitive: true,
- },
- distinctGroup: true,
- },
- ],
- indent: [
- 'error',
- 4,
- {
- SwitchCase: 1,
- ignoredNodes: ['ConditionalExpression'],
- },
- ],
- 'no-unused-vars': 'off',
- 'no-redeclare': 'off',
- 'prefer-const': 'error',
- },
- settings: {
- react: {
- version: 'detect',
- },
- 'import/resolver': {
- typescript: {
- project: ['./tsconfig.json'],
- },
- },
- },
- },
- ];
|