Update ESLint configuration and dependencies: Change lint script in package.json to use eslint directly with TypeScript extensions. Add new ESLint dependencies including @eslint/js, @typescript-eslint/eslint-plugin, and @typescript-eslint/parser to enhance code quality and maintainability. Update pnpm-lock.yaml to reflect these changes and ensure consistent package management.
This commit is contained in:
62
eslint.config.js
Normal file
62
eslint.config.js
Normal file
@@ -0,0 +1,62 @@
|
||||
import js from '@eslint/js';
|
||||
import tseslint from '@typescript-eslint/eslint-plugin';
|
||||
import tsparser from '@typescript-eslint/parser';
|
||||
import react from 'eslint-plugin-react';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import globals from 'globals';
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
languageOptions: {
|
||||
parser: tsparser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'@typescript-eslint': tseslint,
|
||||
react,
|
||||
'react-hooks': reactHooks,
|
||||
},
|
||||
rules: {
|
||||
...tseslint.configs.recommended.rules,
|
||||
...react.configs.recommended.rules,
|
||||
...reactHooks.configs.recommended.rules,
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/prop-types': 'off',
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
'react/no-unescaped-entities': 'warn',
|
||||
'react/no-unknown-property': ['error', { ignore: ['jsx'] }],
|
||||
'react-hooks/set-state-in-effect': 'warn',
|
||||
'@typescript-eslint/triple-slash-reference': 'off',
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: [
|
||||
'node_modules/**',
|
||||
'.next/**',
|
||||
'out/**',
|
||||
'build/**',
|
||||
'dist/**',
|
||||
'*.config.js',
|
||||
'prisma/generated/**',
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user