Skip to content

Commit 86fdad0

Browse files
committed
chore: significantly improve eslint performance, lint and prettier everything
1 parent bc367ab commit 86fdad0

File tree

653 files changed

+50291
-19145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

653 files changed

+50291
-19145
lines changed

CHANGELOG.md

Lines changed: 397 additions & 437 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<a href="https://payloadcms.com"><img width="100%" src="https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/assets/images/github-banner-alt.jpg?raw=true" alt="Payload headless CMS Admin panel built with React" /></a>
22
<br />
33
<br />
4+
45
<p align="left">
56
<a href="https://github.com/payloadcms/payload/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/payloadcms/payload/main.yml?style=flat-square"></a>
67
&nbsp;

eslint.config.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ export const rootParserOptions = {
2828
sourceType: 'module',
2929
ecmaVersion: 'latest',
3030
projectService: {
31-
allowDefaultProject: ['./src/*.ts', './src/*.tsx'],
32-
defaultProject: './tsconfig.json',
3331
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 40,
32+
allowDefaultProject: ['scripts/*.ts', '*.js', '*.mjs', '*.spec.ts'],
3433
},
3534
}
3635

@@ -46,15 +45,6 @@ export const rootEslintConfig = [
4645
'templates/**',
4746
],
4847
},
49-
{
50-
languageOptions: {
51-
parserOptions: {
52-
project: './tsconfig.json',
53-
tsconfigDirName: import.meta.dirname,
54-
...rootParserOptions,
55-
},
56-
},
57-
},
5848
{
5949
plugins: {
6050
payload: payloadPlugin,
@@ -79,6 +69,15 @@ export const rootEslintConfig = [
7969

8070
export default [
8171
...rootEslintConfig,
72+
{
73+
languageOptions: {
74+
parserOptions: {
75+
...rootParserOptions,
76+
projectService: true,
77+
tsconfigRootDir: import.meta.dirname,
78+
},
79+
},
80+
},
8281
{
8382
files: ['packages/eslint-config/**/*.ts'],
8483
rules: {

examples/auth/next-app/app/_components/Header/index.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
width: 150px;
1616
}
1717

18-
:global([data-theme="light"]) {
18+
:global([data-theme='light']) {
1919
.logo {
2020
filter: invert(1);
2121
}

examples/auth/next-app/app/_components/RenderParams/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export const RenderParams: React.FC<{
1010
className?: string
1111
}> = ({ params = ['error', 'message', 'success'], message, className }) => {
1212
const searchParams = useSearchParams()
13-
const paramValues = params.map(param => searchParams.get(param)).filter(Boolean)
13+
const paramValues = params.map((param) => searchParams.get(param)).filter(Boolean)
1414

1515
if (paramValues.length) {
1616
return (
1717
<div className={className}>
18-
{paramValues.map(paramValue => (
18+
{paramValues.map((paramValue) => (
1919
<Message
2020
key={paramValue}
2121
message={(message || 'PARAM')?.replace('PARAM', paramValue || '')}

examples/auth/next-app/app/_css/app.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@use './queries.scss' as *;
22
@use './colors.scss' as *;
33
@use './type.scss' as *;
4-
@import "./theme.scss";
4+
@import './theme.scss';
55

66
:root {
77
--base: 24px;
@@ -88,7 +88,7 @@ p {
8888
margin: var(--base) 0;
8989

9090
@include mid-break {
91-
margin: calc(var(--base) * .75) 0;
91+
margin: calc(var(--base) * 0.75) 0;
9292
}
9393
}
9494

@@ -102,12 +102,12 @@ a {
102102
color: currentColor;
103103

104104
&:focus {
105-
opacity: .8;
105+
opacity: 0.8;
106106
outline: none;
107107
}
108108

109109
&:active {
110-
opacity: .7;
110+
opacity: 0.7;
111111
outline: none;
112112
}
113113
}

examples/auth/next-app/app/_providers/Auth/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
1616
const [user, setUser] = useState<User | null>()
1717

1818
const create = useCallback<Create>(
19-
async args => {
19+
async (args) => {
2020
if (api === 'rest') {
2121
const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users`, args)
2222
setUser(user)
@@ -38,7 +38,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
3838
)
3939

4040
const login = useCallback<Login>(
41-
async args => {
41+
async (args) => {
4242
if (api === 'rest') {
4343
const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/login`, args)
4444
setUser(user)
@@ -110,7 +110,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
110110
}, [api])
111111

112112
const forgotPassword = useCallback<ForgotPassword>(
113-
async args => {
113+
async (args) => {
114114
if (api === 'rest') {
115115
const user = await rest(
116116
`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/forgot-password`,
@@ -132,7 +132,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
132132
)
133133

134134
const resetPassword = useCallback<ResetPassword>(
135-
async args => {
135+
async (args) => {
136136
if (api === 'rest') {
137137
const user = await rest(
138138
`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/reset-password`,

examples/auth/next-app/app/account/AccountForm/index.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../../_css/common";
1+
@import '../../_css/common';
22

33
.form {
44
margin-bottom: var(--base);

examples/auth/next-app/app/account/AccountForm/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const AccountForm: React.FC = () => {
139139
label="Confirm Password"
140140
required
141141
register={register}
142-
validate={value => value === password.current || 'The passwords do not match'}
142+
validate={(value) => value === password.current || 'The passwords do not match'}
143143
error={errors.passwordConfirm}
144144
/>
145145
</Fragment>

examples/auth/next-app/app/create-account/CreateAccountForm/index.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../../_css/common";
1+
@import '../../_css/common';
22

33
.form {
44
margin-bottom: var(--base);

0 commit comments

Comments
 (0)