chore: run lint and prettier on entire codebase
This commit is contained in:
@@ -2,11 +2,11 @@ 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 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 globals from 'globals'
|
||||
import importX from 'eslint-plugin-import-x'
|
||||
import typescriptParser from '@typescript-eslint/parser'
|
||||
import { deepMerge } from './deepMerge.js'
|
||||
@@ -102,9 +102,11 @@ const typescriptRules = {
|
||||
let FlatConfig
|
||||
|
||||
/** @type {FlatConfig} */
|
||||
const baseExtends = deepMerge(js.configs.recommended, perfectionistNatural , regexpPluginConfigs['flat/recommended'])
|
||||
|
||||
|
||||
const baseExtends = deepMerge(
|
||||
js.configs.recommended,
|
||||
perfectionistNatural,
|
||||
regexpPluginConfigs['flat/recommended'],
|
||||
)
|
||||
|
||||
/** @type {FlatConfig[]} */
|
||||
export const rootEslintConfig = [
|
||||
@@ -144,7 +146,7 @@ export const rootEslintConfig = [
|
||||
...baseRules,
|
||||
...typescriptRules,
|
||||
},
|
||||
}
|
||||
},
|
||||
),
|
||||
files: ['**/*.ts'],
|
||||
},
|
||||
@@ -166,31 +168,28 @@ export const rootEslintConfig = [
|
||||
...typescriptRules,
|
||||
...reactA11yRules,
|
||||
},
|
||||
}
|
||||
},
|
||||
),
|
||||
files: ['**/*.tsx'],
|
||||
},
|
||||
{
|
||||
name: 'Unit Tests',
|
||||
...deepMerge(
|
||||
jestExtends,
|
||||
{
|
||||
plugins: {
|
||||
payload: payloadPlugin
|
||||
},
|
||||
rules: {
|
||||
...baseRules,
|
||||
...typescriptRules,
|
||||
'@typescript-eslint/unbound-method': 'off',
|
||||
},
|
||||
}
|
||||
),
|
||||
...deepMerge(jestExtends, {
|
||||
plugins: {
|
||||
payload: payloadPlugin,
|
||||
},
|
||||
rules: {
|
||||
...baseRules,
|
||||
...typescriptRules,
|
||||
'@typescript-eslint/unbound-method': 'off',
|
||||
},
|
||||
}),
|
||||
files: ['**/*.spec.ts'],
|
||||
},
|
||||
{
|
||||
name: 'Payload Config',
|
||||
plugins: {
|
||||
payload: payloadPlugin
|
||||
payload: payloadPlugin,
|
||||
},
|
||||
rules: {
|
||||
...baseRules,
|
||||
|
||||
Reference in New Issue
Block a user