chore: move to eslint v9 (#7041)
- Upgrades eslint from v8 to v9 - Upgrades all other eslint packages. We will have to do a new full-project lint, as new rules have been added - Upgrades husky from v8 to v9 - Upgrades lint-staged from v14 to v15 - Moves the old .eslintrc.cjs file format to the new eslint.config.js flat file format. Previously, we were very specific regarding which rules are applied to which files. Now that `extends` is no longer a thing, I have to use deepMerge & imports instead. This is rather uncommon and is not a documented pattern - e.g. typescript-eslint docs want us to add the default typescript-eslint rules to the top-level & then disable it in files using the disable-typechecked config. However, I hate this opt-out approach. The way I did it here adds a lot of clarity as to which rules are applied to which files, and is pretty easy to read. Much less black magic ## .eslintignore These files are no longer supported (see https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files). I moved the entries to the ignores property in the eslint config. => one less file in each package folder!
This commit is contained in:
@@ -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
|
||||
@@ -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,
|
||||
}
|
||||
@@ -1,4 +1 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
pnpm run lint-staged --quiet
|
||||
|
||||
86
eslint.config.js
Normal file
86
eslint.config.js
Normal file
@@ -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',
|
||||
},
|
||||
},
|
||||
]
|
||||
12
package.json
12
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",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/create-payload-app/eslint.config.js
Normal file
20
packages/create-payload-app/eslint.config.js
Normal file
@@ -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
|
||||
@@ -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"]
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/db-mongodb/eslint.config.js
Normal file
20
packages/db-mongodb/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/db-postgres/eslint.config.js
Normal file
20
packages/db-postgres/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/email-nodemailer/eslint.config.js
Normal file
20
packages/email-nodemailer/eslint.config.js
Normal file
@@ -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
|
||||
@@ -1,10 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/email-resend/eslint.config.js
Normal file
20
packages/email-resend/eslint.config.js
Normal file
@@ -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
|
||||
@@ -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: {},
|
||||
}
|
||||
@@ -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: {},
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ['./eslint-config/index.js'],
|
||||
}
|
||||
@@ -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 <dev@payloadcms.com> (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"
|
||||
}
|
||||
}
|
||||
20
packages/eslint-config/configs/jest/index.mjs
Normal file
20
packages/eslint-config/configs/jest/index.mjs
Normal file
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
44
packages/eslint-config/configs/react/index.mjs
Normal file
44
packages/eslint-config/configs/react/index.mjs
Normal file
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
58
packages/eslint-config/deepMerge.js
Normal file
58
packages/eslint-config/deepMerge.js
Normal file
@@ -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), {})
|
||||
}
|
||||
@@ -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
|
||||
40
packages/eslint-config/package.json
Normal file
40
packages/eslint-config/package.json
Normal file
@@ -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 <dev@payloadcms.com> (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"
|
||||
}
|
||||
}
|
||||
@@ -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.',
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 <dev@payloadcms.com> (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"
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
37
packages/eslint-plugin/index.mjs
Normal file
37
packages/eslint-plugin/index.mjs
Normal file
@@ -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
|
||||
39
packages/eslint-plugin/package.json
Normal file
39
packages/eslint-plugin/package.json
Normal file
@@ -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 <dev@payloadcms.com> (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"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/graphql/eslint.config.js
Normal file
20
packages/graphql/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/live-preview-react/eslint.config.js
Normal file
20
packages/live-preview-react/eslint.config.js
Normal file
@@ -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
|
||||
@@ -14,7 +14,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
20
packages/live-preview-vue/eslint.config.js
Normal file
20
packages/live-preview-vue/eslint.config.js
Normal file
@@ -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
|
||||
@@ -14,7 +14,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/live-preview/eslint.config.js
Normal file
20
packages/live-preview/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
bin
|
||||
@@ -1,12 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
settings: {
|
||||
next: {
|
||||
rootDir: '../../app/',
|
||||
},
|
||||
},
|
||||
}
|
||||
25
packages/next/eslint.config.js
Normal file
25
packages/next/eslint.config.js
Normal file
@@ -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
|
||||
@@ -1,12 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
templates.ts
|
||||
scripts
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/payload/eslint.config.js
Normal file
20
packages/payload/eslint.config.js
Normal file
@@ -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
|
||||
@@ -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" }]
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-cloud-storage/eslint.config.js
Normal file
20
packages/plugin-cloud-storage/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-cloud/eslint.config.js
Normal file
20
packages/plugin-cloud/eslint.config.js
Normal file
@@ -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
|
||||
@@ -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" }]
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-form-builder/eslint.config.js
Normal file
20
packages/plugin-form-builder/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-nested-docs/eslint.config.js
Normal file
20
packages/plugin-nested-docs/eslint.config.js
Normal file
@@ -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
|
||||
@@ -14,7 +14,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-redirects/eslint.config.js
Normal file
20
packages/plugin-redirects/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
20
packages/plugin-relationship-object-ids/eslint.config.js
Normal file
20
packages/plugin-relationship-object-ids/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.cjs",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-search/eslint.config.js
Normal file
20
packages/plugin-search/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-sentry/eslint.config.js
Normal file
20
packages/plugin-sentry/eslint.config.js
Normal file
@@ -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
|
||||
@@ -14,7 +14,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-seo/eslint.config.js
Normal file
20
packages/plugin-seo/eslint.config.js
Normal file
@@ -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
|
||||
@@ -14,7 +14,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
}
|
||||
20
packages/plugin-stripe/eslint.config.js
Normal file
20
packages/plugin-stripe/eslint.config.js
Normal file
@@ -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
|
||||
@@ -13,7 +13,7 @@
|
||||
"tests",
|
||||
"test",
|
||||
"node_modules",
|
||||
".eslintrc.js",
|
||||
"eslint.config.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.spec.ts",
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.tmp
|
||||
**/.git
|
||||
**/.hg
|
||||
**/.pnp.*
|
||||
**/.svn
|
||||
**/.yarn/**
|
||||
**/build
|
||||
**/dist/**
|
||||
**/node_modules
|
||||
**/temp
|
||||
@@ -1,8 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
extends: ['plugin:@lexical/recommended'],
|
||||
}
|
||||
25
packages/richtext-lexical/eslint.config.js
Normal file
25
packages/richtext-lexical/eslint.config.js
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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<string, React.ReactNode>
|
||||
}
|
||||
} & FormFieldBase
|
||||
formData: BlockFields
|
||||
formSchema: FieldMap
|
||||
nodeKey: string
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user