Mostly perfectionist import/key sorting and curly braces from --fix, plus: - spread instead of .apply() in the Meta Pixel stub - non-capturing group in the locale-code pattern - React 19 use(Context) / <Context value> in TurnstileProvider - email regex rewritten without super-linear backtracking (covered by a test) - console.warn/error allowed (deliberate server diagnostics) - test/tsconfig.json so the project service and tsc see test files Co-Authored-By: Claude Opus 5.5 <[email protected]>
56 lines
1.3 KiB
JavaScript
56 lines
1.3 KiB
JavaScript
// @ts-check
|
|
|
|
import payloadEsLintConfig from '@payloadcms/eslint-config'
|
|
|
|
export const defaultESLintIgnores = [
|
|
'**/.temp',
|
|
'**/.*', // ignore all dotfiles
|
|
'**/.git',
|
|
'**/.hg',
|
|
'**/.pnp.*',
|
|
'**/.svn',
|
|
'**/playwright.config.ts',
|
|
'**/vitest.config.js',
|
|
'**/tsconfig.tsbuildinfo',
|
|
'**/README.md',
|
|
'**/eslint.config.js',
|
|
'**/payload-types.ts',
|
|
'**/dist/',
|
|
'**/.yarn/',
|
|
'**/build/',
|
|
'**/node_modules/',
|
|
'**/temp/',
|
|
]
|
|
|
|
export default [
|
|
...payloadEsLintConfig,
|
|
{
|
|
rules: {
|
|
// console.warn/error are the plugin's deliberate server-side diagnostics.
|
|
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
'no-restricted-exports': 'off',
|
|
},
|
|
},
|
|
{
|
|
// Mocks stand in for async APIs without awaiting anything themselves.
|
|
files: ['test/**/*.ts'],
|
|
rules: {
|
|
'@typescript-eslint/require-await': 'off',
|
|
},
|
|
},
|
|
{
|
|
languageOptions: {
|
|
parserOptions: {
|
|
sourceType: 'module',
|
|
ecmaVersion: 'latest',
|
|
projectService: {
|
|
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 40,
|
|
allowDefaultProject: ['scripts/*.ts', '*.js', '*.mjs', '*.spec.ts', '*.d.ts'],
|
|
},
|
|
// projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
},
|
|
]
|