diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index b13b7a7c3..000000000 --- a/.eslintignore +++ /dev/null @@ -1,14 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp -playwright.config.ts -jest.config.js -test/live-preview/next-app -tsconfig.tsbuildinfo diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 9218c4a53..000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,72 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - extends: ['@payloadcms'], - ignorePatterns: ['README.md', 'packages/**/*.spec.ts'], - overrides: [ - { - files: ['packages/**'], - plugins: ['payload'], - rules: { - 'payload/no-jsx-import-statements': 'warn', - 'payload/no-relative-monorepo-imports': 'error', - 'payload/no-imports-from-exports-dir': 'error', - }, - }, - { - files: ['scripts/**'], - rules: { - '@typescript-eslint/no-unused-vars': 'off', - 'no-console': 'off', - 'perfectionist/sort-object-types': 'off', - 'perfectionist/sort-objects': 'off', - }, - }, - { - extends: ['plugin:@typescript-eslint/disable-type-checked'], - files: ['*.js', '*.cjs', '*.json', '*.md', '*.yml', '*.yaml'], - }, - { - files: ['packages/eslint-config-payload/**'], - rules: { - 'perfectionist/sort-objects': 'off', - }, - }, - { - files: ['templates/vercel-postgres/**'], - rules: { - 'no-restricted-exports': 'off', - }, - }, - { - files: ['package.json', 'tsconfig.json'], - rules: { - 'perfectionist/sort-array-includes': 'off', - 'perfectionist/sort-astro-attributes': 'off', - 'perfectionist/sort-classes': 'off', - 'perfectionist/sort-enums': 'off', - 'perfectionist/sort-exports': 'off', - 'perfectionist/sort-imports': 'off', - 'perfectionist/sort-interfaces': 'off', - 'perfectionist/sort-jsx-props': 'off', - 'perfectionist/sort-keys': 'off', - 'perfectionist/sort-maps': 'off', - 'perfectionist/sort-named-exports': 'off', - 'perfectionist/sort-named-imports': 'off', - 'perfectionist/sort-object-types': 'off', - 'perfectionist/sort-objects': 'off', - 'perfectionist/sort-svelte-attributes': 'off', - 'perfectionist/sort-union-types': 'off', - 'perfectionist/sort-vue-attributes': 'off', - }, - }, - ], - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true, - EXPERIMENTAL_useProjectService: true, - sourceType: 'module', - ecmaVersion: 'latest', - }, - root: true, -} diff --git a/.husky/pre-commit b/.husky/pre-commit index c6e997c4f..637b5a02f 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - pnpm run lint-staged --quiet diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..7ba95b81b --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,86 @@ +import payloadEsLintConfig from '@payloadcms/eslint-config' +import payloadPlugin from '@payloadcms/eslint-plugin' + +export const defaultESLintIgnores = [ + '**/.temp', + '**/.*', // ignore all dotfiles + '**/.git', + '**/.hg', + '**/.pnp.*', + '**/.svn', + '**/playwright.config.ts', + '**/jest.config.js', + '**/tsconfig.tsbuildinfo', + '**/README.md', + '**/eslint.config.js', + '**/payload-types.ts', + '**/dist/', + '**/.yarn/', + '**/build/', + '**/node_modules/', + '**/temp/', +] + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +export const rootParserOptions = { + EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true, + EXPERIMENTAL_useProjectService: { + allowDefaultProjectForFiles: ['./src/*.ts', './src/*.tsx'], + }, + sourceType: 'module', + ecmaVersion: 'latest', +} + +/** @type {FlatConfig[]} */ +export const rootEslintConfig = [ + ...payloadEsLintConfig, + { + ignores: [...defaultESLintIgnores, 'test/live-preview/next-app', 'packages/**/*.spec.ts'], + }, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, + { + plugins: { + payload: payloadPlugin, + }, + rules: { + 'payload/no-jsx-import-statements': 'warn', + 'payload/no-relative-monorepo-imports': 'error', + 'payload/no-imports-from-exports-dir': 'error', + }, + }, + { + files: ['scripts/**/*.ts'], + rules: { + '@typescript-eslint/no-unused-vars': 'off', + 'no-console': 'off', + 'perfectionist/sort-object-types': 'off', + 'perfectionist/sort-objects': 'off', + }, + }, +] + +export default [ + ...rootEslintConfig, + { + files: ['packages/eslint-config/**/*.ts'], + rules: { + 'perfectionist/sort-objects': 'off', + }, + }, + { + files: ['templates/vercel-postgres/**'], + rules: { + 'no-restricted-exports': 'off', + }, + }, +] diff --git a/package.json b/package.json index f267defce..766244686 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build:db-postgres": "turbo build --filter db-postgres", "build:email-nodemailer": "turbo build --filter email-nodemailer", "build:email-resend": "turbo build --filter email-resend", - "build:eslint-config-payload": "turbo build --filter eslint-config-payload", + "build:eslint-config": "turbo build --filter eslint-config", "build:force": "pnpm run build:core:force", "build:graphql": "turbo build --filter graphql", "build:live-preview": "turbo build --filter live-preview", @@ -62,7 +62,7 @@ "lint": "eslint \"packages/**/*.ts\"", "lint-staged": "lint-staged", "obliterate-playwright-cache-macos": "rm -rf ~/Library/Caches/ms-playwright && find /System/Volumes/Data/private/var/folders -type d -name 'playwright*' -exec rm -rf {} +", - "prepare": "husky install", + "prepare": "husky", "reinstall": "pnpm clean:all && pnpm install", "release:alpha": "tsx ./scripts/release.ts --bump prerelease --tag alpha", "release:beta": "tsx ./scripts/release.ts --bump prerelease --tag beta", @@ -93,6 +93,7 @@ "@jest/globals": "29.7.0", "@next/bundle-analyzer": "^14.1.0", "@payloadcms/eslint-config": "workspace:*", + "@payloadcms/eslint-plugin": "workspace:*", "@payloadcms/live-preview-react": "workspace:*", "@playwright/test": "1.43.0", "@swc/cli": "0.3.12", @@ -117,17 +118,16 @@ "drizzle-kit": "0.20.14-1f2c838", "drizzle-orm": "0.29.4", "escape-html": "^1.0.3", - "eslint-plugin-payload": "workspace:*", "execa": "5.1.1", "form-data": "3.0.1", "fs-extra": "10.1.0", "glob": "8.1.0", "globby": "11.1.0", - "husky": "^8.0.3", + "husky": "9.0.11", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "json-schema-to-typescript": "11.0.3", - "lint-staged": "^14.0.1", + "lint-staged": "15.2.7", "minimist": "1.2.8", "mongodb-memory-server": "^9.0", "next": "15.0.0-canary.53", @@ -137,7 +137,7 @@ "pino-pretty": "10.2.0", "playwright": "1.43.0", "playwright-core": "1.43.0", - "prettier": "^3.0.3", + "prettier": "3.3.2", "prompts": "2.4.2", "react": "^19.0.0-rc-f994737d14-20240522", "react-dom": "^19.0.0-rc-f994737d14-20240522", diff --git a/packages/create-payload-app/.eslintrc.cjs b/packages/create-payload-app/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/create-payload-app/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/create-payload-app/eslint.config.js b/packages/create-payload-app/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/create-payload-app/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/create-payload-app/tsconfig.json b/packages/create-payload-app/tsconfig.json index 6402cb867..566241578 100644 --- a/packages/create-payload-app/tsconfig.json +++ b/packages/create-payload-app/tsconfig.json @@ -8,6 +8,6 @@ "rootDir": "./src" /* Specify the root folder within your source files. */, "strict": true }, - "exclude": ["dist", "build", "tests", "test", "node_modules", ".eslintrc.js"], + "exclude": ["dist", "build", "tests", "test", "node_modules", "eslint.config.js"], "include": ["src/**/*.ts", "src/**/*.spec.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"] } diff --git a/packages/db-mongodb/.eslintignore b/packages/db-mongodb/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/db-mongodb/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/db-mongodb/.eslintrc.cjs b/packages/db-mongodb/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/db-mongodb/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/db-mongodb/eslint.config.js b/packages/db-mongodb/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/db-mongodb/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/db-mongodb/tsconfig.json b/packages/db-mongodb/tsconfig.json index 244090d14..d3ac9f33c 100644 --- a/packages/db-mongodb/tsconfig.json +++ b/packages/db-mongodb/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/db-postgres/.eslintignore b/packages/db-postgres/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/db-postgres/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/db-postgres/.eslintrc.cjs b/packages/db-postgres/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/db-postgres/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/db-postgres/eslint.config.js b/packages/db-postgres/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/db-postgres/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/db-postgres/tsconfig.json b/packages/db-postgres/tsconfig.json index 244090d14..d3ac9f33c 100644 --- a/packages/db-postgres/tsconfig.json +++ b/packages/db-postgres/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/email-nodemailer/.eslintignore b/packages/email-nodemailer/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/email-nodemailer/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/email-nodemailer/.eslintrc.cjs b/packages/email-nodemailer/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/email-nodemailer/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/email-nodemailer/eslint.config.js b/packages/email-nodemailer/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/email-nodemailer/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/email-resend/.eslintignore b/packages/email-resend/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/email-resend/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/email-resend/.eslintrc.cjs b/packages/email-resend/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/email-resend/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/email-resend/eslint.config.js b/packages/email-resend/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/email-resend/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/eslint-config-payload/eslint-config/configs/jest/index.js b/packages/eslint-config-payload/eslint-config/configs/jest/index.js deleted file mode 100644 index ff5221063..000000000 --- a/packages/eslint-config-payload/eslint-config/configs/jest/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - env: { - jest: true, - }, - plugins: ['jest', 'jest-dom'], - extends: ['./rules/jest.js', './rules/jest-dom.js'].map(require.resolve), - rules: {}, -} diff --git a/packages/eslint-config-payload/eslint-config/configs/react/index.js b/packages/eslint-config-payload/eslint-config/configs/react/index.js deleted file mode 100644 index ffbca53b1..000000000 --- a/packages/eslint-config-payload/eslint-config/configs/react/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - env: { - browser: true, - }, - plugins: ['jsx-a11y', 'react-hooks', 'react'], - settings: { - react: { - version: 'detect', - }, - }, - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - }, - extends: ['./rules/react-a11y.js', './rules/react.js'].map(require.resolve), - rules: {}, -} diff --git a/packages/eslint-config-payload/index.js b/packages/eslint-config-payload/index.js deleted file mode 100644 index 5badd428b..000000000 --- a/packages/eslint-config-payload/index.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - root: true, - extends: ['./eslint-config/index.js'], -} diff --git a/packages/eslint-config-payload/package.json b/packages/eslint-config-payload/package.json deleted file mode 100644 index 84d38e7f9..000000000 --- a/packages/eslint-config-payload/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@payloadcms/eslint-config", - "version": "1.1.1", - "description": "Payload styles for ESLint and Prettier", - "keywords": [], - "homepage": "https://payloadcms.com", - "repository": { - "type": "git", - "url": "https://github.com/payloadcms/payload.git", - "directory": "packages/eslint-config-payload" - }, - "license": "MIT", - "author": "Payload (https://payloadcms.com)", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "dependencies": { - "@types/eslint": "8.56.6", - "@typescript-eslint/eslint-plugin": "7.3.1", - "@typescript-eslint/parser": "7.3.1", - "eslint": "8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-import-x": "0.5.3", - "eslint-plugin-jest": "27.9.0", - "eslint-plugin-jest-dom": "5.1.0", - "eslint-plugin-jsx-a11y": "6.8.0", - "eslint-plugin-payload": "workspace:*", - "eslint-plugin-perfectionist": "2.7.0", - "eslint-plugin-react": "7.34.1", - "eslint-plugin-react-hooks": "4.6.0", - "eslint-plugin-regexp": "2.3.0" - } -} diff --git a/packages/eslint-config/configs/jest/index.mjs b/packages/eslint-config/configs/jest/index.mjs new file mode 100644 index 000000000..cbc3ad46f --- /dev/null +++ b/packages/eslint-config/configs/jest/index.mjs @@ -0,0 +1,20 @@ +import jestRules from './rules/jest.mjs' +import jestDomRules from './rules/jest-dom.mjs' +import jestDom from 'eslint-plugin-jest-dom' +import jest from 'eslint-plugin-jest' +import { deepMerge } from '../../deepMerge.js' + + +/** @type {import('eslint').Linter.FlatConfig} */ +export const index = deepMerge( + jestRules, + jestDomRules, + { + plugins: { + jest, + 'jest-dom': jestDom, + }, + } +) + +export default index diff --git a/packages/eslint-config-payload/eslint-config/configs/jest/rules/jest-dom.js b/packages/eslint-config/configs/jest/rules/jest-dom.mjs similarity index 71% rename from packages/eslint-config-payload/eslint-config/configs/jest/rules/jest-dom.js rename to packages/eslint-config/configs/jest/rules/jest-dom.mjs index b206ee0bc..47f4ec079 100644 --- a/packages/eslint-config-payload/eslint-config/configs/jest/rules/jest-dom.js +++ b/packages/eslint-config/configs/jest/rules/jest-dom.mjs @@ -1,5 +1,5 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { +/** @type {import('eslint').Linter.FlatConfig} */ +export const index = { rules: { 'jest-dom/prefer-checked': 'error', 'jest-dom/prefer-enabled-disabled': 'error', @@ -8,3 +8,5 @@ module.exports = { 'jest-dom/prefer-to-have-attribute': 'error', }, } + +export default index diff --git a/packages/eslint-config-payload/eslint-config/configs/jest/rules/jest.js b/packages/eslint-config/configs/jest/rules/jest.mjs similarity index 90% rename from packages/eslint-config-payload/eslint-config/configs/jest/rules/jest.js rename to packages/eslint-config/configs/jest/rules/jest.mjs index 153f4f511..c80176f86 100644 --- a/packages/eslint-config-payload/eslint-config/configs/jest/rules/jest.js +++ b/packages/eslint-config/configs/jest/rules/jest.mjs @@ -1,5 +1,5 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { +/** @type {import('eslint').Linter.FlatConfig} */ +export const index = { rules: { 'jest/consistent-test-it': ['error', { fn: 'it' }], 'jest/expect-expect': 'error', @@ -12,7 +12,7 @@ module.exports = { 'jest/no-focused-tests': 'error', 'jest/no-hooks': 'off', 'jest/no-identical-title': 'error', - 'jest/no-if': 'error', + 'jest/no-conditional-in-test': 'error', 'jest/no-jasmine-globals': 'error', 'jest/no-large-snapshots': 'error', 'jest/no-mocks-import': 'error', @@ -36,3 +36,5 @@ module.exports = { 'jest/valid-title': 'error', }, } + +export default index diff --git a/packages/eslint-config/configs/react/index.mjs b/packages/eslint-config/configs/react/index.mjs new file mode 100644 index 000000000..202b60706 --- /dev/null +++ b/packages/eslint-config/configs/react/index.mjs @@ -0,0 +1,44 @@ +import reactRules from './rules/react.mjs' +import reactA11yRules from './rules/react-a11y.mjs' +import jsxA11y from 'eslint-plugin-jsx-a11y' +import eslintPluginReactConfig from 'eslint-plugin-react/configs/recommended.js' +import eslintPluginReact from 'eslint-plugin-react' +import reactHooks from 'eslint-plugin-react-hooks' +import globals from 'globals'; +import { fixupPluginRules } from '@eslint/compat' +import { deepMerge } from '../../deepMerge.js' + +/** @type {import('eslint').Linter.FlatConfig} */ +export const index = deepMerge( + { + rules: eslintPluginReact.configs.recommended.rules + }, + { + rules: eslintPluginReactConfig.rules // Only take rules from the config, not plugins, as plugins there are on the old eslint v8 format => add react-hooks plugin myself below + }, + reactRules, + reactA11yRules, + { + languageOptions: { + globals: { + ...globals.browser, + }, + parserOptions: { + ecmaFeatures: { + jsx: true, + } + } + }, + plugins: { + 'jsx-a11y': jsxA11y, + react: fixupPluginRules(eslintPluginReact), + 'react-hooks': reactHooks, + }, + settings: { + react: { + version: 'detect', + }, + }, + } +) +export default index diff --git a/packages/eslint-config-payload/eslint-config/configs/react/rules/react-a11y.js b/packages/eslint-config/configs/react/rules/react-a11y.mjs similarity index 99% rename from packages/eslint-config-payload/eslint-config/configs/react/rules/react-a11y.js rename to packages/eslint-config/configs/react/rules/react-a11y.mjs index 0302f9e35..70caf7afd 100644 --- a/packages/eslint-config-payload/eslint-config/configs/react/rules/react-a11y.js +++ b/packages/eslint-config/configs/react/rules/react-a11y.mjs @@ -1,8 +1,8 @@ -/** @type {import('eslint').Linter.Config} */ // Sourced from https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react-a11y.js -module.exports = { +/** @type {import('eslint').Linter.FlatConfig} */ +export const index = { rules: { // Enforce that anchors have content // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md @@ -245,3 +245,5 @@ module.exports = { ], }, } + +export default index diff --git a/packages/eslint-config-payload/eslint-config/configs/react/rules/react.js b/packages/eslint-config/configs/react/rules/react.mjs similarity index 99% rename from packages/eslint-config-payload/eslint-config/configs/react/rules/react.js rename to packages/eslint-config/configs/react/rules/react.mjs index 41e5259a6..d8a1ca474 100644 --- a/packages/eslint-config-payload/eslint-config/configs/react/rules/react.js +++ b/packages/eslint-config/configs/react/rules/react.mjs @@ -1,5 +1,5 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { +/** @type {import('eslint').Linter.FlatConfig} */ +export const index = { rules: { // View link below for react rules documentation // https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules @@ -545,3 +545,5 @@ module.exports = { ], }, } + +export default index diff --git a/packages/eslint-config/deepMerge.js b/packages/eslint-config/deepMerge.js new file mode 100644 index 000000000..a9e996978 --- /dev/null +++ b/packages/eslint-config/deepMerge.js @@ -0,0 +1,58 @@ +/** + * obj2 has priority over obj1 + * + * Merges obj2 into obj1 + */ +export function _deepMerge(obj1, obj2, doNotMergeInNulls = true) { + const output = { ...obj1 } + + for (const key in obj2) { + if (Object.prototype.hasOwnProperty.call(obj2, key)) { + if (doNotMergeInNulls) { + if ( + (obj2[key] === null || obj2[key] === undefined) && + obj1[key] !== null && + obj1[key] !== undefined + ) { + continue + } + } + + // Check if both are arrays + if (Array.isArray(obj1[key]) && Array.isArray(obj2[key])) { + // Merge each element in the arrays + + // We need the Array.from, map rather than a normal map because this handles holes in arrays properly. A simple .map would skip holes. + output[key] = Array.from(obj2[key], (item, index) => { + if (doNotMergeInNulls) { + if ( + (item === undefined || item === null) && + obj1[key][index] !== null && + obj1[key][index] !== undefined + ) { + return obj1[key][index] + } + } + + if (typeof item === 'object' && !Array.isArray(item) && obj1[key][index]) { + // Deep merge for objects in arrays + return deepMerge(obj1[key][index], item, doNotMergeInNulls) + } + return item + }) + } else if (typeof obj2[key] === 'object' && !Array.isArray(obj2[key]) && obj1[key]) { + // Existing behavior for objects + output[key] = deepMerge(obj1[key], obj2[key], doNotMergeInNulls) + } else { + // Direct assignment for values + output[key] = obj2[key] + } + } + } + + return output +} + +export function deepMerge(...objs) { + return objs.reduce((acc, obj) => _deepMerge(acc, obj), {}) +} diff --git a/packages/eslint-config-payload/eslint-config/index.js b/packages/eslint-config/index.mjs similarity index 51% rename from packages/eslint-config-payload/eslint-config/index.js rename to packages/eslint-config/index.mjs index 478bb1904..9658b0aa7 100644 --- a/packages/eslint-config-payload/eslint-config/index.js +++ b/packages/eslint-config/index.mjs @@ -1,3 +1,16 @@ +import js from '@eslint/js' +import tseslint from 'typescript-eslint' +import perfectionistNatural from 'eslint-plugin-perfectionist/configs/recommended-natural' +import { configs as regexpPluginConfigs } from 'eslint-plugin-regexp' +import eslintConfigPrettier from 'eslint-config-prettier'; +import payloadPlugin from '@payloadcms/eslint-plugin' +import reactExtends from './configs/react/index.mjs' +import jestExtends from './configs/jest/index.mjs' +import globals from 'globals'; +import importX from 'eslint-plugin-import-x' +import typescriptParser from '@typescript-eslint/parser' +import { deepMerge } from './deepMerge.js' + const baseRules = { // This rule makes no sense when overriding class methods. This is used a lot in richtext-lexical. 'class-methods-use-this': 'off', @@ -90,113 +103,107 @@ const typescriptRules = { '@typescript-eslint/ban-types': 'warn', } -const baseExtends = [ - 'eslint:recommended', - 'plugin:perfectionist/recommended-natural', - 'plugin:regexp/recommended', +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig} */ +const baseExtends = deepMerge(js.configs.recommended, perfectionistNatural , regexpPluginConfigs['flat/recommended']) + + + +/** @type {FlatConfig[]} */ +export const rootEslintConfig = [ + { + name: 'Settings', + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + ecmaVersion: 'latest', + sourceType: 'module', + globals: { + ...globals.node, + }, + parser: typescriptParser, + }, + plugins: { + 'import-x': importX, + }, + }, + { + name: 'TypeScript', + // has 3 entries: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/src/configs/recommended-type-checked.ts + ...deepMerge( + baseExtends, + tseslint.configs.recommendedTypeChecked[0], + tseslint.configs.recommendedTypeChecked[1], + tseslint.configs.recommendedTypeChecked[2], + eslintConfigPrettier, + { + plugins: { + payload: payloadPlugin, + }, + rules: { + ...baseRules, + ...typescriptRules, + }, + } + ), + files: ['**/*.ts'], + }, + { + name: 'TypeScript-React', + ...deepMerge( + baseExtends, + tseslint.configs.recommendedTypeChecked[0], + tseslint.configs.recommendedTypeChecked[1], + tseslint.configs.recommendedTypeChecked[2], + reactExtends, + eslintConfigPrettier, + { + plugins: { + payload: payloadPlugin, + }, + rules: { + ...baseRules, + ...typescriptRules, + ...reactRules, + }, + } + ), + files: ['**/*.tsx'], + }, + { + name: 'Unit Tests', + ...deepMerge( + jestExtends, + { + plugins: { + payload: payloadPlugin + }, + rules: { + ...baseRules, + ...typescriptRules, + '@typescript-eslint/unbound-method': 'off', + }, + } + ), + files: ['**/*.spec.ts'], + }, + { + name: 'Payload Config', + plugins: { + payload: payloadPlugin + }, + rules: { + ...baseRules, + ...typescriptRules, + 'no-restricted-exports': 'off', + }, + files: ['*.config.ts', 'config.ts'], + }, ] -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: [ - '*.d.ts', - '**/tsconfig.json', - 'package.json', - '*.MD', - '.tmp', - '**/.git', - '**/build', - '**/dist/**', - '**/node_modules', - '**/temp', - '*.yml', - '*.json', - ], - env: { - es6: true, - browser: true, - node: true, - }, - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - ecmaVersion: 'latest', - sourceType: 'module', - }, - plugins: ['import-x'], // Plugins are defined in the overrides to be more specific and only target the files they are meant for. - overrides: [ - { - files: ['**/*.ts'], - plugins: ['@typescript-eslint', 'payload'], - extends: [ - ...baseExtends, - 'plugin:@typescript-eslint/recommended-type-checked', - 'prettier', // prettier needs to come last. It disables eslint rules conflicting with prettier - ], - parser: '@typescript-eslint/parser', - rules: { - ...baseRules, - ...typescriptRules, - }, - }, - { - files: ['**/*.tsx'], - plugins: ['@typescript-eslint', 'payload'], - extends: [ - ...baseExtends, - 'plugin:@typescript-eslint/recommended-type-checked', - 'plugin:react/recommended', - 'plugin:react-hooks/recommended', - './configs/react/index.js', - 'prettier', // prettier needs to come last. It disables eslint rules conflicting with prettier - ], - parser: '@typescript-eslint/parser', - rules: { - ...baseRules, - ...typescriptRules, - ...reactRules, - }, - }, - { - files: ['**/*.spec.ts'], - plugins: ['@typescript-eslint', 'payload'], - extends: [ - ...baseExtends, - 'plugin:@typescript-eslint/recommended-type-checked', - './configs/jest/index.js', - 'prettier', // prettier needs to come last. It disables eslint rules conflicting with prettier - ], - parser: '@typescript-eslint/parser', - rules: { - ...baseRules, - ...typescriptRules, - '@typescript-eslint/unbound-method': 'off', - }, - }, - { - plugins: ['payload'], - files: ['*.config.ts'], - rules: { - ...baseRules, - ...typescriptRules, - 'no-restricted-exports': 'off', - }, - }, - { - plugins: ['payload'], - files: ['config.ts'], - rules: { - ...baseRules, - ...typescriptRules, - 'no-restricted-exports': 'off', - }, - }, - ], - rules: {}, // Rules are defined in the overrides to be more specific and only target the files they are meant for. - settings: { - 'import-x/parsers': { - '@typescript-eslint/parser': ['.ts', '.tsx'], - }, - }, -} +export default rootEslintConfig diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json new file mode 100644 index 000000000..8fecdb2a9 --- /dev/null +++ b/packages/eslint-config/package.json @@ -0,0 +1,40 @@ +{ + "name": "@payloadcms/eslint-config", + "version": "1.1.1", + "description": "Payload styles for ESLint and Prettier", + "keywords": [], + "homepage": "https://payloadcms.com", + "repository": { + "type": "git", + "url": "https://github.com/payloadcms/payload.git", + "directory": "packages/eslint-config" + }, + "license": "MIT", + "author": "Payload (https://payloadcms.com)", + "type": "module", + "main": "index.mjs", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@eslint/compat": "1.1.0", + "@eslint/js": "9.6.0", + "@payloadcms/eslint-plugin": "workspace:*", + "@types/eslint": "8.56.10", + "@types/eslint__js": "8.42.3", + "@typescript-eslint/parser": "7.15.0", + "eslint": "9.6.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import-x": "0.5.3", + "eslint-plugin-jest": "28.6.0", + "eslint-plugin-jest-dom": "5.4.0", + "eslint-plugin-jsx-a11y": "6.9.0", + "eslint-plugin-perfectionist": "2.11.0", + "eslint-plugin-react": "7.34.3", + "eslint-plugin-react-hooks": "5.1.0-rc-f38c22b244-20240704", + "eslint-plugin-regexp": "2.6.0", + "globals": "15.8.0", + "typescript": "5.5.3", + "typescript-eslint": "7.15.0" + } +} diff --git a/packages/eslint-plugin-payload/index.js b/packages/eslint-plugin-payload/index.js deleted file mode 100644 index 4431211ab..000000000 --- a/packages/eslint-plugin-payload/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - rules: { - 'no-jsx-import-statements': require('./customRules/no-jsx-import-statements'), - 'no-non-retryable-assertions': require('./customRules/no-non-retryable-assertions'), - 'no-relative-monorepo-imports': require('./customRules/no-relative-monorepo-imports'), - 'no-imports-from-exports-dir': require('./customRules/no-imports-from-exports-dir'), - 'no-flaky-assertions': require('./customRules/no-flaky-assertions'), - 'no-wait-function': { - create: function (context) { - return { - CallExpression(node) { - // Check if the function being called is named "wait" - if (node.callee.name === 'wait') { - context.report({ - node, - message: - 'Usage of "wait" function is discouraged as it\'s flaky. Proper assertions should be used instead.', - }) - } - }, - } - }, - }, - }, -} diff --git a/packages/eslint-plugin-payload/package.json b/packages/eslint-plugin-payload/package.json deleted file mode 100644 index 4e8e1fed5..000000000 --- a/packages/eslint-plugin-payload/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "eslint-plugin-payload", - "version": "1.0.0", - "description": "Payload plugins for ESLint", - "keywords": [], - "homepage": "https://payloadcms.com", - "repository": { - "type": "git", - "url": "https://github.com/payloadcms/payload.git", - "directory": "packages/eslint-plugin-payload" - }, - "license": "MIT", - "author": "Payload (https://payloadcms.com)", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "dependencies": { - "@types/eslint": "8.56.6", - "@typescript-eslint/eslint-plugin": "7.3.1", - "@typescript-eslint/parser": "7.3.1", - "eslint": "8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-jest": "27.9.0", - "eslint-plugin-jest-dom": "5.1.0", - "eslint-plugin-jsx-a11y": "6.8.0", - "eslint-plugin-perfectionist": "2.7.0", - "eslint-plugin-react": "7.34.1", - "eslint-plugin-react-hooks": "4.6.0", - "eslint-plugin-regexp": "2.3.0" - } -} diff --git a/packages/eslint-plugin-payload/customRules/no-flaky-assertions.js b/packages/eslint-plugin/customRules/no-flaky-assertions.js similarity index 98% rename from packages/eslint-plugin-payload/customRules/no-flaky-assertions.js rename to packages/eslint-plugin/customRules/no-flaky-assertions.js index 3d39a04f6..9ab7334cd 100644 --- a/packages/eslint-plugin-payload/customRules/no-flaky-assertions.js +++ b/packages/eslint-plugin/customRules/no-flaky-assertions.js @@ -1,5 +1,5 @@ /** @type {import('eslint').Rule.RuleModule} */ -module.exports = { +export const rule = { meta: { type: 'problem', docs: { @@ -120,3 +120,5 @@ module.exports = { } }, } + +export default rule diff --git a/packages/eslint-plugin-payload/customRules/no-imports-from-exports-dir.js b/packages/eslint-plugin/customRules/no-imports-from-exports-dir.js similarity index 94% rename from packages/eslint-plugin-payload/customRules/no-imports-from-exports-dir.js rename to packages/eslint-plugin/customRules/no-imports-from-exports-dir.js index a2a1a6fdf..100950588 100644 --- a/packages/eslint-plugin-payload/customRules/no-imports-from-exports-dir.js +++ b/packages/eslint-plugin/customRules/no-imports-from-exports-dir.js @@ -1,5 +1,5 @@ /** @type {import('eslint').Rule.RuleModule} */ -module.exports = { +export const rule = { meta: { type: 'problem', docs: { @@ -28,3 +28,5 @@ module.exports = { } }, } + +export default rule diff --git a/packages/eslint-plugin-payload/customRules/no-jsx-import-statements.js b/packages/eslint-plugin/customRules/no-jsx-import-statements.js similarity index 94% rename from packages/eslint-plugin-payload/customRules/no-jsx-import-statements.js rename to packages/eslint-plugin/customRules/no-jsx-import-statements.js index a8d43a679..2f0667af1 100644 --- a/packages/eslint-plugin-payload/customRules/no-jsx-import-statements.js +++ b/packages/eslint-plugin/customRules/no-jsx-import-statements.js @@ -3,7 +3,7 @@ */ /** @type {import('eslint').Rule.RuleModule} */ -module.exports = { +export const rule = { meta: { type: 'problem', docs: { @@ -30,3 +30,5 @@ module.exports = { } }, } + +export default rule diff --git a/packages/eslint-plugin-payload/customRules/no-non-retryable-assertions.js b/packages/eslint-plugin/customRules/no-non-retryable-assertions.js similarity index 97% rename from packages/eslint-plugin-payload/customRules/no-non-retryable-assertions.js rename to packages/eslint-plugin/customRules/no-non-retryable-assertions.js index b460ed48a..e5a471919 100644 --- a/packages/eslint-plugin-payload/customRules/no-non-retryable-assertions.js +++ b/packages/eslint-plugin/customRules/no-non-retryable-assertions.js @@ -1,5 +1,5 @@ /** @type {import('eslint').Rule.RuleModule} */ -module.exports = { +export const rule = { meta: { type: 'problem', docs: { @@ -63,3 +63,5 @@ module.exports = { } }, } + +export default rule diff --git a/packages/eslint-plugin-payload/customRules/no-relative-monorepo-imports.js b/packages/eslint-plugin/customRules/no-relative-monorepo-imports.js similarity index 95% rename from packages/eslint-plugin-payload/customRules/no-relative-monorepo-imports.js rename to packages/eslint-plugin/customRules/no-relative-monorepo-imports.js index 0cfdf09e4..e6a609a73 100644 --- a/packages/eslint-plugin-payload/customRules/no-relative-monorepo-imports.js +++ b/packages/eslint-plugin/customRules/no-relative-monorepo-imports.js @@ -5,7 +5,7 @@ */ /** @type {import('eslint').Rule.RuleModule} */ -module.exports = { +export const rule = { meta: { type: 'problem', docs: { @@ -33,3 +33,5 @@ module.exports = { } }, } + +export default rule diff --git a/packages/eslint-plugin/index.mjs b/packages/eslint-plugin/index.mjs new file mode 100644 index 000000000..0e48a95db --- /dev/null +++ b/packages/eslint-plugin/index.mjs @@ -0,0 +1,37 @@ +import noJsxImportStatements from './customRules/no-jsx-import-statements.js' +import noNonRetryableAssertions from './customRules/no-non-retryable-assertions.js' +import noRelativeMonorepoImports from './customRules/no-relative-monorepo-imports.js' +import noImportsFromExportsDir from './customRules/no-imports-from-exports-dir.js' +import noFlakyAssertions from './customRules/no-flaky-assertions.js' + + +/** + * @type {import('eslint').ESLint.Plugin} + */ +const index = { + rules: { + 'no-jsx-import-statements': noJsxImportStatements, + 'no-non-retryable-assertions': noNonRetryableAssertions, + 'no-relative-monorepo-imports': noRelativeMonorepoImports, + 'no-imports-from-exports-dir': noImportsFromExportsDir, + 'no-flaky-assertions': noFlakyAssertions, + 'no-wait-function': { + create: function (context) { + return { + CallExpression(node) { + // Check if the function being called is named "wait" + if (node.callee.name === 'wait') { + context.report({ + node, + message: + 'Usage of "wait" function is discouraged as it\'s flaky. Proper assertions should be used instead.', + }) + } + }, + } + }, + }, + }, +} + +export default index diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json new file mode 100644 index 000000000..a4f424625 --- /dev/null +++ b/packages/eslint-plugin/package.json @@ -0,0 +1,39 @@ +{ + "name": "@payloadcms/eslint-plugin", + "version": "1.0.0", + "description": "Payload plugins for ESLint", + "keywords": [], + "homepage": "https://payloadcms.com", + "repository": { + "type": "git", + "url": "https://github.com/payloadcms/payload.git", + "directory": "packages/eslint-plugin" + }, + "license": "MIT", + "author": "Payload (https://payloadcms.com)", + "type": "module", + "main": "index.mjs", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@eslint/compat": "1.1.0", + "@eslint/js": "9.6.0", + "@types/eslint": "8.56.10", + "@types/eslint__js": "8.42.3", + "@typescript-eslint/parser": "7.15.0", + "eslint": "9.6.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import-x": "0.5.3", + "eslint-plugin-jest": "28.6.0", + "eslint-plugin-jest-dom": "5.4.0", + "eslint-plugin-jsx-a11y": "6.9.0", + "eslint-plugin-perfectionist": "2.11.0", + "eslint-plugin-react": "7.34.3", + "eslint-plugin-react-hooks": "5.1.0-rc-f38c22b244-20240704", + "eslint-plugin-regexp": "2.6.0", + "globals": "15.8.0", + "typescript": "5.5.3", + "typescript-eslint": "7.15.0" + } +} diff --git a/packages/graphql/.eslintrc.cjs b/packages/graphql/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/graphql/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/graphql/eslint.config.js b/packages/graphql/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/graphql/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/graphql/tsconfig.json b/packages/graphql/tsconfig.json index 7da6b51b7..79d535b16 100644 --- a/packages/graphql/tsconfig.json +++ b/packages/graphql/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/live-preview-react/.eslintignore b/packages/live-preview-react/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/live-preview-react/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/live-preview-react/.eslintrc.cjs b/packages/live-preview-react/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/live-preview-react/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/live-preview-react/eslint.config.js b/packages/live-preview-react/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/live-preview-react/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/live-preview-react/tsconfig.json b/packages/live-preview-react/tsconfig.json index 039433423..26e0a63c1 100644 --- a/packages/live-preview-react/tsconfig.json +++ b/packages/live-preview-react/tsconfig.json @@ -14,7 +14,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/live-preview-vue/.eslintignore b/packages/live-preview-vue/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/live-preview-vue/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/live-preview-vue/eslint.config.js b/packages/live-preview-vue/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/live-preview-vue/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/live-preview-vue/tsconfig.json b/packages/live-preview-vue/tsconfig.json index 1d3a03b40..2aa83167b 100644 --- a/packages/live-preview-vue/tsconfig.json +++ b/packages/live-preview-vue/tsconfig.json @@ -14,7 +14,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/live-preview/.eslintignore b/packages/live-preview/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/live-preview/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/live-preview/.eslintrc.cjs b/packages/live-preview/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/live-preview/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/live-preview/eslint.config.js b/packages/live-preview/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/live-preview/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/live-preview/tsconfig.json b/packages/live-preview/tsconfig.json index 7da6b51b7..79d535b16 100644 --- a/packages/live-preview/tsconfig.json +++ b/packages/live-preview/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/next/.eslintignore b/packages/next/.eslintignore deleted file mode 100644 index ca8614199..000000000 --- a/packages/next/.eslintignore +++ /dev/null @@ -1,11 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp -bin diff --git a/packages/next/.eslintrc.cjs b/packages/next/.eslintrc.cjs deleted file mode 100644 index 76bf8eed9..000000000 --- a/packages/next/.eslintrc.cjs +++ /dev/null @@ -1,12 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, - settings: { - next: { - rootDir: '../../app/', - }, - }, -} diff --git a/packages/next/eslint.config.js b/packages/next/eslint.config.js new file mode 100644 index 000000000..8b6704faa --- /dev/null +++ b/packages/next/eslint.config.js @@ -0,0 +1,25 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + settings: { + next: { + rootDir: '../../app/', + }, + }, + }, +] + +export default index diff --git a/packages/payload/.eslintignore b/packages/payload/.eslintignore deleted file mode 100644 index 33e1edd96..000000000 --- a/packages/payload/.eslintignore +++ /dev/null @@ -1,12 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp -templates.ts -scripts diff --git a/packages/payload/.eslintrc.cjs b/packages/payload/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/payload/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/payload/eslint.config.js b/packages/payload/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/payload/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/payload/tsconfig.json b/packages/payload/tsconfig.json index a5c97cd40..520a06ea1 100644 --- a/packages/payload/tsconfig.json +++ b/packages/payload/tsconfig.json @@ -21,7 +21,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", @@ -30,8 +30,5 @@ ], /* Like tsconfig.build.json, but includes test directory and doesnt emit anything */ "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], - "ts-node": { - "swc": true - }, "references": [{ "path": "../translations" }] } diff --git a/packages/plugin-cloud-storage/.eslintrc.cjs b/packages/plugin-cloud-storage/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-cloud-storage/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-cloud-storage/eslint.config.js b/packages/plugin-cloud-storage/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-cloud-storage/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-cloud-storage/tsconfig.json b/packages/plugin-cloud-storage/tsconfig.json index 7da6b51b7..79d535b16 100644 --- a/packages/plugin-cloud-storage/tsconfig.json +++ b/packages/plugin-cloud-storage/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/plugin-cloud/.eslintrc.cjs b/packages/plugin-cloud/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-cloud/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-cloud/eslint.config.js b/packages/plugin-cloud/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-cloud/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-cloud/tsconfig.json b/packages/plugin-cloud/tsconfig.json index e7ef5dd9c..ed456820b 100644 --- a/packages/plugin-cloud/tsconfig.json +++ b/packages/plugin-cloud/tsconfig.json @@ -7,7 +7,7 @@ "outDir": "./dist" /* Specify an output folder for all emitted files. */, "rootDir": "./src" /* Specify the root folder within your source files. */ }, - "exclude": ["dist", "build", "tests", "test", "node_modules", ".eslintrc.js"], + "exclude": ["dist", "build", "tests", "test", "node_modules", "eslint.config.js"], "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], "references": [{ "path": "../payload" }] } diff --git a/packages/plugin-form-builder/.eslintrc.cjs b/packages/plugin-form-builder/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-form-builder/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-form-builder/eslint.config.js b/packages/plugin-form-builder/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-form-builder/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-form-builder/tsconfig.json b/packages/plugin-form-builder/tsconfig.json index 9af667b80..e61d08734 100644 --- a/packages/plugin-form-builder/tsconfig.json +++ b/packages/plugin-form-builder/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/plugin-nested-docs/.eslintrc.cjs b/packages/plugin-nested-docs/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-nested-docs/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-nested-docs/eslint.config.js b/packages/plugin-nested-docs/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-nested-docs/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-nested-docs/tsconfig.json b/packages/plugin-nested-docs/tsconfig.json index 039433423..26e0a63c1 100644 --- a/packages/plugin-nested-docs/tsconfig.json +++ b/packages/plugin-nested-docs/tsconfig.json @@ -14,7 +14,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/plugin-redirects/.eslintrc.cjs b/packages/plugin-redirects/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-redirects/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-redirects/eslint.config.js b/packages/plugin-redirects/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-redirects/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-redirects/tsconfig.json b/packages/plugin-redirects/tsconfig.json index 7da6b51b7..79d535b16 100644 --- a/packages/plugin-redirects/tsconfig.json +++ b/packages/plugin-redirects/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/plugin-relationship-object-ids/.eslintrc.cjs b/packages/plugin-relationship-object-ids/.eslintrc.cjs deleted file mode 100644 index c1b1716e7..000000000 --- a/packages/plugin-relationship-object-ids/.eslintrc.cjs +++ /dev/null @@ -1,37 +0,0 @@ -/** @type {import('prettier').Config} */ -module.exports = { - extends: ['@payloadcms'], - overrides: [ - { - extends: ['plugin:@typescript-eslint/disable-type-checked'], - files: ['*.js', '*.cjs', '*.json', '*.md', '*.yml', '*.yaml'], - }, - { - files: ['package.json', 'tsconfig.json'], - rules: { - 'perfectionist/sort-array-includes': 'off', - 'perfectionist/sort-astro-attributes': 'off', - 'perfectionist/sort-classes': 'off', - 'perfectionist/sort-enums': 'off', - 'perfectionist/sort-exports': 'off', - 'perfectionist/sort-imports': 'off', - 'perfectionist/sort-interfaces': 'off', - 'perfectionist/sort-jsx-props': 'off', - 'perfectionist/sort-keys': 'off', - 'perfectionist/sort-maps': 'off', - 'perfectionist/sort-named-exports': 'off', - 'perfectionist/sort-named-imports': 'off', - 'perfectionist/sort-object-types': 'off', - 'perfectionist/sort-objects': 'off', - 'perfectionist/sort-svelte-attributes': 'off', - 'perfectionist/sort-union-types': 'off', - 'perfectionist/sort-vue-attributes': 'off', - }, - }, - ], - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, - root: true, -} diff --git a/packages/plugin-relationship-object-ids/eslint.config.js b/packages/plugin-relationship-object-ids/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-relationship-object-ids/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-relationship-object-ids/tsconfig.json b/packages/plugin-relationship-object-ids/tsconfig.json index 57224ca2d..79d535b16 100644 --- a/packages/plugin-relationship-object-ids/tsconfig.json +++ b/packages/plugin-relationship-object-ids/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.cjs", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/plugin-search/.eslintrc.cjs b/packages/plugin-search/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-search/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-search/eslint.config.js b/packages/plugin-search/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-search/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-search/tsconfig.json b/packages/plugin-search/tsconfig.json index 695e2598a..ce208f054 100644 --- a/packages/plugin-search/tsconfig.json +++ b/packages/plugin-search/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/plugin-sentry/.eslintrc.cjs b/packages/plugin-sentry/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-sentry/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-sentry/eslint.config.js b/packages/plugin-sentry/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-sentry/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-sentry/tsconfig.json b/packages/plugin-sentry/tsconfig.json index eac56581c..b8c565b37 100644 --- a/packages/plugin-sentry/tsconfig.json +++ b/packages/plugin-sentry/tsconfig.json @@ -14,7 +14,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/plugin-seo/.eslintrc.cjs b/packages/plugin-seo/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-seo/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-seo/eslint.config.js b/packages/plugin-seo/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-seo/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-seo/tsconfig.json b/packages/plugin-seo/tsconfig.json index 7d4cf51e3..811d94e48 100644 --- a/packages/plugin-seo/tsconfig.json +++ b/packages/plugin-seo/tsconfig.json @@ -14,7 +14,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/plugin-stripe/.eslintrc.cjs b/packages/plugin-stripe/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/plugin-stripe/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/plugin-stripe/eslint.config.js b/packages/plugin-stripe/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/plugin-stripe/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/plugin-stripe/tsconfig.json b/packages/plugin-stripe/tsconfig.json index cc2d9c46d..8296b7bf9 100644 --- a/packages/plugin-stripe/tsconfig.json +++ b/packages/plugin-stripe/tsconfig.json @@ -13,7 +13,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/richtext-lexical/.eslintignore b/packages/richtext-lexical/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/richtext-lexical/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/richtext-lexical/.eslintrc.cjs b/packages/richtext-lexical/.eslintrc.cjs deleted file mode 100644 index 954fc11fb..000000000 --- a/packages/richtext-lexical/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, - extends: ['plugin:@lexical/recommended'], -} diff --git a/packages/richtext-lexical/eslint.config.js b/packages/richtext-lexical/eslint.config.js new file mode 100644 index 000000000..61c342984 --- /dev/null +++ b/packages/richtext-lexical/eslint.config.js @@ -0,0 +1,25 @@ +import lexical from '@lexical/eslint-plugin' +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + plugins: { + '@lexical': lexical, + }, + rules: lexical.configs.recommended.rules, + }, +] + +export default index diff --git a/packages/richtext-lexical/src/cell/index.tsx b/packages/richtext-lexical/src/cell/index.tsx index 6e8bf44a0..37d7ebd75 100644 --- a/packages/richtext-lexical/src/cell/index.tsx +++ b/packages/richtext-lexical/src/cell/index.tsx @@ -17,10 +17,10 @@ import { sanitizeClientEditorConfig } from '../lexical/config/client/sanitize.js import { getEnabledNodes } from '../lexical/nodes/index.js' export const RichTextCell: React.FC< - CellComponentProps & { + { admin?: LexicalFieldAdminProps lexicalEditorConfig: LexicalEditorConfig - } + } & CellComponentProps > = (props) => { const { admin, lexicalEditorConfig, richTextComponentMap } = props diff --git a/packages/richtext-lexical/src/features/blocks/component/BlockContent.tsx b/packages/richtext-lexical/src/features/blocks/component/BlockContent.tsx index fb0a2ef93..8c893378b 100644 --- a/packages/richtext-lexical/src/features/blocks/component/BlockContent.tsx +++ b/packages/richtext-lexical/src/features/blocks/component/BlockContent.tsx @@ -26,11 +26,11 @@ import { FormSavePlugin } from './FormSavePlugin.js' type Props = { baseClass: string - field: FormFieldBase & { + field: { editorConfig: SanitizedClientEditorConfig // With rendered features n stuff name: string richTextComponentMap: Map - } + } & FormFieldBase formData: BlockFields formSchema: FieldMap nodeKey: string diff --git a/packages/richtext-lexical/src/field/index.tsx b/packages/richtext-lexical/src/field/index.tsx index ac66b0512..2e3590835 100644 --- a/packages/richtext-lexical/src/field/index.tsx +++ b/packages/richtext-lexical/src/field/index.tsx @@ -18,12 +18,12 @@ const RichTextEditor = lazy(() => ) export const RichTextField: React.FC< - FormFieldBase & { + { admin?: LexicalFieldAdminProps lexicalEditorConfig: LexicalEditorConfig name: string richTextComponentMap: Map - } + } & FormFieldBase > = (props) => { const { admin, lexicalEditorConfig, richTextComponentMap } = props const { schemaPath } = useFieldProps() diff --git a/packages/richtext-lexical/tsconfig.json b/packages/richtext-lexical/tsconfig.json index 4083b4b48..f67031bf5 100644 --- a/packages/richtext-lexical/tsconfig.json +++ b/packages/richtext-lexical/tsconfig.json @@ -14,7 +14,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/richtext-slate/.eslintignore b/packages/richtext-slate/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/richtext-slate/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/richtext-slate/.eslintrc.cjs b/packages/richtext-slate/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/richtext-slate/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/richtext-slate/eslint.config.js b/packages/richtext-slate/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/richtext-slate/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/richtext-slate/tsconfig.json b/packages/richtext-slate/tsconfig.json index edfc19fdf..c2fc6e86b 100644 --- a/packages/richtext-slate/tsconfig.json +++ b/packages/richtext-slate/tsconfig.json @@ -14,7 +14,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/packages/storage-azure/.eslintignore b/packages/storage-azure/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/storage-azure/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/storage-azure/.eslintrc.cjs b/packages/storage-azure/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/storage-azure/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/storage-azure/eslint.config.js b/packages/storage-azure/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/storage-azure/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/storage-gcs/.eslintignore b/packages/storage-gcs/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/storage-gcs/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/storage-gcs/.eslintrc.cjs b/packages/storage-gcs/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/storage-gcs/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/storage-gcs/eslint.config.js b/packages/storage-gcs/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/storage-gcs/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/storage-s3/.eslintignore b/packages/storage-s3/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/storage-s3/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/storage-s3/.eslintrc.cjs b/packages/storage-s3/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/storage-s3/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/storage-s3/eslint.config.js b/packages/storage-s3/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/storage-s3/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/storage-uploadthing/.eslintignore b/packages/storage-uploadthing/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/storage-uploadthing/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/storage-uploadthing/.eslintrc.cjs b/packages/storage-uploadthing/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/storage-uploadthing/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/storage-uploadthing/eslint.config.js b/packages/storage-uploadthing/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/storage-uploadthing/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/storage-vercel-blob/.eslintignore b/packages/storage-vercel-blob/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/storage-vercel-blob/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/storage-vercel-blob/.eslintrc.cjs b/packages/storage-vercel-blob/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/storage-vercel-blob/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/storage-vercel-blob/eslint.config.js b/packages/storage-vercel-blob/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/storage-vercel-blob/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/translations/.eslintignore b/packages/translations/.eslintignore deleted file mode 100644 index 0c8d9edc0..000000000 --- a/packages/translations/.eslintignore +++ /dev/null @@ -1,12 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp -**/all/** -writeTranslationFiles.ts diff --git a/packages/translations/.eslintrc.cjs b/packages/translations/.eslintrc.cjs deleted file mode 100644 index b599f91af..000000000 --- a/packages/translations/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['src/all', 'writeTranslationFiles.ts'], - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/translations/eslint.config.js b/packages/translations/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/translations/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/translations/package.json b/packages/translations/package.json index b247c2180..5adc2a3b2 100644 --- a/packages/translations/package.json +++ b/packages/translations/package.json @@ -46,7 +46,7 @@ "@types/react": "npm:types-react@19.0.0-beta.2", "@types/react-dom": "npm:types-react-dom@19.0.0-beta.2", "dotenv": "16.4.5", - "prettier": "^3.0.3", + "prettier": "3.3.2", "typescript": "5.5.3" }, "publishConfig": { diff --git a/packages/ui/.eslintignore b/packages/ui/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/packages/ui/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/packages/ui/.eslintrc.cjs b/packages/ui/.eslintrc.cjs deleted file mode 100644 index d6b3a476b..000000000 --- a/packages/ui/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/packages/ui/eslint.config.js b/packages/ui/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/packages/ui/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 726a01c8e..0f1cc8f06 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -14,7 +14,7 @@ "tests", "test", "node_modules", - ".eslintrc.js", + "eslint.config.js", "src/**/*.spec.js", "src/**/*.spec.jsx", "src/**/*.spec.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b125ef1fe..0c5d6ffb2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,10 @@ importers: version: 14.1.4 '@payloadcms/eslint-config': specifier: workspace:* - version: link:packages/eslint-config-payload + version: link:packages/eslint-config + '@payloadcms/eslint-plugin': + specifier: workspace:* + version: link:packages/eslint-plugin '@payloadcms/live-preview-react': specifier: workspace:* version: link:packages/live-preview-react @@ -107,9 +110,6 @@ importers: escape-html: specifier: ^1.0.3 version: 1.0.3 - eslint-plugin-payload: - specifier: workspace:* - version: link:packages/eslint-plugin-payload execa: specifier: 5.1.1 version: 5.1.1 @@ -126,8 +126,8 @@ importers: specifier: 11.1.0 version: 11.1.0 husky: - specifier: ^8.0.3 - version: 8.0.3 + specifier: 9.0.11 + version: 9.0.11 jest: specifier: 29.7.0 version: 29.7.0(@types/node@20.12.5)(ts-node@10.9.1) @@ -138,8 +138,8 @@ importers: specifier: 11.0.3 version: 11.0.3 lint-staged: - specifier: ^14.0.1 - version: 14.0.1 + specifier: 15.2.7 + version: 15.2.7 minimist: specifier: 1.2.8 version: 1.2.8 @@ -168,8 +168,8 @@ importers: specifier: 1.43.0 version: 1.43.0 prettier: - specifier: ^3.0.3 - version: 3.2.5 + specifier: 3.3.2 + version: 3.3.2 prompts: specifier: 2.4.2 version: 2.4.2 @@ -300,7 +300,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/mongoose-aggregate-paginate-v2': specifier: 1.0.9 version: 1.0.9 @@ -346,7 +346,7 @@ importers: version: 0.2.4(esbuild@0.21.5) '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/pg': specifier: 8.10.2 version: 8.10.2 @@ -385,89 +385,122 @@ importers: specifier: workspace:* version: link:../payload - packages/eslint-config-payload: + packages/eslint-config: dependencies: + '@eslint/compat': + specifier: 1.1.0 + version: 1.1.0 + '@eslint/js': + specifier: 9.6.0 + version: 9.6.0 + '@payloadcms/eslint-plugin': + specifier: workspace:* + version: link:../eslint-plugin '@types/eslint': - specifier: 8.56.6 - version: 8.56.6 - '@typescript-eslint/eslint-plugin': - specifier: 7.3.1 - version: 7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.5.3) + specifier: 8.56.10 + version: 8.56.10 + '@types/eslint__js': + specifier: 8.42.3 + version: 8.42.3 '@typescript-eslint/parser': - specifier: 7.3.1 - version: 7.3.1(eslint@8.57.0)(typescript@5.5.3) + specifier: 7.15.0 + version: 7.15.0(eslint@9.6.0)(typescript@5.5.3) eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 9.6.0 + version: 9.6.0 eslint-config-prettier: specifier: 9.1.0 - version: 9.1.0(eslint@8.57.0) + version: 9.1.0(eslint@9.6.0) eslint-plugin-import-x: specifier: 0.5.3 - version: 0.5.3(eslint@8.57.0)(typescript@5.5.3) + version: 0.5.3(eslint@9.6.0)(typescript@5.5.3) eslint-plugin-jest: - specifier: 27.9.0 - version: 27.9.0(@typescript-eslint/eslint-plugin@7.3.1)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.3) + specifier: 28.6.0 + version: 28.6.0(eslint@9.6.0)(jest@29.7.0)(typescript@5.5.3) eslint-plugin-jest-dom: - specifier: 5.1.0 - version: 5.1.0(eslint@8.57.0) + specifier: 5.4.0 + version: 5.4.0(eslint@9.6.0) eslint-plugin-jsx-a11y: - specifier: 6.8.0 - version: 6.8.0(eslint@8.57.0) - eslint-plugin-payload: - specifier: workspace:* - version: link:../eslint-plugin-payload + specifier: 6.9.0 + version: 6.9.0(eslint@9.6.0) eslint-plugin-perfectionist: - specifier: 2.7.0 - version: 2.7.0(eslint@8.57.0)(typescript@5.5.3) + specifier: 2.11.0 + version: 2.11.0(eslint@9.6.0)(typescript@5.5.3) eslint-plugin-react: - specifier: 7.34.1 - version: 7.34.1(eslint@8.57.0) + specifier: 7.34.3 + version: 7.34.3(eslint@9.6.0) eslint-plugin-react-hooks: - specifier: 4.6.0 - version: 4.6.0(eslint@8.57.0) + specifier: 5.1.0-rc-f38c22b244-20240704 + version: 5.1.0-rc-f38c22b244-20240704(eslint@9.6.0) eslint-plugin-regexp: - specifier: 2.3.0 - version: 2.3.0(eslint@8.57.0) + specifier: 2.6.0 + version: 2.6.0(eslint@9.6.0) + globals: + specifier: 15.8.0 + version: 15.8.0 + typescript: + specifier: 5.5.3 + version: 5.5.3 + typescript-eslint: + specifier: 7.15.0 + version: 7.15.0(eslint@9.6.0)(typescript@5.5.3) - packages/eslint-plugin-payload: + packages/eslint-plugin: dependencies: + '@eslint/compat': + specifier: 1.1.0 + version: 1.1.0 + '@eslint/js': + specifier: 9.6.0 + version: 9.6.0 '@types/eslint': - specifier: 8.56.6 - version: 8.56.6 - '@typescript-eslint/eslint-plugin': - specifier: 7.3.1 - version: 7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.5.3) + specifier: 8.56.10 + version: 8.56.10 + '@types/eslint__js': + specifier: 8.42.3 + version: 8.42.3 '@typescript-eslint/parser': - specifier: 7.3.1 - version: 7.3.1(eslint@8.57.0)(typescript@5.5.3) + specifier: 7.15.0 + version: 7.15.0(eslint@9.6.0)(typescript@5.5.3) eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 9.6.0 + version: 9.6.0 eslint-config-prettier: specifier: 9.1.0 - version: 9.1.0(eslint@8.57.0) + version: 9.1.0(eslint@9.6.0) + eslint-plugin-import-x: + specifier: 0.5.3 + version: 0.5.3(eslint@9.6.0)(typescript@5.5.3) eslint-plugin-jest: - specifier: 27.9.0 - version: 27.9.0(@typescript-eslint/eslint-plugin@7.3.1)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.3) + specifier: 28.6.0 + version: 28.6.0(eslint@9.6.0)(jest@29.7.0)(typescript@5.5.3) eslint-plugin-jest-dom: - specifier: 5.1.0 - version: 5.1.0(eslint@8.57.0) + specifier: 5.4.0 + version: 5.4.0(eslint@9.6.0) eslint-plugin-jsx-a11y: - specifier: 6.8.0 - version: 6.8.0(eslint@8.57.0) + specifier: 6.9.0 + version: 6.9.0(eslint@9.6.0) eslint-plugin-perfectionist: - specifier: 2.7.0 - version: 2.7.0(eslint@8.57.0)(typescript@5.5.3) + specifier: 2.11.0 + version: 2.11.0(eslint@9.6.0)(typescript@5.5.3) eslint-plugin-react: - specifier: 7.34.1 - version: 7.34.1(eslint@8.57.0) + specifier: 7.34.3 + version: 7.34.3(eslint@9.6.0) eslint-plugin-react-hooks: - specifier: 4.6.0 - version: 4.6.0(eslint@8.57.0) + specifier: 5.1.0-rc-f38c22b244-20240704 + version: 5.1.0-rc-f38c22b244-20240704(eslint@9.6.0) eslint-plugin-regexp: - specifier: 2.3.0 - version: 2.3.0(eslint@8.57.0) + specifier: 2.6.0 + version: 2.6.0(eslint@9.6.0) + globals: + specifier: 15.8.0 + version: 15.8.0 + typescript: + specifier: 5.5.3 + version: 5.5.3 + typescript-eslint: + specifier: 7.15.0 + version: 7.15.0(eslint@9.6.0)(typescript@5.5.3) packages/graphql: dependencies: @@ -486,7 +519,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/pluralize': specifier: ^0.0.33 version: 0.0.33 @@ -501,7 +534,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config payload: specifier: workspace:* version: link:../payload @@ -520,7 +553,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/react': specifier: npm:types-react@19.0.0-beta.2 version: /types-react@19.0.0-beta.2 @@ -539,7 +572,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config payload: specifier: workspace:* version: link:../payload @@ -606,7 +639,7 @@ importers: version: 14.1.4 '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/busboy': specifier: ^1.5.3 version: 1.5.3 @@ -757,7 +790,7 @@ importers: version: 4.5.1(monaco-editor@0.38.0)(react-dom@19.0.0-rc-f994737d14-20240522)(react@19.0.0-rc-f994737d14-20240522) '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/express-fileupload': specifier: 1.4.1 version: 1.4.1 @@ -898,7 +931,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/escape-html': specifier: ^1.0.4 version: 1.0.4 @@ -931,7 +964,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config payload: specifier: workspace:* version: link:../payload @@ -940,7 +973,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/express': specifier: ^4.17.9 version: 4.17.21 @@ -962,7 +995,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config payload: specifier: workspace:* version: link:../payload @@ -984,7 +1017,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/express': specifier: ^4.17.9 version: 4.17.21 @@ -1018,7 +1051,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/express': specifier: ^4.17.9 version: 4.17.21 @@ -1067,7 +1100,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@payloadcms/next': specifier: workspace:* version: link:../next @@ -1104,7 +1137,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@payloadcms/next': specifier: workspace:* version: link:../next @@ -1195,10 +1228,10 @@ importers: devDependencies: '@lexical/eslint-plugin': specifier: ' 0.16.1' - version: 0.16.1(eslint@8.57.0) + version: 0.16.1(eslint@9.6.0) '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@payloadcms/next': specifier: workspace:* version: link:../next @@ -1256,7 +1289,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@payloadcms/ui': specifier: workspace:* version: link:../ui @@ -1361,7 +1394,7 @@ importers: devDependencies: '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@swc/core': specifier: ^1.6.1 version: 1.6.5 @@ -1375,8 +1408,8 @@ importers: specifier: 16.4.5 version: 16.4.5 prettier: - specifier: ^3.0.3 - version: 3.2.5 + specifier: 3.3.2 + version: 3.3.2 typescript: specifier: 5.5.3 version: 5.5.3 @@ -1479,7 +1512,7 @@ importers: version: 0.2.4(esbuild@0.21.5) '@payloadcms/eslint-config': specifier: workspace:* - version: link:../eslint-config-payload + version: link:../eslint-config '@types/body-scroll-lock': specifier: ^3.1.0 version: 3.1.2 @@ -1557,7 +1590,10 @@ importers: version: link:../packages/email-resend '@payloadcms/eslint-config': specifier: workspace:* - version: link:../packages/eslint-config-payload + version: link:../packages/eslint-config + '@payloadcms/eslint-plugin': + specifier: workspace:* + version: link:../packages/eslint-plugin '@payloadcms/graphql': specifier: workspace:* version: link:../packages/graphql @@ -1648,12 +1684,9 @@ importers: dotenv: specifier: 16.4.5 version: 16.4.5 - eslint-plugin-payload: - specifier: workspace:* - version: link:../packages/eslint-plugin-payload eslint-plugin-playwright: - specifier: 1.5.3 - version: 1.5.3(eslint@8.57.0) + specifier: 1.6.2 + version: 1.6.2(eslint@9.6.0) execa: specifier: 5.1.1 version: 5.1.1 @@ -5029,27 +5062,42 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): + /@eslint-community/eslint-utils@4.4.0(eslint@9.6.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.57.0 + eslint: 9.6.0 eslint-visitor-keys: 3.4.3 /@eslint-community/regexpp@4.10.0: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - /@eslint/eslintrc@2.1.4: - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@eslint/compat@1.1.0: + resolution: {integrity: sha512-s9Wi/p25+KbzxKlDm3VshQdImhWk+cbdblhwGNnyCU5lpSwtWa4v7VQCxSki0FAUrGA3s8nCWgYzAH41mwQVKQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: false + + /@eslint/config-array@0.17.0: + resolution: {integrity: sha512-A68TBu6/1mHHuc5YJL0U0VVeGNiklLAL6rRmhTCP2B5XjWLMnrX+HkO+IAXyHvks5cyyY1jjK5ITPQ1HGS2EVA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.4(supports-color@5.5.0) + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + /@eslint/eslintrc@3.1.0: + resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: ajv: 6.12.6 debug: 4.3.4(supports-color@5.5.0) - espree: 9.6.1 - globals: 13.24.0 + espree: 10.1.0 + globals: 14.0.0 ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -5058,9 +5106,13 @@ packages: transitivePeerDependencies: - supports-color - /@eslint/js@8.57.0: - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@eslint/js@9.6.0: + resolution: {integrity: sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + /@eslint/object-schema@2.1.4: + resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} /@faceless-ui/modal@3.0.0-beta.0(react-dom@19.0.0-rc-f994737d14-20240522)(react@19.0.0-rc-f994737d14-20240522): resolution: {integrity: sha512-gZboS0pLMO4THTqAHLmZuxLOE2KyYMN9QOUikd25WSrwPOqdtcgEiRlps/RcOivHA+sowtb1IBitiIWJ0L5Eow==} @@ -5186,22 +5238,13 @@ packages: '@hapi/hoek': 9.3.0 dev: false - /@humanwhocodes/config-array@0.11.14: - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4(supports-color@5.5.0) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - /@humanwhocodes/module-importer@1.0.1: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - /@humanwhocodes/object-schema@2.0.3: - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + /@humanwhocodes/retry@0.3.0: + resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} + engines: {node: '>=18.18'} /@hyrious/esbuild-plugin-commonjs@0.2.4(esbuild@0.21.5): resolution: {integrity: sha512-NKR8bsDbNP7EpM//cjoo8Bpihmc97gPpnwrggG+18iSGow6oaJpfmy3Bv+oBgPkPlxcGzC9SXh+6szoCoKFvCw==} @@ -5708,12 +5751,12 @@ packages: lexical: 0.16.1 dev: false - /@lexical/eslint-plugin@0.16.1(eslint@8.57.0): + /@lexical/eslint-plugin@0.16.1(eslint@9.6.0): resolution: {integrity: sha512-C68eSFBAJ5H8vDae46l9iPUYYw6btC4ZAOr2vMdri8tuN4Aid5c2skDv/Ruiyk12SWsgzz9jHiyo5Fsa1ESLdg==} peerDependencies: eslint: '>=7.31.0 || ^8.0.0' dependencies: - eslint: 8.57.0 + eslint: 9.6.0 dev: true /@lexical/hashtag@0.16.1: @@ -7026,16 +7069,22 @@ packages: /@types/eslint-scope@3.7.7: resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} dependencies: - '@types/eslint': 8.56.6 + '@types/eslint': 8.56.10 '@types/estree': 1.0.5 dev: true - /@types/eslint@8.56.6: - resolution: {integrity: sha512-ymwc+qb1XkjT/gfoQwxIeHZ6ixH23A+tCT2ADSA/DPVKzAjwYkTXBMCQ/f6fe4wEa85Lhp26VPeUxI7wMhAi7A==} + /@types/eslint@8.56.10: + resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} dependencies: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 + /@types/eslint__js@8.42.3: + resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + dependencies: + '@types/eslint': 8.56.10 + dev: false + /@types/esprima@4.0.6: resolution: {integrity: sha512-lIk+kSt9lGv5hxK6aZNjiUEGZqKmOTpmg0tKiJQI+Ow98fLillxsiZNik5+RcP7mXL929KiTH/D9jGtpDlMbVw==} dependencies: @@ -7294,6 +7343,7 @@ packages: /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} + dev: true /@types/send@0.17.4: resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} @@ -7362,8 +7412,8 @@ packages: dependencies: '@types/yargs-parser': 21.0.3 - /@typescript-eslint/eslint-plugin@7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.5.3): - resolution: {integrity: sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==} + /@typescript-eslint/eslint-plugin@7.15.0(@typescript-eslint/parser@7.15.0)(eslint@9.6.0)(typescript@5.5.3): + resolution: {integrity: sha512-uiNHpyjZtFrLwLDpHnzaDlP3Tt6sGMqTCiqmxaN4n4RP0EfYZDODJyddiFDF44Hjwxr5xAcaYxVKm9QKQFJFLA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -7374,25 +7424,23 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.3.1(eslint@8.57.0)(typescript@5.5.3) - '@typescript-eslint/scope-manager': 7.3.1 - '@typescript-eslint/type-utils': 7.3.1(eslint@8.57.0)(typescript@5.5.3) - '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.5.3) - '@typescript-eslint/visitor-keys': 7.3.1 - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.57.0 + '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/scope-manager': 7.15.0 + '@typescript-eslint/type-utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 7.15.0 + eslint: 9.6.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - semver: 7.6.0 ts-api-utils: 1.3.0(typescript@5.5.3) typescript: 5.5.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser@7.3.1(eslint@8.57.0)(typescript@5.5.3): - resolution: {integrity: sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==} + /@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3): + resolution: {integrity: sha512-k9fYuQNnypLFcqORNClRykkGOMOj+pV6V91R4GO/l1FDGwpqmSwoOQrOHo3cGaH63e+D3ZiCAOsuS/D2c99j/A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -7401,33 +7449,17 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.3.1 - '@typescript-eslint/types': 7.3.1 - '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.5.3) - '@typescript-eslint/visitor-keys': 7.3.1 + '@typescript-eslint/scope-manager': 7.15.0 + '@typescript-eslint/types': 7.15.0 + '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 7.15.0 debug: 4.3.4(supports-color@5.5.0) - eslint: 8.57.0 + eslint: 9.6.0 typescript: 5.5.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/scope-manager@5.62.0: - resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - dev: false - - /@typescript-eslint/scope-manager@6.21.0: - resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - dev: false - /@typescript-eslint/scope-manager@7.15.0: resolution: {integrity: sha512-Q/1yrF/XbxOTvttNVPihxh1b9fxamjEoz2Os/Pe38OHwxC24CyCqXxGTOdpb4lt6HYtqw9HetA/Rf6gDGaMPlw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -7436,16 +7468,8 @@ packages: '@typescript-eslint/visitor-keys': 7.15.0 dev: false - /@typescript-eslint/scope-manager@7.3.1: - resolution: {integrity: sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.3.1 - '@typescript-eslint/visitor-keys': 7.3.1 - dev: false - - /@typescript-eslint/type-utils@7.3.1(eslint@8.57.0)(typescript@5.5.3): - resolution: {integrity: sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==} + /@typescript-eslint/type-utils@7.15.0(eslint@9.6.0)(typescript@5.5.3): + resolution: {integrity: sha512-SkgriaeV6PDvpA6253PDVep0qCqgbO1IOBiycjnXsszNTVQe5flN5wR5jiczoEoDEnAqYFSFFc9al9BSGVltkg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -7454,79 +7478,21 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.5.3) - '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.5.3) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) debug: 4.3.4(supports-color@5.5.0) - eslint: 8.57.0 + eslint: 9.6.0 ts-api-utils: 1.3.0(typescript@5.5.3) typescript: 5.5.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/types@5.62.0: - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: false - - /@typescript-eslint/types@6.21.0: - resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} - engines: {node: ^16.0.0 || >=18.0.0} - dev: false - /@typescript-eslint/types@7.15.0: resolution: {integrity: sha512-aV1+B1+ySXbQH0pLK0rx66I3IkiZNidYobyfn0WFsdGhSXw+P3YOqeTq5GED458SfB24tg+ux3S+9g118hjlTw==} engines: {node: ^18.18.0 || >=20.0.0} dev: false - /@typescript-eslint/types@7.3.1: - resolution: {integrity: sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==} - engines: {node: ^18.18.0 || >=20.0.0} - dev: false - - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.5.3): - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.6.0 - tsutils: 3.21.0(typescript@5.5.3) - typescript: 5.5.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@typescript-eslint/typescript-estree@6.21.0(typescript@5.5.3): - resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.5.3) - typescript: 5.5.3 - transitivePeerDependencies: - - supports-color - dev: false - /@typescript-eslint/typescript-estree@7.15.0(typescript@5.5.3): resolution: {integrity: sha512-gjyB/rHAopL/XxfmYThQbXbzRMGhZzGw6KpcMbfe8Q3nNQKStpxnUKeXb0KiN/fFDR42Z43szs6rY7eHk0zdGQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -7549,118 +7515,22 @@ packages: - supports-color dev: false - /@typescript-eslint/typescript-estree@7.3.1(typescript@5.5.3): - resolution: {integrity: sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 7.3.1 - '@typescript-eslint/visitor-keys': 7.3.1 - debug: 4.3.4(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.5.3) - typescript: 5.5.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.5.3): - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.3) - eslint: 8.57.0 - eslint-scope: 5.1.1 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: false - - /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.5.3): - resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.5.3) - eslint: 8.57.0 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: false - - /@typescript-eslint/utils@7.15.0(eslint@8.57.0)(typescript@5.5.3): + /@typescript-eslint/utils@7.15.0(eslint@9.6.0)(typescript@5.5.3): resolution: {integrity: sha512-hfDMDqaqOqsUVGiEPSMLR/AjTSCsmJwjpKkYQRo1FNbmW4tBwBspYDwO9eh7sKSTwMQgBw9/T4DHudPaqshRWA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0) '@typescript-eslint/scope-manager': 7.15.0 '@typescript-eslint/types': 7.15.0 '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.5.3) - eslint: 8.57.0 + eslint: 9.6.0 transitivePeerDependencies: - supports-color - typescript dev: false - /@typescript-eslint/utils@7.3.1(eslint@8.57.0)(typescript@5.5.3): - resolution: {integrity: sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.3.1 - '@typescript-eslint/types': 7.3.1 - '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.5.3) - eslint: 8.57.0 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: false - - /@typescript-eslint/visitor-keys@5.62.0: - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.62.0 - eslint-visitor-keys: 3.4.3 - dev: false - - /@typescript-eslint/visitor-keys@6.21.0: - resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.21.0 - eslint-visitor-keys: 3.4.3 - dev: false - /@typescript-eslint/visitor-keys@7.15.0: resolution: {integrity: sha512-Hqgy/ETgpt2L5xueA/zHHIl4fJI2O4XUE9l4+OIfbJIRSnTJb/QscncdqqZzofQegIJugRIF57OJea1khw2SDw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -7669,17 +7539,6 @@ packages: eslint-visitor-keys: 3.4.3 dev: false - /@typescript-eslint/visitor-keys@7.3.1: - resolution: {integrity: sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.3.1 - eslint-visitor-keys: 3.4.3 - dev: false - - /@ungap/structured-clone@1.2.0: - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@uploadthing/mime-types@0.2.10: resolution: {integrity: sha512-kz3F0oEgAyts25NAGXlUBCWh3mXonbSOQJFGFMawHuIgbUbnzXbe4w5WI+0XdneCbjNmikfWrdWrs8m/7HATfQ==} @@ -7971,12 +7830,12 @@ packages: acorn: 8.11.3 dev: true - /acorn-jsx@5.3.2(acorn@8.11.3): + /acorn-jsx@5.3.2(acorn@8.12.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.11.3 + acorn: 8.12.1 /acorn-walk@8.3.2: resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} @@ -7987,6 +7846,11 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + /acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + engines: {node: '>=0.4.0'} + hasBin: true + /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -8072,11 +7936,9 @@ packages: dependencies: type-fest: 0.21.3 - /ansi-escapes@5.0.0: - resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==} - engines: {node: '>=12'} - dependencies: - type-fest: 1.4.0 + /ansi-escapes@6.2.1: + resolution: {integrity: sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==} + engines: {node: '>=14.16'} dev: true /ansi-regex@4.1.1: @@ -8140,10 +8002,10 @@ packages: /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - /aria-query@5.3.0: - resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + /aria-query@5.1.3: + resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==} dependencies: - dequal: 2.0.3 + deep-equal: 2.2.3 dev: false /array-buffer-byte-length@1.0.1: @@ -8218,8 +8080,9 @@ packages: es-shim-unscopables: 1.0.2 dev: false - /array.prototype.tosorted@1.1.3: - resolution: {integrity: sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==} + /array.prototype.tosorted@1.1.4: + resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==} + engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 @@ -8303,8 +8166,8 @@ packages: possible-typed-array-names: 1.0.0 dev: false - /axe-core@4.7.0: - resolution: {integrity: sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==} + /axe-core@4.9.1: + resolution: {integrity: sha512-QbUdXJVTpvUTHU7871ppZkdOLBeGUKBQWHkHrvN2V9IQWGMt61zf3B45BtzjxEJzYuj0JBjBZP/hmYS/R9pmAw==} engines: {node: '>=4'} dev: false @@ -8318,10 +8181,10 @@ packages: - debug dev: false - /axobject-query@3.2.1: - resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} + /axobject-query@3.1.1: + resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==} dependencies: - dequal: 2.0.3 + deep-equal: 2.2.3 dev: false /b4a@1.6.6: @@ -8595,6 +8458,13 @@ packages: dependencies: fill-range: 7.0.1 + /braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.1.1 + dev: true + /browserslist@4.23.0: resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -8896,12 +8766,12 @@ packages: restore-cursor: 4.0.0 dev: true - /cli-truncate@3.1.0: - resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /cli-truncate@4.0.0: + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} + engines: {node: '>=18'} dependencies: slice-ansi: 5.0.0 - string-width: 5.1.2 + string-width: 7.2.0 dev: true /client-only@0.0.1: @@ -8997,9 +8867,9 @@ packages: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} - /commander@11.0.0: - resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==} - engines: {node: '>=16'} + /commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} dev: true /commander@2.20.3: @@ -9593,6 +9463,30 @@ packages: babel-plugin-macros: optional: true + /deep-equal@2.2.3: + resolution: {integrity: sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.7 + es-get-iterator: 1.1.3 + get-intrinsic: 1.2.4 + is-arguments: 1.1.1 + is-array-buffer: 3.0.4 + is-date-object: 1.0.5 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.3 + isarray: 2.0.5 + object-is: 1.1.6 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.2 + side-channel: 1.0.6 + which-boxed-primitive: 1.0.2 + which-collection: 1.0.2 + which-typed-array: 1.1.15 + dev: false + /deep-extend@0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} @@ -9778,6 +9672,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: esutils: 2.0.3 + dev: false /dom-helpers@5.2.1: resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==} @@ -9978,6 +9873,10 @@ packages: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + /emoji-regex@10.3.0: + resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} + dev: true + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -10096,8 +9995,22 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} - /es-iterator-helpers@1.0.18: - resolution: {integrity: sha512-scxAJaewsahbqTYrGKJihhViaM6DDZDDoucfvzNbK0pOren1g/daDQ3IAhzn+1G14rBG7w+i5N+qul60++zlKA==} + /es-get-iterator@1.1.3: + resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + has-symbols: 1.0.3 + is-arguments: 1.1.1 + is-map: 2.0.3 + is-set: 2.0.3 + is-string: 1.0.7 + isarray: 2.0.5 + stop-iteration-iterator: 1.0.0 + dev: false + + /es-iterator-helpers@1.0.19: + resolution: {integrity: sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 @@ -10332,13 +10245,13 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-prettier@9.1.0(eslint@8.57.0): + /eslint-config-prettier@9.1.0(eslint@9.6.0): resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.57.0 + eslint: 9.6.0 dev: false /eslint-import-resolver-node@0.3.9: @@ -10351,16 +10264,16 @@ packages: - supports-color dev: false - /eslint-plugin-import-x@0.5.3(eslint@8.57.0)(typescript@5.5.3): + /eslint-plugin-import-x@0.5.3(eslint@9.6.0)(typescript@5.5.3): resolution: {integrity: sha512-hJ/wkMcsLQXAZL3+txXIDpbW5cqwdm1rLTqV4VRY03aIbzE3zWE7rPZKW6Gzf7xyl1u3V1iYC6tOG77d9NF4GQ==} engines: {node: '>=16'} peerDependencies: eslint: ^8.56.0 || ^9.0.0-0 dependencies: - '@typescript-eslint/utils': 7.15.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) debug: 4.3.4(supports-color@5.5.0) doctrine: 3.0.0 - eslint: 8.57.0 + eslint: 9.6.0 eslint-import-resolver-node: 0.3.9 get-tsconfig: 4.7.3 is-glob: 4.0.3 @@ -10373,27 +10286,27 @@ packages: - typescript dev: false - /eslint-plugin-jest-dom@5.1.0(eslint@8.57.0): - resolution: {integrity: sha512-JIXZp+E/h/aGlP/rQc4tuOejiHlZXg65qw8JAJMIJA5VsdjOkss/SYcRSqBrQuEOytEM8JvngUjcz31d1RrCrA==} + /eslint-plugin-jest-dom@5.4.0(eslint@9.6.0): + resolution: {integrity: sha512-yBqvFsnpS5Sybjoq61cJiUsenRkC9K32hYQBFS9doBR7nbQZZ5FyO+X7MlmfM1C48Ejx/qTuOCgukDUNyzKZ7A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6', yarn: '>=1'} peerDependencies: - '@testing-library/dom': ^8.0.0 || ^9.0.0 - eslint: ^6.8.0 || ^7.0.0 || ^8.0.0 + '@testing-library/dom': ^8.0.0 || ^9.0.0 || ^10.0.0 + eslint: ^6.8.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 peerDependenciesMeta: '@testing-library/dom': optional: true dependencies: '@babel/runtime': 7.24.4 - eslint: 8.57.0 + eslint: 9.6.0 requireindex: 1.2.0 dev: false - /eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@7.3.1)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.3): - resolution: {integrity: sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /eslint-plugin-jest@28.6.0(eslint@9.6.0)(jest@29.7.0)(typescript@5.5.3): + resolution: {integrity: sha512-YG28E1/MIKwnz+e2H7VwYPzHUYU4aMa19w0yGcwXnnmJH6EfgHahTJ2un3IyraUxNfnz/KUhJAFXNNwWPo12tg==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} peerDependencies: - '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 || ^7.0.0 - eslint: ^7.0.0 || ^8.0.0 + '@typescript-eslint/eslint-plugin': ^6.0.0 || ^7.0.0 + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 jest: '*' peerDependenciesMeta: '@typescript-eslint/eslint-plugin': @@ -10401,47 +10314,46 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.5.3) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.3) - eslint: 8.57.0 + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + eslint: 9.6.0 jest: 29.7.0(@types/node@20.12.5)(ts-node@10.9.1) transitivePeerDependencies: - supports-color - typescript dev: false - /eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0): - resolution: {integrity: sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==} + /eslint-plugin-jsx-a11y@6.9.0(eslint@9.6.0): + resolution: {integrity: sha512-nOFOCaJG2pYqORjK19lqPqxMO/JpvdCZdPtNdxY3kvom3jTvkAbOvQvD8wuD0G8BYR0IGAGYDlzqWJOh/ybn2g==} engines: {node: '>=4.0'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 dependencies: - '@babel/runtime': 7.24.4 - aria-query: 5.3.0 + aria-query: 5.1.3 array-includes: 3.1.8 array.prototype.flatmap: 1.3.2 ast-types-flow: 0.0.8 - axe-core: 4.7.0 - axobject-query: 3.2.1 + axe-core: 4.9.1 + axobject-query: 3.1.1 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 - es-iterator-helpers: 1.0.18 - eslint: 8.57.0 + es-iterator-helpers: 1.0.19 + eslint: 9.6.0 hasown: 2.0.2 jsx-ast-utils: 3.3.5 language-tags: 1.0.9 minimatch: 3.1.2 - object.entries: 1.1.8 object.fromentries: 2.0.8 + safe-regex-test: 1.0.3 + string.prototype.includes: 2.0.0 dev: false - /eslint-plugin-perfectionist@2.7.0(eslint@8.57.0)(typescript@5.5.3): - resolution: {integrity: sha512-RpSMc0T0DT9DlOj4APzwlAjCqQMxFdsIYlupe73eDkKLn1mMK7fVw2z3nj2y822szKOpvHA7bDa56ySOlr4GXw==} + /eslint-plugin-perfectionist@2.11.0(eslint@9.6.0)(typescript@5.5.3): + resolution: {integrity: sha512-XrtBtiu5rbQv88gl+1e2RQud9te9luYNvKIgM9emttQ2zutHPzY/AQUucwxscDKV4qlTkvLTxjOFvxqeDpPorw==} peerDependencies: - astro-eslint-parser: ^0.16.0 + astro-eslint-parser: ^1.0.2 eslint: '>=8.0.0' svelte: '>=3.0.0' - svelte-eslint-parser: ^0.33.0 + svelte-eslint-parser: ^0.37.0 vue-eslint-parser: '>=9.0.0' peerDependenciesMeta: astro-eslint-parser: @@ -10453,8 +10365,8 @@ packages: vue-eslint-parser: optional: true dependencies: - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.5.3) - eslint: 8.57.0 + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + eslint: 9.6.0 minimatch: 9.0.4 natural-compare-lite: 1.4.0 transitivePeerDependencies: @@ -10462,8 +10374,8 @@ packages: - typescript dev: false - /eslint-plugin-playwright@1.5.3(eslint@8.57.0): - resolution: {integrity: sha512-13fBElB8BGdnOkK6TJ/7yveuIpfUBIVxTjbHtqTtXLsscQe2pF+0PQJkr4y2Gal7DNtg8uvqxyAQA0i/ccf1Dw==} + /eslint-plugin-playwright@1.6.2(eslint@9.6.0): + resolution: {integrity: sha512-mraN4Em3b5jLt01q7qWPyLg0Q5v3KAWfJSlEWwldyUXoa7DSPrBR4k6B6LROLqipsG8ndkwWMdjl1Ffdh15tag==} engines: {node: '>=16.6.0'} peerDependencies: eslint: '>=8.40.0' @@ -10472,21 +10384,21 @@ packages: eslint-plugin-jest: optional: true dependencies: - eslint: 8.57.0 + eslint: 9.6.0 globals: 13.24.0 dev: true - /eslint-plugin-react-hooks@4.6.0(eslint@8.57.0): - resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} + /eslint-plugin-react-hooks@5.1.0-rc-f38c22b244-20240704(eslint@9.6.0): + resolution: {integrity: sha512-2AFn/7KOJFx6RGA+7d8VluRqhB31bay0binwDJZeYJCdvrNeDQS3SmKv1/7SExyexEHBZZE/0hy6P6IQIaIZkg==} engines: {node: '>=10'} peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 dependencies: - eslint: 8.57.0 + eslint: 9.6.0 dev: false - /eslint-plugin-react@7.34.1(eslint@8.57.0): - resolution: {integrity: sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==} + /eslint-plugin-react@7.34.3(eslint@9.6.0): + resolution: {integrity: sha512-aoW4MV891jkUulwDApQbPYTVZmeuSyFrudpbTAQuj5Fv8VL+o6df2xIGpw8B0hPjAaih1/Fb0om9grCdyFYemA==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 @@ -10495,10 +10407,10 @@ packages: array.prototype.findlast: 1.2.5 array.prototype.flatmap: 1.3.2 array.prototype.toreversed: 1.1.2 - array.prototype.tosorted: 1.1.3 + array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 - es-iterator-helpers: 1.0.18 - eslint: 8.57.0 + es-iterator-helpers: 1.0.19 + eslint: 9.6.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 @@ -10512,16 +10424,16 @@ packages: string.prototype.matchall: 4.0.11 dev: false - /eslint-plugin-regexp@2.3.0(eslint@8.57.0): - resolution: {integrity: sha512-T8JUs7ssRGbuXb+CGfdUJbcxTBMCNOpNqNBLuC8JUKAEIez72J37RaOi5/4dAUsGz92GbWVtqTLPSJZGyP/sQA==} + /eslint-plugin-regexp@2.6.0(eslint@9.6.0): + resolution: {integrity: sha512-FCL851+kislsTEQEMioAlpDuK5+E5vs0hi1bF8cFlPlHcEjeRhuAzEsGikXRreE+0j4WhW2uO54MqTjXtYOi3A==} engines: {node: ^18 || >=20} peerDependencies: eslint: '>=8.44.0' dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0) '@eslint-community/regexpp': 4.10.0 comment-parser: 1.4.1 - eslint: 8.57.0 + eslint: 9.6.0 jsdoc-type-pratt-parser: 4.0.0 refa: 0.12.1 regexp-ast-analysis: 0.7.1 @@ -10534,10 +10446,11 @@ packages: dependencies: esrecurse: 4.3.0 estraverse: 4.3.0 + dev: true - /eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /eslint-scope@8.0.1: + resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 @@ -10546,41 +10459,41 @@ packages: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /eslint-visitor-keys@4.0.0: + resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + /eslint@9.6.0: + resolution: {integrity: sha512-ElQkdLMEEqQNM9Njff+2Y4q2afHk7JpkPvrd7Xh7xefwgQynqPxwf55J7di9+MEibWUGdNjFF9ITG9Pck5M84w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0) '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 + '@eslint/config-array': 0.17.0 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.6.0 '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 debug: 4.3.4(supports-color@5.5.0) - doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + eslint-scope: 8.0.1 + eslint-visitor-keys: 4.0.0 + espree: 10.1.0 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 + file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 lodash.merge: 4.6.2 @@ -10601,13 +10514,13 @@ packages: event-emitter: 0.3.5 type: 2.7.2 - /espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /espree@10.1.0: + resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.4.3 + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 4.0.0 /esprima-next@6.0.3: resolution: {integrity: sha512-fVfE+9qIOJSbS3AR7roIuL0gCeS+tC86bJV9GlJtwXCRoo67q6tsGGUjThW+JtR5IQSShnHqaDqX8D0IYDfRGA==} @@ -10635,6 +10548,7 @@ packages: /estraverse@4.3.0: resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} engines: {node: '>=4.0'} + dev: true /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} @@ -10920,11 +10834,11 @@ packages: is-unicode-supported: 2.0.0 dev: false - /file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + /file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} dependencies: - flat-cache: 3.2.0 + flat-cache: 4.0.1 /file-type@17.1.6: resolution: {integrity: sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==} @@ -10954,6 +10868,13 @@ packages: dependencies: to-regex-range: 5.0.1 + /fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + /finalhandler@1.2.0: resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} engines: {node: '>= 0.8'} @@ -11029,13 +10950,12 @@ packages: resolve-dir: 1.0.1 dev: false - /flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + /flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} dependencies: flatted: 3.3.1 keyv: 4.5.4 - rimraf: 3.0.2 /flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} @@ -11218,6 +11138,11 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + /get-east-asian-width@1.2.0: + resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + engines: {node: '>=18'} + dev: true + /get-intrinsic@1.2.4: resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} engines: {node: '>= 0.4'} @@ -11396,6 +11321,16 @@ packages: engines: {node: '>=8'} dependencies: type-fest: 0.20.2 + dev: true + + /globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + + /globals@15.8.0: + resolution: {integrity: sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==} + engines: {node: '>=18'} + dev: false /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} @@ -11467,6 +11402,7 @@ packages: /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: false /graphql-http@1.22.0(graphql@16.8.1): resolution: {integrity: sha512-9RBUlGJWBFqz9LwfpmAbjJL/8j/HCNkZwPBU5+Bfmwez+1Ay43DocMNQYpIWsWqH0Ftv6PTNAh2aRnnMCBJgLw==} @@ -11681,9 +11617,9 @@ packages: engines: {node: '>=16.17.0'} dev: true - /husky@8.0.3: - resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} - engines: {node: '>=14'} + /husky@9.0.11: + resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} + engines: {node: '>=18'} hasBin: true dev: true @@ -11811,6 +11747,14 @@ packages: engines: {node: '>= 0.10'} dev: false + /is-arguments@1.1.1: + resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + dev: false + /is-array-buffer@3.0.4: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} @@ -11920,6 +11864,13 @@ packages: engines: {node: '>=12'} dev: true + /is-fullwidth-code-point@5.0.0: + resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + engines: {node: '>=18'} + dependencies: + get-east-asian-width: 1.2.0 + dev: true + /is-generator-fn@2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} @@ -12965,11 +12916,6 @@ packages: immediate: 3.0.6 dev: true - /lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} - dev: true - /lilconfig@3.1.1: resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} engines: {node: '>=14'} @@ -12978,41 +12924,35 @@ packages: /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - /lint-staged@14.0.1: - resolution: {integrity: sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==} - engines: {node: ^16.14.0 || >=18.0.0} + /lint-staged@15.2.7: + resolution: {integrity: sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==} + engines: {node: '>=18.12.0'} hasBin: true dependencies: chalk: 5.3.0 - commander: 11.0.0 + commander: 12.1.0 debug: 4.3.4(supports-color@5.5.0) - execa: 7.2.0 - lilconfig: 2.1.0 - listr2: 6.6.1 - micromatch: 4.0.5 + execa: 8.0.1 + lilconfig: 3.1.1 + listr2: 8.2.3 + micromatch: 4.0.7 pidtree: 0.6.0 string-argv: 0.3.2 - yaml: 2.3.1 + yaml: 2.4.5 transitivePeerDependencies: - - enquirer - supports-color dev: true - /listr2@6.6.1: - resolution: {integrity: sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==} - engines: {node: '>=16.0.0'} - peerDependencies: - enquirer: '>= 2.3.0 < 3' - peerDependenciesMeta: - enquirer: - optional: true + /listr2@8.2.3: + resolution: {integrity: sha512-Lllokma2mtoniUOS94CcOErHWAug5iu7HOmDrvWgpw8jyQH2fomgB+7lZS4HWZxytUuQwkGOwe49FvwVaA85Xw==} + engines: {node: '>=18.0.0'} dependencies: - cli-truncate: 3.1.0 + cli-truncate: 4.0.0 colorette: 2.0.20 eventemitter3: 5.0.1 - log-update: 5.0.1 - rfdc: 1.3.1 - wrap-ansi: 8.1.0 + log-update: 6.0.0 + rfdc: 1.4.1 + wrap-ansi: 9.0.0 dev: true /loader-runner@4.3.0: @@ -13083,15 +13023,15 @@ packages: /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - /log-update@5.0.1: - resolution: {integrity: sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /log-update@6.0.0: + resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==} + engines: {node: '>=18'} dependencies: - ansi-escapes: 5.0.0 + ansi-escapes: 6.2.1 cli-cursor: 4.0.0 - slice-ansi: 5.0.0 + slice-ansi: 7.1.0 strip-ansi: 7.1.0 - wrap-ansi: 8.1.0 + wrap-ansi: 9.0.0 dev: true /loose-envify@1.4.0: @@ -13236,6 +13176,14 @@ packages: braces: 3.0.2 picomatch: 2.3.1 + /micromatch@4.0.7: + resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + dev: true + /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -13311,13 +13259,6 @@ packages: brace-expansion: 2.0.1 dev: false - /minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - brace-expansion: 2.0.1 - dev: false - /minimatch@9.0.4: resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} engines: {node: '>=16 || 14 >=14.17'} @@ -13825,6 +13766,14 @@ packages: /object-inspect@1.13.1: resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + /object-is@1.1.6: + resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + dev: false + /object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} @@ -15133,8 +15082,8 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - /prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + /prettier@3.3.2: + resolution: {integrity: sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==} engines: {node: '>=14'} hasBin: true dev: true @@ -15706,8 +15655,8 @@ packages: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - /rfdc@1.3.1: - resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==} + /rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} dev: true /rimraf@3.0.2: @@ -15715,6 +15664,7 @@ packages: hasBin: true dependencies: glob: 7.2.3 + dev: true /run-applescript@5.0.0: resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} @@ -16410,6 +16360,14 @@ packages: is-fullwidth-code-point: 4.0.0 dev: true + /slice-ansi@7.1.0: + resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + engines: {node: '>=18'} + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + dev: true + /smart-buffer@4.2.0: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} @@ -16539,6 +16497,13 @@ packages: /std-env@3.7.0: resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} + /stop-iteration-iterator@1.0.0: + resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} + engines: {node: '>= 0.4'} + dependencies: + internal-slot: 1.0.7 + dev: false + /stream-browserify@3.0.0: resolution: {integrity: sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==} dependencies: @@ -16594,6 +16559,22 @@ packages: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + /string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + dependencies: + emoji-regex: 10.3.0 + get-east-asian-width: 1.2.0 + strip-ansi: 7.1.0 + dev: true + + /string.prototype.includes@2.0.0: + resolution: {integrity: sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg==} + dependencies: + define-properties: 1.2.1 + es-abstract: 1.23.3 + dev: false + /string.prototype.matchall@4.0.11: resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==} engines: {node: '>= 0.4'} @@ -17215,16 +17196,6 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsutils@3.21.0(typescript@5.5.3): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: 5.5.3 - dependencies: - tslib: 1.14.1 - typescript: 5.5.3 - dev: false - /tsx@4.7.2: resolution: {integrity: sha512-BCNd4kz6fz12fyrgCTEdZHGJ9fWTGeUzXmQysh0RVocDY3h4frk05ZNCXSy4kIenF7y/QnrdiVpTsyNRn6vlAw==} engines: {node: '>=18.0.0'} @@ -17328,16 +17299,12 @@ packages: /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} + dev: true /type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} - /type-fest@1.4.0: - resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} - engines: {node: '>=10'} - dev: true - /type-fest@3.13.0: resolution: {integrity: sha512-Gur3yQGM9qiLNs0KPP7LPgeRbio2QTt4xXouobMCarR0/wyW3F+F/+OWwshg3NG0Adon7uQfSZBpB46NfhoF1A==} engines: {node: '>=14.16'} @@ -17409,6 +17376,25 @@ packages: dependencies: csstype: 3.1.3 + /typescript-eslint@7.15.0(eslint@9.6.0)(typescript@5.5.3): + resolution: {integrity: sha512-Ta40FhMXBCwHura4X4fncaCVkVcnJ9jnOq5+Lp4lN8F4DzHZtOwZdRvVBiNUGznUDHPwdGnrnwxmUOU2fFQqFA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 7.15.0(@typescript-eslint/parser@7.15.0)(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + eslint: 9.6.0 + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + dev: false + /typescript@5.5.3: resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} engines: {node: '>=14.17'} @@ -17941,6 +17927,15 @@ packages: string-width: 5.1.2 strip-ansi: 7.1.0 + /wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + dev: true + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -18033,6 +18028,12 @@ packages: engines: {node: '>= 14'} dev: true + /yaml@2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} + engines: {node: '>= 14'} + hasBin: true + dev: true + /yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} diff --git a/scripts/lib/publishList.ts b/scripts/lib/publishList.ts index 740b9fceb..fbcf420f6 100644 --- a/scripts/lib/publishList.ts +++ b/scripts/lib/publishList.ts @@ -43,7 +43,7 @@ export const packagePublishList = [ // Unpublished // 'plugin-sentry' // 'storage-uploadthing', - // 'eslint-config-payload', - // 'eslint-plugin-payload', + // 'eslint-config', + // 'eslint-plugin', // 'live-preview-vue', ] diff --git a/test/.eslintignore b/test/.eslintignore deleted file mode 100644 index 247f3f12d..000000000 --- a/test/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp diff --git a/test/.eslintrc.cjs b/test/.eslintrc.cjs deleted file mode 100644 index 5a7565683..000000000 --- a/test/.eslintrc.cjs +++ /dev/null @@ -1,80 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, - plugins: ['payload'], - rules: { - 'payload/no-relative-monorepo-imports': 'error', - }, - overrides: [ - { - extends: ['plugin:@typescript-eslint/disable-type-checked'], - files: [ - '*.js', - '*.cjs', - 'playwright.config.ts', - 'playwright.bail.config.ts', - 'bin-cks.cjs', - 'bin-esm.mjs', - 'esm-loader.mjs', - 'esm-loader-playwright.mjs', - '*.json', - '*.md', - '*.yml', - '*.yaml', - ], - }, - { - files: ['**/*.ts'], - rules: { - 'payload/no-jsx-import-statements': 'warn', - 'payload/no-relative-monorepo-imports': 'error', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-use-before-define': 'off', - // turn the @typescript-eslint/unbound-method rule off *only* for test files. See https://typescript-eslint.io/rules/unbound-method/#when-not-to-use-it - '@typescript-eslint/unbound-method': 'off', - 'no-console': 'off', - 'perfectionist/sort-objects': 'off', - }, - }, - { - files: ['**/*.int.spec.ts', '**/int.spec.ts'], - rules: { - '@typescript-eslint/no-explicit-any': 'off', - 'jest/prefer-strict-equal': 'off', - }, - }, - { - extends: ['plugin:playwright/recommended'], - files: ['**/*.e2e.spec.ts', '**/e2e.spec.ts', 'helpers.ts'], - rules: { - 'payload/no-relative-monorepo-imports': 'error', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-use-before-define': 'off', - 'jest/consistent-test-it': 'off', - 'jest/expect-expect': 'off', - 'jest/no-test-callback': 'off', - 'jest/prefer-strict-equal': 'off', - 'jest/require-top-level-describe': 'off', - 'jest-dom/prefer-to-have-attribute': 'off', - 'playwright/prefer-web-first-assertions': 'error', - 'payload/no-flaky-assertions': 'warn', - 'payload/no-wait-function': 'warn', - // Enable the no-non-retryable-assertions rule ONLY for hunting for flakes - // 'payload/no-non-retryable-assertions': 'error', - }, - }, - { - files: ['*.e2e.ts'], - rules: { - 'payload/no-relative-monorepo-imports': 'error', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-use-before-define': 'off', - 'jest/expect-expect': 'off', - }, - }, - ], -} diff --git a/test/_community/.eslintrc.cjs b/test/_community/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/_community/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/_community/e2e.spec.ts b/test/_community/e2e.spec.ts index 8677d4474..ecff243e6 100644 --- a/test/_community/e2e.spec.ts +++ b/test/_community/e2e.spec.ts @@ -7,7 +7,7 @@ import { fileURLToPath } from 'url' import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js' -import { TEST_TIMEOUT, TEST_TIMEOUT_LONG } from '../playwright.config.js' +import { TEST_TIMEOUT_LONG } from '../playwright.config.js' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) diff --git a/test/_community/eslint.config.js b/test/_community/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/_community/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/access-control/.eslintrc.cjs b/test/access-control/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/access-control/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/access-control/config.ts b/test/access-control/config.ts index f95b75742..35a2566e4 100644 --- a/test/access-control/config.ts +++ b/test/access-control/config.ts @@ -4,6 +4,8 @@ const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) import type { FieldAccess } from 'payload' +import type { Config, User } from './payload-types.js' + import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js' import { devUser } from '../credentials.js' import { TestButton } from './TestButton.js' @@ -34,9 +36,9 @@ import { const openAccess = { create: () => true, + delete: () => true, read: () => true, update: () => true, - delete: () => true, } const PublicReadabilityAccess: FieldAccess = ({ req: { user }, siblingData }) => { @@ -51,83 +53,20 @@ const UseRequestHeadersAccess: FieldAccess = ({ req: { headers } }) => { return !!headers && headers.get('authorization') === requestHeaders.get('authorization') } +function isUser(user: Config['user']): user is { + collection: 'users' +} & User { + return user?.collection === 'users' +} + export default buildConfigWithDefaults({ admin: { - user: 'users', autoLogin: false, + user: 'users', }, - globals: [ - { - slug: 'settings', - fields: [ - { - type: 'checkbox', - name: 'test', - label: 'Allow access to test global', - }, - ], - admin: { - components: { - elements: { - SaveButton: TestButton, - }, - }, - }, - }, - { - slug: 'test', - fields: [], - access: { - read: async ({ req: { payload } }) => { - const access = await payload.findGlobal({ slug: 'settings' }) - return Boolean(access.test) - }, - }, - }, - { - slug: readOnlyGlobalSlug, - fields: [ - { - name: 'name', - type: 'text', - }, - ], - access: { - read: () => true, - update: () => false, - }, - }, - { - slug: userRestrictedGlobalSlug, - fields: [ - { - name: 'name', - type: 'text', - }, - ], - access: { - read: () => true, - update: ({ req, data }) => data?.name === req.user?.email, - }, - }, - { - slug: readNotUpdateGlobalSlug, - fields: [ - { - name: 'name', - type: 'text', - }, - ], - access: { - read: () => true, - update: () => false, - }, - }, - ], collections: [ { slug: 'users', - auth: true, access: { // admin: () => true, admin: async ({ req }) => { @@ -141,20 +80,21 @@ export default buildConfigWithDefaults({ }) }, }, + auth: true, fields: [ { name: 'roles', type: 'select', - hasMany: true, - options: ['admin', 'user'], - defaultValue: ['user'], access: { - create: ({ req }) => req.user?.roles?.includes('admin'), + create: ({ req }) => isUser(req.user) && req.user?.roles?.includes('admin'), read: () => false, update: ({ req }) => { - return req.user?.roles?.includes('admin') + return isUser(req.user) && req.user?.roles?.includes('admin') }, }, + defaultValue: ['user'], + hasMany: true, + options: ['admin', 'user'], }, ], }, @@ -179,16 +119,16 @@ export default buildConfigWithDefaults({ }, }, { - type: 'group', name: 'group', + type: 'group', fields: [ { name: 'restrictedGroupText', type: 'text', access: { + create: () => false, read: () => false, update: () => false, - create: () => false, }, }, ], @@ -200,27 +140,27 @@ export default buildConfigWithDefaults({ name: 'restrictedRowText', type: 'text', access: { + create: () => false, read: () => false, update: () => false, - create: () => false, }, }, ], }, { type: 'collapsible', - label: 'Access', fields: [ { name: 'restrictedCollapsibleText', type: 'text', access: { + create: () => false, read: () => false, update: () => false, - create: () => false, }, }, ], + label: 'Access', }, ], }, @@ -234,71 +174,59 @@ export default buildConfigWithDefaults({ { name: 'userRestrictedDocs', type: 'relationship', - relationTo: userRestrictedCollectionSlug, hasMany: true, + relationTo: userRestrictedCollectionSlug, }, { name: 'createNotUpdateDocs', type: 'relationship', - relationTo: createNotUpdateCollectionSlug, hasMany: true, + relationTo: createNotUpdateCollectionSlug, }, ], }, { slug: fullyRestrictedSlug, + access: { + create: () => false, + delete: () => false, + read: () => false, + update: () => false, + }, fields: [ { name: 'name', type: 'text', }, ], - access: { - create: () => false, - read: () => false, - update: () => false, - delete: () => false, - }, }, { slug: readOnlySlug, + access: { + create: () => false, + delete: () => false, + read: () => true, + update: () => false, + }, fields: [ { name: 'name', type: 'text', }, ], - access: { - create: () => false, - read: () => true, - update: () => false, - delete: () => false, - }, }, { slug: userRestrictedCollectionSlug, - admin: { - useAsTitle: 'name', - }, - fields: [ - { - name: 'name', - type: 'text', - }, - ], access: { create: () => true, + delete: () => false, read: () => true, update: ({ req }) => ({ name: { equals: req.user?.email, }, }), - delete: () => false, }, - }, - { - slug: createNotUpdateCollectionSlug, admin: { useAsTitle: 'name', }, @@ -308,27 +236,27 @@ export default buildConfigWithDefaults({ type: 'text', }, ], - access: { - create: () => true, - read: () => true, - update: () => false, - delete: () => false, - }, }, { - slug: restrictedVersionsSlug, - versions: true, + slug: createNotUpdateCollectionSlug, + access: { + create: () => true, + delete: () => false, + read: () => true, + update: () => false, + }, + admin: { + useAsTitle: 'name', + }, fields: [ { name: 'name', type: 'text', }, - { - name: 'hidden', - type: 'checkbox', - hidden: true, - }, ], + }, + { + slug: restrictedVersionsSlug, access: { read: ({ req: { user } }) => { if (user) return true @@ -349,6 +277,18 @@ export default buildConfigWithDefaults({ } }, }, + fields: [ + { + name: 'name', + type: 'text', + }, + { + name: 'hidden', + type: 'checkbox', + hidden: true, + }, + ], + versions: true, }, { slug: siblingDataSlug, @@ -363,8 +303,8 @@ export default buildConfigWithDefaults({ fields: [ { name: 'allowPublicReadability', - label: 'Allow Public Readability', type: 'checkbox', + label: 'Allow Public Readability', }, { name: 'text', @@ -383,9 +323,9 @@ export default buildConfigWithDefaults({ slug: relyOnRequestHeadersSlug, access: { create: UseRequestHeadersAccess, + delete: UseRequestHeadersAccess, read: UseRequestHeadersAccess, update: UseRequestHeadersAccess, - delete: UseRequestHeadersAccess, }, fields: [ { @@ -396,10 +336,6 @@ export default buildConfigWithDefaults({ }, { slug: docLevelAccessSlug, - labels: { - singular: 'Doc Level Access', - plural: 'Doc Level Access', - }, access: { delete: () => ({ and: [ @@ -420,7 +356,6 @@ export default buildConfigWithDefaults({ { name: 'approvedTitle', type: 'text', - localized: true, access: { update: (args) => { if (args?.doc?.lockTitle) { @@ -429,6 +364,7 @@ export default buildConfigWithDefaults({ return true }, }, + localized: true, }, { name: 'lockTitle', @@ -436,6 +372,10 @@ export default buildConfigWithDefaults({ defaultValue: false, }, ], + labels: { + plural: 'Doc Level Access', + singular: 'Doc Level Access', + }, }, { slug: hiddenFieldsSlug, @@ -536,6 +476,74 @@ export default buildConfigWithDefaults({ }, Disabled, ], + globals: [ + { + slug: 'settings', + admin: { + components: { + elements: { + SaveButton: TestButton, + }, + }, + }, + fields: [ + { + name: 'test', + type: 'checkbox', + label: 'Allow access to test global', + }, + ], + }, + { + slug: 'test', + access: { + read: async ({ req: { payload } }) => { + const access = await payload.findGlobal({ slug: 'settings' }) + return Boolean(access.test) + }, + }, + fields: [], + }, + { + slug: readOnlyGlobalSlug, + access: { + read: () => true, + update: () => false, + }, + fields: [ + { + name: 'name', + type: 'text', + }, + ], + }, + { + slug: userRestrictedGlobalSlug, + access: { + read: () => true, + update: ({ data, req }) => data?.name === req.user?.email, + }, + fields: [ + { + name: 'name', + type: 'text', + }, + ], + }, + { + slug: readNotUpdateGlobalSlug, + access: { + read: () => true, + update: () => false, + }, + fields: [ + { + name: 'name', + type: 'text', + }, + ], + }, + ], onInit: async (payload) => { await payload.create({ collection: 'users', @@ -587,12 +595,12 @@ export default buildConfigWithDefaults({ data: { array: [ { - text: firstArrayText, allowPublicReadability: true, + text: firstArrayText, }, { - text: secondArrayText, allowPublicReadability: false, + text: secondArrayText, }, ], }, diff --git a/test/access-control/e2e.spec.ts b/test/access-control/e2e.spec.ts index 49dd6485e..6723042be 100644 --- a/test/access-control/e2e.spec.ts +++ b/test/access-control/e2e.spec.ts @@ -422,9 +422,9 @@ describe('access control', () => { existingDoc = await payload.create({ collection: docLevelAccessSlug, data: { + approvedForRemoval: false, approvedTitle: 'Title', lockTitle: true, - approvedForRemoval: false, }, }) }) @@ -466,12 +466,12 @@ describe('access control', () => { await page.waitForURL(logoutURL) await login({ - page, - serverURL, data: { email: noAdminAccessEmail, password: 'test', }, + page, + serverURL, }) await expect(page.locator('.next-error-h1')).toBeVisible() @@ -481,12 +481,12 @@ describe('access control', () => { // Log back in for the next test await login({ - page, - serverURL, data: { email: devUser.email, password: devUser.password, }, + page, + serverURL, }) }) @@ -500,9 +500,9 @@ describe('access control', () => { await page.goto(logoutURL) await page.waitForURL(logoutURL) - const nonAdminUser: NonAdminUser & { + const nonAdminUser: { token?: string - } = await payload.login({ + } & NonAdminUser = await payload.login({ collection: nonAdminUserSlug, data: { email: nonAdminUserEmail, @@ -513,8 +513,8 @@ describe('access control', () => { await context.addCookies([ { name: 'payload-token', - value: nonAdminUser.token, url: serverURL, + value: nonAdminUser.token, }, ]) @@ -554,10 +554,9 @@ describe('access control', () => { }) }) -// eslint-disable-next-line @typescript-eslint/require-await -async function createDoc(data: any): Promise> { +async function createDoc(data: any): Promise & TypeWithID> { return payload.create({ collection: slug, data, - }) as any as Promise> + }) as any as Promise & TypeWithID> } diff --git a/test/access-control/eslint.config.js b/test/access-control/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/access-control/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/access-control/int.spec.ts b/test/access-control/int.spec.ts index b3e5f0034..057c6adc8 100644 --- a/test/access-control/int.spec.ts +++ b/test/access-control/int.spec.ts @@ -1,8 +1,14 @@ -import type { Payload, PayloadRequest } from 'payload' +import type { + CollectionSlug, + DataFromCollectionSlug, + Payload, + PayloadRequest, + RequiredDataFromCollectionSlug, +} from 'payload' import { Forbidden } from 'payload' -import type { Post, RelyOnRequestHeader, Restricted } from './payload-types.js' +import type { FullyRestricted, Post } from './payload-types.js' import { initPayloadInt } from '../helpers/initPayloadInt.js' import configPromise, { requestHeaders } from './config.js' @@ -23,7 +29,7 @@ let payload: Payload describe('Access Control', () => { let post1: Post - let restricted: Restricted + let restricted: FullyRestricted beforeAll(async () => { ;({ payload } = await initPayloadInt(configPromise)) @@ -32,7 +38,7 @@ describe('Access Control', () => { beforeEach(async () => { post1 = await payload.create({ collection: slug, - data: { name: 'name' }, + data: {}, }) restricted = await payload.create({ @@ -65,21 +71,21 @@ describe('Access Control', () => { }) await payload.update({ - collection: hiddenFieldsSlug, id: doc.id, + collection: hiddenFieldsSlug, data: { title: 'Doc Title', }, }) const updatedDoc = await payload.findByID({ - collection: hiddenFieldsSlug, id: doc.id, + collection: hiddenFieldsSlug, showHiddenFields: true, }) - expect(updatedDoc.partiallyHiddenGroup.value).toEqual('private_value') - expect(updatedDoc.partiallyHiddenArray[0].value).toEqual('private_value') + expect(updatedDoc.partiallyHiddenGroup.value).toStrictEqual('private_value') + expect(updatedDoc.partiallyHiddenArray[0].value).toStrictEqual('private_value') }) it('should not affect hidden fields when patching data - update many', async () => { @@ -101,22 +107,22 @@ describe('Access Control', () => { await payload.update({ collection: hiddenFieldsSlug, - where: { - id: { equals: docsMany.id }, - }, data: { title: 'Doc Title', }, + where: { + id: { equals: docsMany.id }, + }, }) const updatedMany = await payload.findByID({ - collection: hiddenFieldsSlug, id: docsMany.id, + collection: hiddenFieldsSlug, showHiddenFields: true, }) - expect(updatedMany.partiallyHiddenGroup.value).toEqual('private_value') - expect(updatedMany.partiallyHiddenArray[0].value).toEqual('private_value') + expect(updatedMany.partiallyHiddenGroup.value).toStrictEqual('private_value') + expect(updatedMany.partiallyHiddenArray[0].value).toStrictEqual('private_value') }) it('should be able to restrict access based upon siblingData', async () => { @@ -125,12 +131,12 @@ describe('Access Control', () => { data: { array: [ { - text: firstArrayText, allowPublicReadability: true, + text: firstArrayText, }, { - text: secondArrayText, allowPublicReadability: false, + text: secondArrayText, }, ], }, @@ -159,27 +165,27 @@ describe('Access Control', () => { describe('Collections', () => { describe('restricted collection', () => { it('field without read access should not show', async () => { - const { id } = await createDoc({ restrictedField: 'restricted' }) + const { id } = await createDoc({ restrictedField: 'restricted' }) - const retrievedDoc = await payload.findByID({ collection: slug, id, overrideAccess: false }) + const retrievedDoc = await payload.findByID({ id, collection: slug, overrideAccess: false }) expect(retrievedDoc.restrictedField).toBeUndefined() }) it('field without read access should not show when overrideAccess: true', async () => { - const { id, restrictedField } = await createDoc({ restrictedField: 'restricted' }) + const { id, restrictedField } = await createDoc({ restrictedField: 'restricted' }) - const retrievedDoc = await payload.findByID({ collection: slug, id, overrideAccess: true }) + const retrievedDoc = await payload.findByID({ id, collection: slug, overrideAccess: true }) - expect(retrievedDoc.restrictedField).toEqual(restrictedField) + expect(retrievedDoc.restrictedField).toStrictEqual(restrictedField) }) it('field without read access should not show when overrideAccess default', async () => { - const { id, restrictedField } = await createDoc({ restrictedField: 'restricted' }) + const { id, restrictedField } = await createDoc({ restrictedField: 'restricted' }) - const retrievedDoc = await payload.findByID({ collection: slug, id }) + const retrievedDoc = await payload.findByID({ id, collection: slug }) - expect(retrievedDoc.restrictedField).toEqual(restrictedField) + expect(retrievedDoc.restrictedField).toStrictEqual(restrictedField) }) }) describe('non-enumerated request properties passed to access control', () => { @@ -190,25 +196,25 @@ describe('Access Control', () => { const name = 'name' const overrideAccess = false - const { id } = await createDoc({ name }, relyOnRequestHeadersSlug, { - req, + const { id } = await createDoc({ name }, relyOnRequestHeadersSlug, { overrideAccess, + req, }) const docById = await payload.findByID({ - collection: relyOnRequestHeadersSlug, id, - req, + collection: relyOnRequestHeadersSlug, overrideAccess, + req, }) const { docs: docsByName } = await payload.find({ collection: relyOnRequestHeadersSlug, + overrideAccess, + req, where: { name: { equals: name, }, }, - req, - overrideAccess, }) expect(docById).not.toBeUndefined() @@ -220,23 +226,25 @@ describe('Access Control', () => { const overrideAccess = false await expect(() => - createDoc({ name }, relyOnRequestHeadersSlug, { overrideAccess }), + createDoc({ name }, relyOnRequestHeadersSlug, { + overrideAccess, + }), ).rejects.toThrow(Forbidden) - const { id } = await createDoc({ name }, relyOnRequestHeadersSlug) + const { id } = await createDoc({ name }, relyOnRequestHeadersSlug) await expect(() => - payload.findByID({ collection: relyOnRequestHeadersSlug, id, overrideAccess }), + payload.findByID({ id, collection: relyOnRequestHeadersSlug, overrideAccess }), ).rejects.toThrow(Forbidden) await expect(() => payload.find({ collection: relyOnRequestHeadersSlug, + overrideAccess, where: { name: { equals: name, }, }, - overrideAccess, }), ).rejects.toThrow(Forbidden) }) @@ -248,8 +256,8 @@ describe('Access Control', () => { it('should allow overrideAccess: false', async () => { const req = async () => await payload.update({ - collection: slug, id: post1.id, + collection: slug, data: { restrictedField: restricted.id }, overrideAccess: false, // this should respect access control }) @@ -259,8 +267,8 @@ describe('Access Control', () => { it('should allow overrideAccess: true', async () => { const doc = await payload.update({ - collection: slug, id: post1.id, + collection: slug, data: { restrictedField: restricted.id }, overrideAccess: true, // this should override access control }) @@ -270,8 +278,8 @@ describe('Access Control', () => { it('should allow overrideAccess by default', async () => { const doc = await payload.update({ - collection: slug, id: post1.id, + collection: slug, data: { restrictedField: restricted.id }, }) @@ -282,11 +290,11 @@ describe('Access Control', () => { const req = async () => await payload.update({ collection: slug, + data: { restrictedField: restricted.id }, + overrideAccess: false, // this should respect access control where: { id: { equals: post1.id }, }, - data: { restrictedField: restricted.id }, - overrideAccess: false, // this should respect access control }) await expect(req).rejects.toThrow(Forbidden) @@ -295,11 +303,11 @@ describe('Access Control', () => { it('should allow overrideAccess: true - update many', async () => { const doc = await payload.update({ collection: slug, + data: { restrictedField: restricted.id }, + overrideAccess: true, // this should override access control where: { id: { equals: post1.id }, }, - data: { restrictedField: restricted.id }, - overrideAccess: true, // this should override access control }) expect(doc.docs[0]).toMatchObject({ id: post1.id }) @@ -308,10 +316,10 @@ describe('Access Control', () => { it('should allow overrideAccess by default - update many', async () => { const doc = await payload.update({ collection: slug, + data: { restrictedField: restricted.id }, where: { id: { equals: post1.id }, }, - data: { restrictedField: restricted.id }, }) expect(doc.docs[0]).toMatchObject({ id: post1.id }) @@ -324,8 +332,8 @@ describe('Access Control', () => { it('should allow overrideAccess: false', async () => { const req = async () => await payload.update({ - collection: fullyRestrictedSlug, id: restricted.id, + collection: fullyRestrictedSlug, data: { name: updatedName }, overrideAccess: false, // this should respect access control }) @@ -335,8 +343,8 @@ describe('Access Control', () => { it('should allow overrideAccess: true', async () => { const doc = await payload.update({ - collection: fullyRestrictedSlug, id: restricted.id, + collection: fullyRestrictedSlug, data: { name: updatedName }, overrideAccess: true, // this should override access control }) @@ -346,8 +354,8 @@ describe('Access Control', () => { it('should allow overrideAccess by default', async () => { const doc = await payload.update({ - collection: fullyRestrictedSlug, id: restricted.id, + collection: fullyRestrictedSlug, data: { name: updatedName }, }) @@ -358,11 +366,11 @@ describe('Access Control', () => { const req = async () => await payload.update({ collection: fullyRestrictedSlug, + data: { name: updatedName }, + overrideAccess: false, // this should respect access control where: { id: { equals: restricted.id }, }, - data: { name: updatedName }, - overrideAccess: false, // this should respect access control }) await expect(req).rejects.toThrow(Forbidden) @@ -371,11 +379,11 @@ describe('Access Control', () => { it('should allow overrideAccess: true - update many', async () => { const doc = await payload.update({ collection: fullyRestrictedSlug, + data: { name: updatedName }, + overrideAccess: true, // this should override access control where: { id: { equals: restricted.id }, }, - data: { name: updatedName }, - overrideAccess: true, // this should override access control }) expect(doc.docs[0]).toMatchObject({ id: restricted.id, name: updatedName }) @@ -384,10 +392,10 @@ describe('Access Control', () => { it('should allow overrideAccess by default - update many', async () => { const doc = await payload.update({ collection: fullyRestrictedSlug, + data: { name: updatedName }, where: { id: { equals: restricted.id }, }, - data: { name: updatedName }, }) expect(doc.docs[0]).toMatchObject({ id: restricted.id, name: updatedName }) @@ -407,8 +415,8 @@ describe('Access Control', () => { await payload.create({ collection: hiddenAccessSlug, data: { - title: 'hello', hidden: true, + title: 'hello', }, }) @@ -431,8 +439,8 @@ describe('Access Control', () => { await payload.create({ collection: hiddenAccessCountSlug, data: { - title: 'hello', hidden: true, + title: 'hello', }, }) @@ -461,11 +469,11 @@ describe('Access Control', () => { }, }) const { docs } = await payload.findVersions({ + collection: restrictedVersionsSlug, + overrideAccess: false, where: { 'version.name': { equals: 'match' }, }, - collection: restrictedVersionsSlug, - overrideAccess: false, }) expect(docs).toHaveLength(1) @@ -473,14 +481,16 @@ describe('Access Control', () => { }) }) -async function createDoc( - data: Partial, - overrideSlug = slug, +async function createDoc( + data: RequiredDataFromCollectionSlug, + overrideSlug?: TSlug, options?: Partial[0]>, -) { +): Promise> { + // @ts-expect-error return await payload.create({ ...options, - collection: overrideSlug, + collection: overrideSlug ?? slug, + // @ts-expect-error data: data ?? {}, }) } diff --git a/test/admin/.eslintrc.cjs b/test/admin/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/admin/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/admin/eslint.config.js b/test/admin/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/admin/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/array-update/.eslintrc.cjs b/test/array-update/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/array-update/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/array-update/eslint.config.js b/test/array-update/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/array-update/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/auth/.eslintrc.cjs b/test/auth/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/auth/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/auth/eslint.config.js b/test/auth/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/auth/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/buildConfigWithDefaults.ts b/test/buildConfigWithDefaults.ts index ac69819d6..bd0e36f4f 100644 --- a/test/buildConfigWithDefaults.ts +++ b/test/buildConfigWithDefaults.ts @@ -1,4 +1,4 @@ -import type { SanitizedConfig } from 'payload' +import type { SanitizedConfig, Config } from 'payload' import { mongooseAdapter } from '@payloadcms/db-mongodb' import { postgresAdapter } from '@payloadcms/db-postgres' @@ -26,7 +26,7 @@ import { lexicalEditor, } from '@payloadcms/richtext-lexical' // import { slateEditor } from '@payloadcms/richtext-slate' -import { type Config, buildConfig } from 'payload' +import { buildConfig } from 'payload' import { de } from 'payload/i18n/de' import { en } from 'payload/i18n/en' import { es } from 'payload/i18n/es' diff --git a/test/collections-graphql/.eslintrc.cjs b/test/collections-graphql/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/collections-graphql/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/collections-graphql/eslint.config.js b/test/collections-graphql/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/collections-graphql/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/collections-rest/.eslintrc.cjs b/test/collections-rest/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/collections-rest/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/collections-rest/eslint.config.js b/test/collections-rest/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/collections-rest/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/config/.eslintrc.cjs b/test/config/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/config/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/config/eslint.config.js b/test/config/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/config/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/create-payload-app/.eslintrc.cjs b/test/create-payload-app/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/create-payload-app/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/create-payload-app/eslint.config.js b/test/create-payload-app/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/create-payload-app/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/custom-graphql/.eslintrc.cjs b/test/custom-graphql/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/custom-graphql/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/custom-graphql/eslint.config.js b/test/custom-graphql/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/custom-graphql/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/database/.eslintrc.cjs b/test/database/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/database/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/database/eslint.config.js b/test/database/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/database/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/dataloader/.eslintrc.cjs b/test/dataloader/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/dataloader/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/dataloader/eslint.config.js b/test/dataloader/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/dataloader/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/email-nodemailer/.eslintrc.cjs b/test/email-nodemailer/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/email-nodemailer/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/email-nodemailer/eslint.config.js b/test/email-nodemailer/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/email-nodemailer/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/email-resend/.eslintrc.cjs b/test/email-resend/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/email-resend/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/email-resend/eslint.config.js b/test/email-resend/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/email-resend/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/email/.eslintrc.cjs b/test/email/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/email/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/email/eslint.config.js b/test/email/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/email/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/endpoints/.eslintrc.cjs b/test/endpoints/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/endpoints/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/endpoints/eslint.config.js b/test/endpoints/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/endpoints/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/eslint.config.js b/test/eslint.config.js new file mode 100644 index 000000000..a1a0d9f4f --- /dev/null +++ b/test/eslint.config.js @@ -0,0 +1,80 @@ +import { rootEslintConfig, rootParserOptions } from '../eslint.config.js' +import payloadPlugin from '@payloadcms/eslint-plugin' +import playwright from 'eslint-plugin-playwright' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + plugins: { + payload: payloadPlugin, + }, + rules: { + 'payload/no-relative-monorepo-imports': 'error', + }, + }, + { + files: ['**/*.ts'], + rules: { + 'payload/no-jsx-import-statements': 'warn', + 'payload/no-relative-monorepo-imports': 'error', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-use-before-define': 'off', + // turn the @typescript-eslint/unbound-method rule off *only* for test files. See https://typescript-eslint.io/rules/unbound-method/#when-not-to-use-it + '@typescript-eslint/unbound-method': 'off', + 'no-console': 'off', + 'perfectionist/sort-objects': 'off', + }, + }, + { + files: ['**/*.int.spec.ts', '**/int.spec.ts'], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + 'jest/prefer-strict-equal': 'off', + }, + }, + { + ...playwright.configs['flat/recommended'], + files: ['**/*.e2e.spec.ts', '**/e2e.spec.ts', 'helpers.ts'], + }, + { + files: ['**/*.e2e.spec.ts', '**/e2e.spec.ts', 'helpers.ts'], + rules: { + 'payload/no-relative-monorepo-imports': 'error', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-use-before-define': 'off', + 'jest/consistent-test-it': 'off', + 'jest/expect-expect': 'off', + 'jest/no-test-callback': 'off', + 'jest/prefer-strict-equal': 'off', + 'jest/require-top-level-describe': 'off', + 'jest-dom/prefer-to-have-attribute': 'off', + 'playwright/prefer-web-first-assertions': 'error', + 'payload/no-flaky-assertions': 'warn', + 'payload/no-wait-function': 'warn', + // Enable the no-non-retryable-assertions rule ONLY for hunting for flakes + // 'payload/no-non-retryable-assertions': 'error', + }, + }, + { + files: ['*.e2e.ts'], + rules: { + 'payload/no-relative-monorepo-imports': 'error', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-use-before-define': 'off', + 'jest/expect-expect': 'off', + }, + }, +] + +export default index diff --git a/test/field-error-states/.eslintrc.cjs b/test/field-error-states/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/field-error-states/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/field-error-states/eslint.config.js b/test/field-error-states/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/field-error-states/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/field-perf/.eslintrc.cjs b/test/field-perf/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/field-perf/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/field-perf/eslint.config.js b/test/field-perf/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/field-perf/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/fields-relationship/.eslintrc.cjs b/test/fields-relationship/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/fields-relationship/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/fields-relationship/eslint.config.js b/test/fields-relationship/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/fields-relationship/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/fields/.eslintrc.cjs b/test/fields/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/fields/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/fields/eslint.config.js b/test/fields/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/fields/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/globals/.eslintrc.cjs b/test/globals/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/globals/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/globals/eslint.config.js b/test/globals/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/globals/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/graphql-schema-gen/.eslintrc.cjs b/test/graphql-schema-gen/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/graphql-schema-gen/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/graphql-schema-gen/eslint.config.js b/test/graphql-schema-gen/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/graphql-schema-gen/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/hooks/.eslintrc.cjs b/test/hooks/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/hooks/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/hooks/eslint.config.js b/test/hooks/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/hooks/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/i18n/eslint.config.js b/test/i18n/eslint.config.js new file mode 100644 index 000000000..e62b92c80 --- /dev/null +++ b/test/i18n/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/live-preview/.eslintrc.cjs b/test/live-preview/.eslintrc.cjs deleted file mode 100644 index 2559bae8d..000000000 --- a/test/live-preview/.eslintrc.cjs +++ /dev/null @@ -1,11 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, - rules: { - 'no-restricted-exports': ['error', { restrictDefaultExports: { direct: false } }], - }, -} diff --git a/test/live-preview/eslint.config.js b/test/live-preview/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/live-preview/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/localization-rtl/.eslintrc.cjs b/test/localization-rtl/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/localization-rtl/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/localization-rtl/eslint.config.js b/test/localization-rtl/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/localization-rtl/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/localization/.eslintrc.cjs b/test/localization/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/localization/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/localization/eslint.config.js b/test/localization/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/localization/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/migrations-cli/.eslintrc.cjs b/test/migrations-cli/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/migrations-cli/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/migrations-cli/eslint.config.js b/test/migrations-cli/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/migrations-cli/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/nested-fields/.eslintrc.cjs b/test/nested-fields/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/nested-fields/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/nested-fields/eslint.config.js b/test/nested-fields/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/nested-fields/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/package.json b/test/package.json index 0ac5a856e..6544d84c8 100644 --- a/test/package.json +++ b/test/package.json @@ -20,6 +20,7 @@ "@payloadcms/email-nodemailer": "workspace:*", "@payloadcms/email-resend": "workspace:*", "@payloadcms/eslint-config": "workspace:*", + "@payloadcms/eslint-plugin": "workspace:*", "@payloadcms/graphql": "workspace:*", "@payloadcms/live-preview": "workspace:*", "@payloadcms/live-preview-react": "workspace:*", @@ -50,8 +51,7 @@ "comment-json": "^4.2.3", "create-payload-app": "workspace:*", "dotenv": "16.4.5", - "eslint-plugin-payload": "workspace:*", - "eslint-plugin-playwright": "1.5.3", + "eslint-plugin-playwright": "1.6.2", "execa": "5.1.1", "http-status": "1.6.2", "jwt-decode": "4.0.0", diff --git a/test/plugin-cloud-storage/.eslintrc.cjs b/test/plugin-cloud-storage/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-cloud-storage/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-cloud-storage/eslint.config.js b/test/plugin-cloud-storage/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-cloud-storage/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-cloud/.eslintrc.cjs b/test/plugin-cloud/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-cloud/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-cloud/eslint.config.js b/test/plugin-cloud/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-cloud/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-form-builder/.eslintrc.cjs b/test/plugin-form-builder/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-form-builder/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-form-builder/eslint.config.js b/test/plugin-form-builder/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-form-builder/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-nested-docs/.eslintrc.cjs b/test/plugin-nested-docs/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-nested-docs/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-nested-docs/eslint.config.js b/test/plugin-nested-docs/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-nested-docs/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-redirects/.eslintrc.cjs b/test/plugin-redirects/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-redirects/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-redirects/eslint.config.js b/test/plugin-redirects/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-redirects/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-relationship-object-ids/eslint.config.js b/test/plugin-relationship-object-ids/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-relationship-object-ids/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-relationship-object-ids/int.spec.ts b/test/plugin-relationship-object-ids/int.spec.ts index 7288c45fc..d0dd49e8e 100644 --- a/test/plugin-relationship-object-ids/int.spec.ts +++ b/test/plugin-relationship-object-ids/int.spec.ts @@ -1,12 +1,13 @@ -/* eslint-disable jest/no-if */ import type { Payload } from 'payload' +import type { Post, Relation } from './payload-types.js' + import { initPayloadInt } from '../helpers/initPayloadInt.js' import configPromise from './config.js' describe('Relationship Object IDs Plugin', () => { - let relations: any - let posts: any + let relations: Relation[] + let posts: Post[] let payload: Payload beforeAll(async () => { @@ -14,6 +15,7 @@ describe('Relationship Object IDs Plugin', () => { }) it('seeds data accordingly', async () => { + // eslint-disable-next-line jest/no-conditional-in-test if (payload.db.name === 'mongoose') { const relationsQuery = await payload.find({ collection: 'relations', @@ -29,13 +31,13 @@ describe('Relationship Object IDs Plugin', () => { posts = postsQuery.docs - expect(relationsQuery.totalDocs).toEqual(2) - expect(postsQuery.totalDocs).toEqual(2) + expect(relationsQuery.totalDocs).toStrictEqual(2) + expect(postsQuery.totalDocs).toStrictEqual(2) } }) it('stores relations as object ids', async () => { - // eslint-disable-next-line jest/no-if + // eslint-disable-next-line jest/no-conditional-in-test if (payload.db.name === 'mongoose') { const docs = await payload.db.collections.relations.find() expect(typeof docs[0].hasOne).toBe('object') @@ -47,6 +49,7 @@ describe('Relationship Object IDs Plugin', () => { }) it('can query by relationship id', async () => { + // eslint-disable-next-line jest/no-conditional-in-test if (payload.db.name === 'mongoose') { const { totalDocs } = await payload.find({ collection: 'relations', @@ -62,13 +65,15 @@ describe('Relationship Object IDs Plugin', () => { }) it('populates relations', () => { + // eslint-disable-next-line jest/no-conditional-in-test if (payload.db.name === 'mongoose') { const populatedPostTitle = - // eslint-disable-next-line jest/no-if + // eslint-disable-next-line jest/no-conditional-in-test typeof relations[0].hasOne === 'object' ? relations[0].hasOne.title : undefined expect(populatedPostTitle).toBeDefined() const populatedUploadFilename = + // eslint-disable-next-line jest/no-conditional-in-test typeof relations[0].upload === 'object' ? relations[0].upload.filename : undefined expect(populatedUploadFilename).toBeDefined() @@ -76,6 +81,7 @@ describe('Relationship Object IDs Plugin', () => { }) it('can query by nested property', async () => { + // eslint-disable-next-line jest/no-conditional-in-test if (payload.db.name === 'mongoose') { const { totalDocs } = await payload.find({ collection: 'relations', @@ -91,6 +97,7 @@ describe('Relationship Object IDs Plugin', () => { }) it('can query using the "in" operator', async () => { + // eslint-disable-next-line jest/no-conditional-in-test if (payload.db.name === 'mongoose') { const { totalDocs } = await payload.find({ collection: 'relations', diff --git a/test/plugin-relationship-object-ids/tsconfig.eslint.json b/test/plugin-relationship-object-ids/tsconfig.eslint.json new file mode 100644 index 000000000..b34cc7afb --- /dev/null +++ b/test/plugin-relationship-object-ids/tsconfig.eslint.json @@ -0,0 +1,13 @@ +{ + // extend your base config to share compilerOptions, etc + //"extends": "./tsconfig.json", + "compilerOptions": { + // ensure that nobody can accidentally use this config for a build + "noEmit": true + }, + "include": [ + // whatever paths you intend to lint + "./**/*.ts", + "./**/*.tsx" + ] +} diff --git a/test/plugin-relationship-object-ids/tsconfig.json b/test/plugin-relationship-object-ids/tsconfig.json new file mode 100644 index 000000000..3c43903cf --- /dev/null +++ b/test/plugin-relationship-object-ids/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.json" +} diff --git a/test/plugin-search/.eslintrc.cjs b/test/plugin-search/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-search/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-search/eslint.config.js b/test/plugin-search/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-search/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-sentry/.eslintrc.cjs b/test/plugin-sentry/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-sentry/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-sentry/eslint.config.js b/test/plugin-sentry/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-sentry/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-seo/.eslintrc.cjs b/test/plugin-seo/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-seo/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-seo/eslint.config.js b/test/plugin-seo/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-seo/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugin-stripe/.eslintrc.cjs b/test/plugin-stripe/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugin-stripe/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugin-stripe/eslint.config.js b/test/plugin-stripe/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugin-stripe/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/plugins/.eslintrc.cjs b/test/plugins/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/plugins/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/plugins/eslint.config.js b/test/plugins/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/plugins/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/relationships/.eslintrc.cjs b/test/relationships/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/relationships/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/relationships/eslint.config.js b/test/relationships/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/relationships/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/storage-azure/.eslintrc.cjs b/test/storage-azure/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/storage-azure/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/storage-azure/eslint.config.js b/test/storage-azure/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/storage-azure/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/storage-gcs/.eslintrc.cjs b/test/storage-gcs/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/storage-gcs/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/storage-gcs/eslint.config.js b/test/storage-gcs/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/storage-gcs/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/storage-s3/.eslintrc.cjs b/test/storage-s3/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/storage-s3/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/storage-s3/eslint.config.js b/test/storage-s3/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/storage-s3/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/storage-uploadthing/.eslintrc.cjs b/test/storage-uploadthing/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/storage-uploadthing/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/storage-uploadthing/eslint.config.js b/test/storage-uploadthing/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/storage-uploadthing/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/storage-vercel-blob/.eslintrc.cjs b/test/storage-vercel-blob/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/storage-vercel-blob/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/storage-vercel-blob/eslint.config.js b/test/storage-vercel-blob/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/storage-vercel-blob/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/tsconfig.json b/test/tsconfig.json index 8924ce7cb..99cbe582c 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -43,7 +43,7 @@ "@payload-config": ["./_community/config.ts"] } }, - "exclude": ["dist", "build", "node_modules", ".eslintrc.js", "dist/**/*.js", "**/dist/**/*.js"], + "exclude": ["dist", "build", "node_modules", "eslint.config.js", "dist/**/*.js", "**/dist/**/*.js"], "include": ["./**/*.ts", ".next/types/**/*.ts", "setup.js"], "references": [] } diff --git a/test/uploads/.eslintrc.cjs b/test/uploads/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/uploads/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/uploads/eslint.config.js b/test/uploads/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/uploads/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index diff --git a/test/versions/.eslintrc.cjs b/test/versions/.eslintrc.cjs deleted file mode 100644 index 39a96642f..000000000 --- a/test/versions/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - ignorePatterns: ['payload-types.ts'], - parserOptions: { - project: ['./tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, -} diff --git a/test/versions/eslint.config.js b/test/versions/eslint.config.js new file mode 100644 index 000000000..f82abe5dc --- /dev/null +++ b/test/versions/eslint.config.js @@ -0,0 +1,20 @@ +import { rootEslintConfig, rootParserOptions } from '../../eslint.config.js' + +/** @typedef {import('eslint').Linter.FlatConfig} */ +let FlatConfig + +/** @type {FlatConfig[]} */ +export const index = [ + ...rootEslintConfig, + { + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigDirName: import.meta.dirname, + ...rootParserOptions, + }, + }, + }, +] + +export default index