EsLint speedup (#161)

* Updated packages
* Fix Turbo TURBO_SCM_BASE
* Disable type-aware rules
This commit is contained in:
Giancarlo Buomprisco
2025-02-12 13:58:56 +07:00
committed by GitHub
parent f2c74bd11c
commit e403a6cd75
30 changed files with 1256 additions and 1299 deletions

View File

@@ -1,8 +1,5 @@
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintReact from 'eslint-plugin-react';
import reactPlugin from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';
import turboConfig from 'eslint-config-turbo/flat';
import tsEsLint from 'typescript-eslint';
import nextConfig from './nextjs.js';
@@ -10,45 +7,28 @@ import nextConfig from './nextjs.js';
export default tsEsLint.config(
eslint.configs.recommended,
tsEsLint.configs.recommended,
eslintReact.configs.flat.recommended,
{
languageOptions: {
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
modules: true,
},
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
nextConfig,
turboConfig,
{
settings: {
react: {
version: 'detect',
version: '19.0',
},
},
},
{
plugins: {
'react-hooks': hooksPlugin,
},
rules: hooksPlugin.configs.recommended.rules,
},
{
files: ['**/*.{ts,tsx}'],
...reactPlugin.configs.flat['jsx-runtime'],
...reactPlugin.configs.flat.recommended,
},
nextConfig,
eslintConfigPrettier,
{
rules: {
'react/react-in-jsx-scope': 'off',
'import/no-anonymous-default-export': 'off',
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-unresolved': 'off',
'import/no-named-as-default-member': 'off',
'import/no-named-as-default': 'off',
'import/no-cycle': 'off',
'import/no-unused-modules': 'off',
'import/no-deprecated': 'off',
'turbo/no-undeclared-env-vars': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
@@ -62,10 +42,6 @@ export default tsEsLint.config(
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-misused-promises': [
2,
{ checksVoidReturn: { attributes: false } },
],
'no-restricted-imports': [
'error',
{
@@ -84,7 +60,8 @@ export default tsEsLint.config(
ignores: [
'**/node_modules',
'**/database.types.ts',
'.next',
'**/.next',
'**/public',
'dist',
'pnpm-lock.yaml',
],