Skip to content

Commit bcd23fd

Browse files
authored
Chore/improved plugin development and testing environment
- improved eslint performance - relocate package test environment execution scripts - delete unused files - changing the eslint script inside lint-staged
1 parent 376d3a3 commit bcd23fd

60 files changed

Lines changed: 4237 additions & 6044 deletions

Some content is hidden

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ yarn-error.log*
4343
/dev/media
4444

4545
.npmrc
46+
.cache/

.prettierrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
2+
"recommendations": ["dbaeumer.vscode-eslint"]
33
}

.vscode/settings.json

Lines changed: 116 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,127 @@
11
{
2-
"npm.packageManager": "pnpm",
3-
"editor.defaultFormatter": "esbenp.prettier-vscode",
4-
"[typescript]": {
5-
"editor.defaultFormatter": "esbenp.prettier-vscode",
6-
"editor.formatOnSave": true,
7-
"editor.codeActionsOnSave": {
8-
"source.fixAll.eslint": "explicit"
9-
}
2+
"editor.tabSize": 2,
3+
// Disable the default formatter, use eslint instead
4+
"prettier.enable": false,
5+
// Auto fix
6+
"editor.formatOnSave": true,
7+
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
8+
"editor.codeActionsOnSave": {
9+
"source.organizeImports": "never",
10+
"source.fixAll.eslint": "always",
11+
"source.removeUnusedImports": "always"
1012
},
13+
"eslint.enable": true,
14+
"eslint.probe": [
15+
"astro",
16+
"javascript",
17+
"javascriptreact",
18+
"typescript",
19+
"typescriptreact",
20+
"html",
21+
"mdx",
22+
"vue",
23+
"markdown",
24+
"json",
25+
"jsonc"
26+
],
27+
"typescript.validate.enable": true,
28+
"javascript.validate.enable": true,
1129
"[typescriptreact]": {
12-
"editor.defaultFormatter": "esbenp.prettier-vscode",
13-
"editor.formatOnSave": true,
14-
"editor.codeActionsOnSave": {
15-
"source.fixAll.eslint": "explicit"
16-
}
30+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
31+
},
32+
"[typescript]": {
33+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
34+
},
35+
"[javascriptreact]": {
36+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
1737
},
1838
"[javascript]": {
19-
"editor.defaultFormatter": "esbenp.prettier-vscode",
20-
"editor.formatOnSave": true,
21-
"editor.codeActionsOnSave": {
22-
"source.fixAll.eslint": "explicit"
23-
}
39+
"editor.defaultFormatter": "vscode.typescript-language-features"
2440
},
2541
"[json]": {
26-
"editor.defaultFormatter": "esbenp.prettier-vscode",
27-
"editor.formatOnSave": true
42+
"editor.quickSuggestions": {
43+
"strings": true
44+
},
45+
"editor.defaultFormatter": "vscode.json-language-features"
2846
},
47+
// Silent the stylistic rules in your IDE, but still auto fix them
48+
"eslint.rules.customizations": [
49+
{
50+
"rule": "style/*",
51+
"severity": "off",
52+
"fixable": true
53+
},
54+
{
55+
"rule": "format/*",
56+
"severity": "off",
57+
"fixable": true
58+
},
59+
{
60+
"rule": "*-indent",
61+
"severity": "off",
62+
"fixable": true
63+
},
64+
{
65+
"rule": "*-spacing",
66+
"severity": "off",
67+
"fixable": true
68+
},
69+
{
70+
"rule": "*-spaces",
71+
"severity": "off",
72+
"fixable": true
73+
},
74+
{
75+
"rule": "*-order",
76+
"severity": "off",
77+
"fixable": true
78+
},
79+
{
80+
"rule": "*-dangle",
81+
"severity": "off",
82+
"fixable": true
83+
},
84+
{
85+
"rule": "*-newline",
86+
"severity": "off",
87+
"fixable": true
88+
},
89+
{
90+
"rule": "*quotes",
91+
"severity": "off",
92+
"fixable": true
93+
},
94+
{
95+
"rule": "*semi",
96+
"severity": "off",
97+
"fixable": true
98+
}
99+
],
100+
// Enable eslint for all supported languages
101+
"eslint.validate": [
102+
"javascript",
103+
"javascriptreact",
104+
"typescript",
105+
"typescriptreact",
106+
"vue",
107+
"html",
108+
"markdown",
109+
"json",
110+
"jsonc",
111+
"yaml",
112+
"toml",
113+
"xml",
114+
"gql",
115+
"graphql",
116+
"astro",
117+
"svelte",
118+
"css",
119+
"less",
120+
"scss",
121+
"pcss",
122+
"postcss"
123+
],
29124
"[jsonc]": {
30-
"editor.defaultFormatter": "esbenp.prettier-vscode",
31-
"editor.formatOnSave": true
125+
"editor.defaultFormatter": "vscode.json-language-features"
32126
},
33-
"editor.formatOnSaveMode": "file",
34-
"typescript.tsdk": "node_modules/typescript/lib",
35-
"[javascript][typescript][typescriptreact]": {
36-
"editor.codeActionsOnSave": {
37-
"source.fixAll.eslint": "explicit"
38-
}
39-
}
40127
}
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
22
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
3-
import type { Metadata } from 'next'
3+
import type { Metadata } from 'next';
4+
import config from '@payload-config';
5+
import { generatePageMetadata, NotFoundPage } from '@payloadcms/next/views';
46

5-
import config from '@payload-config'
6-
import { generatePageMetadata, NotFoundPage } from '@payloadcms/next/views'
7+
import { importMap } from '../importMap.js';
78

8-
import { importMap } from '../importMap.js'
9-
10-
type Args = {
9+
interface Args {
1110
params: Promise<{
12-
segments: string[]
13-
}>
11+
segments: string[];
12+
}>;
1413
searchParams: Promise<{
15-
[key: string]: string | string[]
16-
}>
14+
[key: string]: string | string[];
15+
}>;
1716
}
1817

1918
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
20-
generatePageMetadata({ config, params, searchParams })
19+
generatePageMetadata({ config, params, searchParams });
2120

2221
const NotFound = ({ params, searchParams }: Args) =>
23-
NotFoundPage({ config, importMap, params, searchParams })
22+
NotFoundPage({ config, importMap, params, searchParams });
2423

25-
export default NotFound
24+
export default NotFound;
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
22
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
3-
import type { Metadata } from 'next'
3+
import type { Metadata } from 'next';
4+
import config from '@payload-config';
5+
import { generatePageMetadata, RootPage } from '@payloadcms/next/views';
46

5-
import config from '@payload-config'
6-
import { generatePageMetadata, RootPage } from '@payloadcms/next/views'
7+
import { importMap } from '../importMap.js';
78

8-
import { importMap } from '../importMap.js'
9-
10-
type Args = {
9+
interface Args {
1110
params: Promise<{
12-
segments: string[]
13-
}>
11+
segments: string[];
12+
}>;
1413
searchParams: Promise<{
15-
[key: string]: string | string[]
16-
}>
14+
[key: string]: string | string[];
15+
}>;
1716
}
1817

1918
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
20-
generatePageMetadata({ config, params, searchParams })
19+
generatePageMetadata({ config, params, searchParams });
2120

2221
const Page = ({ params, searchParams }: Args) =>
23-
RootPage({ config, importMap, params, searchParams })
22+
RootPage({ config, importMap, params, searchParams });
2423

25-
export default Page
24+
export default Page;
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
export const importMap = {
42

5-
}
3+
};
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
22
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
3-
import config from '@payload-config'
4-
import '@payloadcms/next/css'
3+
import config from '@payload-config';
4+
import '@payloadcms/next/css';
55
import {
66
REST_DELETE,
77
REST_GET,
88
REST_OPTIONS,
99
REST_PATCH,
1010
REST_POST,
1111
REST_PUT,
12-
} from '@payloadcms/next/routes'
12+
} from '@payloadcms/next/routes';
1313

14-
export const GET = REST_GET(config)
15-
export const POST = REST_POST(config)
16-
export const DELETE = REST_DELETE(config)
17-
export const PATCH = REST_PATCH(config)
18-
export const PUT = REST_PUT(config)
19-
export const OPTIONS = REST_OPTIONS(config)
14+
export const GET = REST_GET(config);
15+
export const POST = REST_POST(config);
16+
export const DELETE = REST_DELETE(config);
17+
export const PATCH = REST_PATCH(config);
18+
export const PUT = REST_PUT(config);
19+
export const OPTIONS = REST_OPTIONS(config);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
22
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
3-
import config from '@payload-config'
4-
import '@payloadcms/next/css'
5-
import { GRAPHQL_PLAYGROUND_GET } from '@payloadcms/next/routes'
3+
import config from '@payload-config';
4+
import '@payloadcms/next/css';
5+
import { GRAPHQL_PLAYGROUND_GET } from '@payloadcms/next/routes';
66

7-
export const GET = GRAPHQL_PLAYGROUND_GET(config)
7+
export const GET = GRAPHQL_PLAYGROUND_GET(config);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
22
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
3-
import config from '@payload-config'
4-
import { GRAPHQL_POST, REST_OPTIONS } from '@payloadcms/next/routes'
3+
import config from '@payload-config';
4+
import { GRAPHQL_POST, REST_OPTIONS } from '@payloadcms/next/routes';
55

6-
export const POST = GRAPHQL_POST(config)
6+
export const POST = GRAPHQL_POST(config);
77

8-
export const OPTIONS = REST_OPTIONS(config)
8+
export const OPTIONS = REST_OPTIONS(config);

0 commit comments

Comments
 (0)