Skip to content

Commit aa0a1a8

Browse files
committed
Merge branch 'develop'.
2 parents fdb53f6 + 8861e62 commit aa0a1a8

File tree

162 files changed

+8600
-1717
lines changed

Some content is hidden

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

162 files changed

+8600
-1717
lines changed

.eslintrc.json

Lines changed: 105 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,27 @@
1717
"import/no-unresolved": [
1818
"error",
1919
{
20-
"ignore": [ "^@wordpress-core/?.*" ]
20+
"ignore": [
21+
"^@wordpress-core/?.*"
22+
]
2123
}
2224
],
2325
"jsdoc/check-tag-names": "error",
2426
"jsdoc/check-types": "error",
25-
"jsdoc/check-line-alignment": [ "error", "always" ],
27+
"jsdoc/check-line-alignment": [
28+
"error",
29+
"always",
30+
{
31+
"preserveMainDescriptionPostDelimiter": true,
32+
"tags": [
33+
"param",
34+
"arg",
35+
"argument",
36+
"prop",
37+
"returns"
38+
]
39+
}
40+
],
2641
"jsdoc/require-description": "error",
2742
"jsdoc/require-description-complete-sentence": "off",
2843
"jsdoc/require-param": "error",
@@ -33,9 +48,14 @@
3348
"jsdoc/require-returns-description": "error",
3449
"jsdoc/require-returns-type": "error",
3550
"jsdoc/require-returns": "error",
51+
"jsdoc/require-yields": "off",
3652
"jsdoc/no-undefined-types": "error",
53+
"jsdoc/tag-lines": "off",
3754
"jsdoc/valid-types": "error",
38-
"lodash/import-scope": [ "error", "member" ],
55+
"lodash/import-scope": [
56+
"error",
57+
"member"
58+
],
3959
"require-await": "error",
4060
"react/function-component-definition": [
4161
"error",
@@ -44,7 +64,10 @@
4464
"unnamedComponents": "function-expression"
4565
}
4666
],
47-
"react/jsx-boolean-value": [ "error", "never" ],
67+
"react/jsx-boolean-value": [
68+
"error",
69+
"never"
70+
],
4871
"react/jsx-curly-brace-presence": "error",
4972
"no-invalid-regexp": "error",
5073
"no-useless-escape": "error",
@@ -56,13 +79,9 @@
5679
"prefix": "@"
5780
}
5881
],
59-
"complexity": [ "error", 15 ],
60-
"no-restricted-globals": [
82+
"complexity": [
6183
"error",
62-
{
63-
"name": "window",
64-
"message": "Use 'global' instead."
65-
}
84+
15
6685
],
6786
"no-use-before-define": [
6887
"error",
@@ -72,7 +91,10 @@
7291
"variables": false
7392
}
7493
],
75-
"react/jsx-fragments": [ "error", "element" ],
94+
"react/jsx-fragments": [
95+
"error",
96+
"element"
97+
],
7698
"valid-jsdoc": [
7799
"error",
78100
{
@@ -92,7 +114,10 @@
92114
"avoidEscape": true
93115
}
94116
],
95-
"curly": [ "error", "all" ],
117+
"curly": [
118+
"error",
119+
"all"
120+
],
96121
"prettier/prettier": [
97122
"error",
98123
{},
@@ -114,19 +139,80 @@
114139
"@wordpress/i18n__non-shim",
115140
"@wordpress/api-fetch__non-shim"
116141
],
142+
"import/parsers": {
143+
"@typescript-eslint/parser": [
144+
".ts",
145+
".tsx"
146+
]
147+
},
117148
"import/resolver": {
118149
"alias": {
119150
"map": [
120-
[ "@/(.*\\.svg)\\?url", "assets/" ],
121-
[ "@/(.*)", "assets/" ],
122-
[ "@wordpress-core", "@wordpress" ]
151+
[
152+
"@/(.*\\.svg)\\?url",
153+
"assets/"
154+
],
155+
[
156+
"@/(.*)",
157+
"assets/"
158+
],
159+
[
160+
"@wordpress-core",
161+
"@wordpress"
162+
]
123163
]
164+
},
165+
"node": {
166+
"extensions": [
167+
".js",
168+
".jsx",
169+
".ts",
170+
".tsx"
171+
]
172+
},
173+
"typescript": {
174+
"alwaysTryTypes": true
124175
}
125176
}
126177
},
127178
"overrides": [
128179
{
129-
"files": [ "tests/e2e/**/*.js" ],
180+
"files": [
181+
"**/*.ts",
182+
"**/*.tsx"
183+
],
184+
"extends": [
185+
"plugin:@typescript-eslint/recommended"
186+
],
187+
"parser": "@typescript-eslint/parser",
188+
"parserOptions": {
189+
"ecmaVersion": 2024
190+
},
191+
"env": {
192+
"browser": true
193+
},
194+
"globals": {
195+
"browser": true,
196+
"page": true
197+
},
198+
"rules": {
199+
"@typescript-eslint/ban-ts-comment": "off",
200+
"jsdoc/require-param-type": "off",
201+
"jsdoc/require-returns-type": "off",
202+
"react/function-component-definition": "off",
203+
"valid-jsdoc": [
204+
"error",
205+
{
206+
"requireParamType": false,
207+
"requireReturnType": false
208+
}
209+
]
210+
}
211+
},
212+
{
213+
"files": [
214+
"tests/e2e/**/*.js"
215+
],
130216
"env": {
131217
"browser": true
132218
},
@@ -135,7 +221,6 @@
135221
"page": true
136222
},
137223
"rules": {
138-
"no-restricted-globals": [ "off" ],
139224
"react-hooks/rules-of-hooks": "off"
140225
}
141226
},
@@ -158,7 +243,9 @@
158243
"assets/js/components/legacy*/**/*.js"
159244
],
160245
"rules": {
161-
"filenames/match-exported": [ "off" ]
246+
"filenames/match-exported": [
247+
"off"
248+
]
162249
}
163250
},
164251
{

.github/workflows/js-css-lint-test.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
paths:
1010
- '.github/workflows/js-css-lint-test.yml'
1111
- '**.js'
12+
- '**.ts'
13+
- '**.tsx'
1214
- '**.json'
1315
- '**.scss'
1416
- '.eslint*'
@@ -27,6 +29,8 @@ on:
2729
paths:
2830
- '.github/workflows/js-css-lint-test.yml'
2931
- '**.js'
32+
- '**.ts'
33+
- '**.tsx'
3034
- '**.json'
3135
- '**.scss'
3236
- '.eslint*'
@@ -57,7 +61,7 @@ jobs:
5761
node-version-file: .nvmrc
5862
cache: npm
5963
- name: npm install
60-
run: npm i -w assets --include-workspace-root
64+
run: npm ci -w assets --include-workspace-root
6165
- name: CSS Lint
6266
run: npm run lint:css
6367
js-lint:
@@ -71,9 +75,23 @@ jobs:
7175
node-version-file: .nvmrc
7276
cache: npm
7377
- name: npm install
74-
run: npm i -w assets -w storybook -w tests/js -w tests/e2e --include-workspace-root
78+
run: npm ci -w assets -w storybook -w tests/js -w tests/e2e --include-workspace-root
7579
- name: JS Lint
7680
run: npm run lint:js
81+
typecheck:
82+
name: Type check
83+
runs-on: ubuntu-latest
84+
timeout-minutes: 20
85+
steps:
86+
- uses: actions/checkout@v4
87+
- uses: actions/setup-node@v4
88+
with:
89+
node-version-file: .nvmrc
90+
cache: npm
91+
- name: npm install
92+
run: npm ci -w assets -w storybook -w tests/js -w tests/e2e --include-workspace-root
93+
- name: Type check
94+
run: npm run typecheck
7795
js-test:
7896
name: JS Tests
7997
runs-on: ubuntu-latest
@@ -87,7 +105,7 @@ jobs:
87105
node-version-file: .nvmrc
88106
cache: npm
89107
- name: npm install
90-
run: npm i -w assets -w storybook -w tests/js --include-workspace-root
108+
run: npm ci -w assets -w storybook -w tests/js --include-workspace-root
91109
- name: Jest Tests
92110
id: test-js
93111
run: npm run test:js -- -- --json --outputFile=../../${{ env.JEST_RESULTS_FILE }}
494 Bytes
Loading
497 Bytes
Loading
1.46 KB
Loading
1.76 KB
Loading
273 Bytes
Loading
1.74 KB
Loading
1.88 KB
Loading
1.67 KB
Loading

0 commit comments

Comments
 (0)