EsLint speedup (#161)
* Updated packages * Fix Turbo TURBO_SCM_BASE * Disable type-aware rules
This commit is contained in:
committed by
GitHub
parent
f2c74bd11c
commit
e403a6cd75
@@ -1,6 +1,6 @@
|
||||
export default [
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
files: ['app/**/*.{ts,tsx}'],
|
||||
rules: {
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
|
||||
@@ -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',
|
||||
],
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import eslint from '@eslint/js';
|
||||
|
||||
export default [eslint.configs.recommended];
|
||||
@@ -6,9 +6,10 @@ const compat = new FlatCompat({
|
||||
|
||||
const nextEslintConfig = [
|
||||
...compat.config({
|
||||
extends: ['next/core-web-vitals', 'next/typescript'],
|
||||
extends: ['plugin:@next/next/recommended'],
|
||||
rules: {
|
||||
'@next/next/no-html-link-for-pages': 'off',
|
||||
'no-undef': 'off'
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
@@ -10,23 +10,19 @@
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --check \"**/*.{js,json}\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@next/eslint-plugin-next": "15.1.7",
|
||||
"@types/eslint": "9.6.1",
|
||||
"eslint-config-next": "15.1.7",
|
||||
"eslint-config-prettier": "^10.0.1",
|
||||
"eslint-config-turbo": "^2.4.1",
|
||||
"eslint-plugin-react": "7.37.4",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"typescript-eslint": "8.24.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kit/prettier-config": "workspace:*",
|
||||
"@kit/tsconfig": "workspace:*",
|
||||
"eslint": "^9.20.0",
|
||||
"eslint": "^9.20.1",
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"prettier": "@kit/prettier-config"
|
||||
|
||||
@@ -25,6 +25,6 @@ export function checkPendingMigrations() {
|
||||
console.log('\x1b[32m%s\x1b[0m', '✅ All migrations are up to date.');
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('\x1b[33m%s\x1b[0m', '⚠️ Migrations: No remote Supabase project found, we could not check pending migrations. This is normal if you have not yet have linked your Supabase project. Feel free to ignore this message.');
|
||||
console.log('\x1b[33m%s\x1b[0m', '💡 Info: Project not yet linked to a remote Supabase project. Migration checks skipped - this is expected for new projects. Link your project when you\'re ready to sync with Supabase.\n');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user