diff --git a/eslint.config.js b/eslint.config.js
index a28e77400..e7f28903d 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -25,13 +25,13 @@ export const defaultESLintIgnores = [
let FlatConfig
export const rootParserOptions = {
- EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
- EXPERIMENTAL_useProjectService: {
- allowDefaultProjectForFiles: ['./src/*.ts', './src/*.tsx'],
- maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 100,
- },
sourceType: 'module',
ecmaVersion: 'latest',
+ projectService: {
+ allowDefaultProject: ['./src/*.ts', './src/*.tsx'],
+ defaultProject: './tsconfig.json',
+ maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 40,
+ },
}
/** @type {FlatConfig[]} */
diff --git a/packages/create-payload-app/eslint.config.js b/packages/create-payload-app/eslint.config.js
index e62b92c80..058709749 100644
--- a/packages/create-payload-app/eslint.config.js
+++ b/packages/create-payload-app/eslint.config.js
@@ -9,7 +9,10 @@ export const index = [
{
languageOptions: {
parserOptions: {
- project: './tsconfig.json',
+ projectService: {
+ allowDefaultProject: ['./src/*.ts', './src/*.tsx'],
+ defaultProject: './tsconfig.json',
+ },
tsconfigDirName: import.meta.dirname,
...rootParserOptions,
},
diff --git a/packages/db-mongodb/eslint.config.js b/packages/db-mongodb/eslint.config.js
index e62b92c80..058709749 100644
--- a/packages/db-mongodb/eslint.config.js
+++ b/packages/db-mongodb/eslint.config.js
@@ -9,7 +9,10 @@ export const index = [
{
languageOptions: {
parserOptions: {
- project: './tsconfig.json',
+ projectService: {
+ allowDefaultProject: ['./src/*.ts', './src/*.tsx'],
+ defaultProject: './tsconfig.json',
+ },
tsconfigDirName: import.meta.dirname,
...rootParserOptions,
},
diff --git a/packages/db-postgres/eslint.config.js b/packages/db-postgres/eslint.config.js
index e62b92c80..058709749 100644
--- a/packages/db-postgres/eslint.config.js
+++ b/packages/db-postgres/eslint.config.js
@@ -9,7 +9,10 @@ export const index = [
{
languageOptions: {
parserOptions: {
- project: './tsconfig.json',
+ projectService: {
+ allowDefaultProject: ['./src/*.ts', './src/*.tsx'],
+ defaultProject: './tsconfig.json',
+ },
tsconfigDirName: import.meta.dirname,
...rootParserOptions,
},
diff --git a/packages/email-nodemailer/eslint.config.js b/packages/email-nodemailer/eslint.config.js
index e62b92c80..058709749 100644
--- a/packages/email-nodemailer/eslint.config.js
+++ b/packages/email-nodemailer/eslint.config.js
@@ -9,7 +9,10 @@ export const index = [
{
languageOptions: {
parserOptions: {
- project: './tsconfig.json',
+ projectService: {
+ allowDefaultProject: ['./src/*.ts', './src/*.tsx'],
+ defaultProject: './tsconfig.json',
+ },
tsconfigDirName: import.meta.dirname,
...rootParserOptions,
},
diff --git a/packages/email-resend/eslint.config.js b/packages/email-resend/eslint.config.js
index e62b92c80..058709749 100644
--- a/packages/email-resend/eslint.config.js
+++ b/packages/email-resend/eslint.config.js
@@ -9,7 +9,10 @@ export const index = [
{
languageOptions: {
parserOptions: {
- project: './tsconfig.json',
+ projectService: {
+ allowDefaultProject: ['./src/*.ts', './src/*.tsx'],
+ defaultProject: './tsconfig.json',
+ },
tsconfigDirName: import.meta.dirname,
...rootParserOptions,
},
diff --git a/packages/eslint-config/index.mjs b/packages/eslint-config/index.mjs
index 722e7cdd4..5c959278f 100644
--- a/packages/eslint-config/index.mjs
+++ b/packages/eslint-config/index.mjs
@@ -1,6 +1,6 @@
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
-import perfectionistNatural from 'eslint-plugin-perfectionist/configs/recommended-natural'
+import perfectionist from 'eslint-plugin-perfectionist'
import { configs as regexpPluginConfigs } from 'eslint-plugin-regexp'
import eslintConfigPrettier from 'eslint-config-prettier'
import payloadPlugin from '@payloadcms/eslint-plugin'
@@ -30,10 +30,10 @@ const baseRules = {
{
type: 'natural',
order: 'asc',
- 'partition-by-comment': true,
- 'partition-by-new-line': true,
+ partitionByComment: true,
+ partitionByNewLine: true,
groups: ['top', 'unknown'],
- 'custom-groups': {
+ customGroups: {
top: ['_id', 'id', 'name', 'slug', 'type'],
},
},
@@ -41,13 +41,13 @@ const baseRules = {
/*'perfectionist/sort-object-types': [
'error',
{
- 'partition-by-new-line': true,
+ partitionByNewLine: true,
},
],
'perfectionist/sort-interfaces': [
'error',
{
- 'partition-by-new-line': true,
+ partitionByNewLine': true,
},
],*/
'payload/no-jsx-import-statements': 'error',
@@ -62,7 +62,6 @@ const reactA11yRules = {
const typescriptRules = {
'@typescript-eslint/no-use-before-define': 'off',
- '@typescript-eslint/ban-ts-comment': 'off',
// Type-aware any rules:
'@typescript-eslint/no-unsafe-assignment': 'off',
@@ -76,7 +75,7 @@ const typescriptRules = {
// Type-aware any rules end
// ts-expect preferred over ts-ignore. It will error if the expected error is no longer present.
- '@typescript-eslint/prefer-ts-expect-error': 'error',
+ '@typescript-eslint/ban-ts-comment': 'warn', // Recommended over deprecated @typescript-eslint/prefer-ts-expect-error: https://github.com/typescript-eslint/typescript-eslint/issues/8333. Set to warn to ease migration.
// By default, it errors for unused variables. This is annoying, warnings are enough.
'@typescript-eslint/no-unused-vars': [
'warn',
@@ -94,7 +93,17 @@ const typescriptRules = {
'@typescript-eslint/restrict-template-expressions': 'warn',
'@typescript-eslint/no-redundant-type-constituents': 'warn',
'@typescript-eslint/no-unnecessary-type-constraint': 'warn',
- '@typescript-eslint/ban-types': 'warn',
+ '@typescript-eslint/no-misused-promises': [
+ 'error',
+ {
+ // See https://github.com/typescript-eslint/typescript-eslint/issues/4619 and https://github.com/typescript-eslint/typescript-eslint/pull/4623
+ // Don't want something like
-