fix: use flat config for react eslint plugin (#265)
This commit is contained in:
parent
6812235cfa
commit
c5182d5ca4
|
@ -7,7 +7,6 @@
|
|||
import eslint from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import reactPlugin from 'eslint-plugin-react';
|
||||
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import prettierConfig from 'eslint-config-prettier';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
|
@ -29,7 +28,7 @@ export default tseslint.config(
|
|||
{
|
||||
// Global ignores
|
||||
ignores: [
|
||||
'node_modules/**',
|
||||
'node_modules/*',
|
||||
'eslint.config.js',
|
||||
'packages/cli/dist/**',
|
||||
'packages/server/dist/**',
|
||||
|
@ -38,37 +37,9 @@ export default tseslint.config(
|
|||
},
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
// React specific config
|
||||
files: ['packages/cli/src/**/*.tsx'], // Target only TSX in the cli package
|
||||
languageOptions: {
|
||||
// Keep languageOptions from reactRecommended if needed, or define explicitly
|
||||
parserOptions: {
|
||||
ecmaFeatures: { jsx: true },
|
||||
},
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
// Define the plugins used in this block
|
||||
react: reactPlugin,
|
||||
'react-hooks': reactHooks,
|
||||
},
|
||||
rules: {
|
||||
// Apply recommended rules explicitly
|
||||
...reactRecommended.rules,
|
||||
...reactHooks.configs.recommended.rules,
|
||||
// Custom overrides
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/prop-types': 'off',
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
},
|
||||
reactHooks.configs['recommended-latest'],
|
||||
reactPlugin.configs.flat.recommended,
|
||||
reactPlugin.configs.flat['jsx-runtime'], // Add this if you are using React 17+
|
||||
{
|
||||
// Import specific config
|
||||
files: ['packages/cli/src/**/*.{ts,tsx}'], // Target only TS/TSX in the cli package
|
||||
|
@ -117,7 +88,7 @@ export default tseslint.config(
|
|||
],
|
||||
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
import { Box, Static, Text, useStdout } from 'ink';
|
||||
import { StreamingState, type HistoryItem } from './types.js';
|
||||
import { useGeminiStream } from './hooks/useGeminiStream.js';
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Box, Text } from 'ink';
|
||||
export interface Suggestion {
|
||||
label: string;
|
||||
|
|
|
@ -68,7 +68,7 @@ export const useSlashCommandProcessor = (
|
|||
description: '',
|
||||
action: (_value: PartListUnion) => {
|
||||
setDebugMessage('Quitting. Good-bye.');
|
||||
const timestamp = getNextMessageId(Date.now());
|
||||
getNextMessageId(Date.now());
|
||||
process.exit(0);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"jsx": "react",
|
||||
"jsx": "react-jsx",
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2020"],
|
||||
"paths": {
|
||||
"@gemini-code/*": ["./packages/*"]
|
||||
|
|
|
@ -11,7 +11,6 @@ import { GrepTool } from '../tools/grep.js';
|
|||
import { ReadFileTool } from '../tools/read-file.js';
|
||||
import { ReadManyFilesTool } from '../tools/read-many-files.js';
|
||||
import { ShellTool } from '../tools/shell.js';
|
||||
import { WebFetchTool } from '../tools/web-fetch.js';
|
||||
import { WriteFileTool } from '../tools/write-file.js';
|
||||
|
||||
const contactEmail = 'gemini-code-dev@google.com';
|
||||
|
|
Loading…
Reference in New Issue