Skip to content

Commit

Permalink
Merge pull request #14 from pkolt/11-migrate-to-vite-6
Browse files Browse the repository at this point in the history
11-migrate-to-vite-6
  • Loading branch information
pkolt authored Dec 6, 2024
2 parents 1399213 + 4d63336 commit 3bc4c7b
Show file tree
Hide file tree
Showing 8 changed files with 3,569 additions and 3,052 deletions.
61 changes: 21 additions & 40 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,39 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import reactRefresh from 'eslint-plugin-react-refresh';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
import pluginReactHooks from 'eslint-plugin-react-hooks';

/** @type {import('eslint').Linter.Config[]} */
export default [
{
ignores: ['**/dist', '**/eslint.config.js'],
},
...fixupConfigRules(
compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
),
),
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
reactRefresh.configs.recommended,

// https://github.com/facebook/react/issues/28313
{
plugins: {
'react-refresh': reactRefresh,
'@typescript-eslint': fixupPluginRules(typescriptEslint),
},

languageOptions: {
parser: tsParser,
'react-hooks': pluginReactHooks,
rules: pluginReactHooks.configs.recommended.rules,
},
},

settings: {
react: {
version: 'detect',
},
},
// It's mad: https://github.com/eslint/eslint/issues/19093
// { ignores: ['dist', 'node_modules', 'coverage'] },

{ files: ['**/*.{ts,tsx}'] },
{ settings: { react: { version: 'detect' } } },
{ languageOptions: { globals: globals.browser } },
{
rules: {
'react-refresh/only-export-components': [
'error',
{
allowConstantExport: true,
},
],

'no-console': ['error', { allow: ['warn', 'error'] }],
'react/react-in-jsx-scope': ['off'],
'react/prop-types': ['off'],
Expand Down
2 changes: 1 addition & 1 deletion knip.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["src/main.tsx!", "src/service-worker.ts!"],
"project": ["src/**/*.{ts,tsx}!", "!src/test-utils"],
"project": ["src/**/*.{ts,tsx}!", "!src/test-utils", "!src/setupTests.ts"],
"ignoreDependencies": ["bootstrap-icons", "bootstrap"],
"ignoreBinaries": ["vite"],
"ignore": ["src/**/__mocks__/**", "src/services/**"]
Expand Down
Loading

0 comments on commit 3bc4c7b

Please sign in to comment.