Skip to content

Commit 349c2c2

Browse files
committed
Apply prettier formatting
1 parent 08a9073 commit 349c2c2

File tree

239 files changed

+22143
-22067
lines changed

Some content is hidden

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

239 files changed

+22143
-22067
lines changed

.babelrc

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
22
"sourceMaps": true,
33
"presets": [
4-
["@babel/preset-env", {
5-
"targets": {
6-
"node": 10
7-
},
8-
"modules": "commonjs"
9-
}],
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"node": 10
9+
},
10+
"modules": "commonjs"
11+
}
12+
],
1013
"@babel/preset-typescript"
1114
],
1215
"plugins": [

.eslintrc.js

+77-79
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
module.exports = {
2-
plugins: [
3-
"matrix-org",
4-
"import",
5-
"jsdoc",
6-
],
7-
extends: [
8-
"plugin:matrix-org/babel",
9-
"plugin:import/typescript",
10-
],
2+
plugins: ["matrix-org", "import", "jsdoc"],
3+
extends: ["plugin:matrix-org/babel", "plugin:import/typescript"],
114
env: {
125
browser: true,
136
node: true,
@@ -28,12 +21,15 @@ module.exports = {
2821
"padded-blocks": ["error"],
2922
"no-extend-native": ["error"],
3023
"camelcase": ["error"],
31-
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
32-
"space-before-function-paren": ["error", {
33-
"anonymous": "never",
34-
"named": "never",
35-
"asyncArrow": "always",
36-
}],
24+
"no-multi-spaces": ["error", { ignoreEOLComments: true }],
25+
"space-before-function-paren": [
26+
"error",
27+
{
28+
anonymous: "never",
29+
named: "never",
30+
asyncArrow: "always",
31+
},
32+
],
3733
"arrow-parens": "off",
3834
"prefer-promise-reject-errors": "off",
3935
"no-constant-condition": "off",
@@ -42,76 +38,78 @@ module.exports = {
4238
"no-console": "error",
4339

4440
// restrict EventEmitters to force callers to use TypedEventEmitter
45-
"no-restricted-imports": ["error", {
46-
name: "events",
47-
message: "Please use TypedEventEmitter instead",
48-
}],
49-
50-
"import/no-restricted-paths": ["error", {
51-
"zones": [{
52-
"target": "./src/",
53-
"from": "./src/index.ts",
54-
"message": "The package index is dynamic between src and lib depending on " +
55-
"whether release or development, target the specific module or matrix.ts instead",
56-
}],
57-
}],
58-
},
59-
overrides: [{
60-
files: [
61-
"**/*.ts",
62-
],
63-
plugins: [
64-
"eslint-plugin-tsdoc",
41+
"no-restricted-imports": [
42+
"error",
43+
{
44+
name: "events",
45+
message: "Please use TypedEventEmitter instead",
46+
},
6547
],
66-
extends: [
67-
"plugin:matrix-org/typescript",
68-
],
69-
rules: {
70-
// TypeScript has its own version of this
71-
"@babel/no-invalid-this": "off",
7248

73-
// We're okay being explicit at the moment
74-
"@typescript-eslint/no-empty-interface": "off",
75-
// We disable this while we're transitioning
76-
"@typescript-eslint/no-explicit-any": "off",
77-
// We'd rather not do this but we do
78-
"@typescript-eslint/ban-ts-comment": "off",
79-
// We're okay with assertion errors when we ask for them
80-
"@typescript-eslint/no-non-null-assertion": "off",
49+
"import/no-restricted-paths": [
50+
"error",
51+
{
52+
zones: [
53+
{
54+
target: "./src/",
55+
from: "./src/index.ts",
56+
message:
57+
"The package index is dynamic between src and lib depending on " +
58+
"whether release or development, target the specific module or matrix.ts instead",
59+
},
60+
],
61+
},
62+
],
63+
},
64+
overrides: [
65+
{
66+
files: ["**/*.ts"],
67+
plugins: ["eslint-plugin-tsdoc"],
68+
extends: ["plugin:matrix-org/typescript"],
69+
rules: {
70+
// TypeScript has its own version of this
71+
"@babel/no-invalid-this": "off",
8172

82-
// The non-TypeScript rule produces false positives
83-
"func-call-spacing": "off",
84-
"@typescript-eslint/func-call-spacing": ["error"],
73+
// We're okay being explicit at the moment
74+
"@typescript-eslint/no-empty-interface": "off",
75+
// We disable this while we're transitioning
76+
"@typescript-eslint/no-explicit-any": "off",
77+
// We'd rather not do this but we do
78+
"@typescript-eslint/ban-ts-comment": "off",
79+
// We're okay with assertion errors when we ask for them
80+
"@typescript-eslint/no-non-null-assertion": "off",
8581

86-
"quotes": "off",
87-
// We use a `logger` intermediary module
88-
"no-console": "error",
82+
// The non-TypeScript rule produces false positives
83+
"func-call-spacing": "off",
84+
"@typescript-eslint/func-call-spacing": ["error"],
8985

86+
"quotes": "off",
87+
// We use a `logger` intermediary module
88+
"no-console": "error",
89+
},
9090
},
91-
}, {
92-
// We don't need amazing docs in our spec files
93-
files: [
94-
"src/**/*.ts",
95-
],
96-
rules: {
97-
"tsdoc/syntax": "error",
98-
// We use some select jsdoc rules as the tsdoc linter has only one rule
99-
"jsdoc/no-types": "error",
100-
"jsdoc/empty-tags": "error",
101-
"jsdoc/check-property-names": "error",
102-
"jsdoc/check-values": "error",
103-
// These need a bit more work before we can enable
104-
// "jsdoc/check-param-names": "error",
105-
// "jsdoc/check-indentation": "error",
91+
{
92+
// We don't need amazing docs in our spec files
93+
files: ["src/**/*.ts"],
94+
rules: {
95+
"tsdoc/syntax": "error",
96+
// We use some select jsdoc rules as the tsdoc linter has only one rule
97+
"jsdoc/no-types": "error",
98+
"jsdoc/empty-tags": "error",
99+
"jsdoc/check-property-names": "error",
100+
"jsdoc/check-values": "error",
101+
// These need a bit more work before we can enable
102+
// "jsdoc/check-param-names": "error",
103+
// "jsdoc/check-indentation": "error",
104+
},
106105
},
107-
}, {
108-
files: [
109-
"spec/**/*.ts",
110-
],
111-
rules: {
112-
// We don't need super strict typing in test utilities
113-
"@typescript-eslint/explicit-function-return-type": "off",
114-
"@typescript-eslint/explicit-member-accessibility": "off",
106+
{
107+
files: ["spec/**/*.ts"],
108+
rules: {
109+
// We don't need super strict typing in test utilities
110+
"@typescript-eslint/explicit-function-return-type": "off",
111+
"@typescript-eslint/explicit-member-accessibility": "off",
112+
},
115113
},
116-
}],
114+
],
117115
};

.github/PULL_REQUEST_TEMPLATE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Checklist
44

5-
* [ ] Tests written for new code (and old code if feasible)
6-
* [ ] Linter and other CI checks pass
7-
* [ ] Sign-off given on the changes (see [CONTRIBUTING.md](https://github.com/matrix-org/matrix-js-sdk/blob/develop/CONTRIBUTING.md))
5+
- [ ] Tests written for new code (and old code if feasible)
6+
- [ ] Linter and other CI checks pass
7+
- [ ] Sign-off given on the changes (see [CONTRIBUTING.md](https://github.com/matrix-org/matrix-js-sdk/blob/develop/CONTRIBUTING.md))
88

99
<!--
1010
If you would like to specify text for the changelog entry other than your PR title, add the following:

.github/renovate.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"github>matrix-org/renovate-config-element-web"
5-
]
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["github>matrix-org/renovate-config-element-web"]
64
}

.github/workflows/backport.yml

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
name: Backport
22
on:
3-
pull_request_target:
4-
types:
5-
- closed
6-
- labeled
7-
branches:
8-
- develop
3+
pull_request_target:
4+
types:
5+
- closed
6+
- labeled
7+
branches:
8+
- develop
99

1010
jobs:
11-
backport:
12-
name: Backport
13-
runs-on: ubuntu-latest
14-
# Only react to merged PRs for security reasons.
15-
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
16-
if: >
17-
github.event.pull_request.merged
18-
&& (
19-
github.event.action == 'closed'
20-
|| (
21-
github.event.action == 'labeled'
22-
&& contains(github.event.label.name, 'backport')
23-
)
24-
)
25-
steps:
26-
- uses: tibdex/backport@v2
27-
with:
28-
labels_template: "<%= JSON.stringify([...labels, 'X-Release-Blocker']) %>"
29-
# We can't use GITHUB_TOKEN here or CI won't run on the new PR
30-
github_token: ${{ secrets.ELEMENT_BOT_TOKEN }}
11+
backport:
12+
name: Backport
13+
runs-on: ubuntu-latest
14+
# Only react to merged PRs for security reasons.
15+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
16+
if: >
17+
github.event.pull_request.merged
18+
&& (
19+
github.event.action == 'closed'
20+
|| (
21+
github.event.action == 'labeled'
22+
&& contains(github.event.label.name, 'backport')
23+
)
24+
)
25+
steps:
26+
- uses: tibdex/backport@v2
27+
with:
28+
labels_template: "<%= JSON.stringify([...labels, 'X-Release-Blocker']) %>"
29+
# We can't use GITHUB_TOKEN here or CI won't run on the new PR
30+
github_token: ${{ secrets.ELEMENT_BOT_TOKEN }}
+28-28
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
name: Deploy documentation PR preview
22

33
on:
4-
workflow_run:
5-
workflows: [ "Static Analysis" ]
6-
types:
7-
- completed
4+
workflow_run:
5+
workflows: ["Static Analysis"]
6+
types:
7+
- completed
88

99
jobs:
10-
netlify:
11-
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
12-
runs-on: ubuntu-latest
13-
steps:
14-
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
15-
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
16-
- name: 📥 Download artifact
17-
uses: dawidd6/action-download-artifact@e6e25ac3a2b93187502a8be1ef9e9603afc34925 # v2.24.2
18-
with:
19-
workflow: static_analysis.yml
20-
run_id: ${{ github.event.workflow_run.id }}
21-
name: docs
22-
path: docs
10+
netlify:
11+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
12+
runs-on: ubuntu-latest
13+
steps:
14+
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
15+
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
16+
- name: 📥 Download artifact
17+
uses: dawidd6/action-download-artifact@e6e25ac3a2b93187502a8be1ef9e9603afc34925 # v2.24.2
18+
with:
19+
workflow: static_analysis.yml
20+
run_id: ${{ github.event.workflow_run.id }}
21+
name: docs
22+
path: docs
2323

24-
- name: 📤 Deploy to Netlify
25-
uses: matrix-org/netlify-pr-preview@v1
26-
with:
27-
path: docs
28-
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
29-
branch: ${{ github.event.workflow_run.head_branch }}
30-
revision: ${{ github.event.workflow_run.head_sha }}
31-
token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
32-
site_id: ${{ secrets.NETLIFY_SITE_ID }}
33-
desc: Documentation preview
34-
deployment_env: PR Documentation Preview
24+
- name: 📤 Deploy to Netlify
25+
uses: matrix-org/netlify-pr-preview@v1
26+
with:
27+
path: docs
28+
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
29+
branch: ${{ github.event.workflow_run.head_branch }}
30+
revision: ${{ github.event.workflow_run.head_sha }}
31+
token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
32+
site_id: ${{ secrets.NETLIFY_SITE_ID }}
33+
desc: Documentation preview
34+
deployment_env: PR Documentation Preview
+22-22
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
name: Notify Downstream Projects
22
on:
3-
push:
4-
branches: [ develop ]
3+
push:
4+
branches: [develop]
55
concurrency: ${{ github.workflow }}-${{ github.ref }}
66
jobs:
7-
notify-downstream:
8-
# Only respect triggers from our develop branch, ignore that of forks
9-
if: github.repository == 'matrix-org/matrix-js-sdk'
10-
continue-on-error: true
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
include:
15-
- repo: vector-im/element-web
16-
event: element-web-notify
17-
- repo: matrix-org/matrix-react-sdk
18-
event: upstream-sdk-notify
7+
notify-downstream:
8+
# Only respect triggers from our develop branch, ignore that of forks
9+
if: github.repository == 'matrix-org/matrix-js-sdk'
10+
continue-on-error: true
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- repo: vector-im/element-web
16+
event: element-web-notify
17+
- repo: matrix-org/matrix-react-sdk
18+
event: upstream-sdk-notify
1919

20-
runs-on: ubuntu-latest
21-
steps:
22-
- name: Notify matrix-react-sdk repo that a new SDK build is on develop so it can CI against it
23-
uses: peter-evans/repository-dispatch@v2
24-
with:
25-
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
26-
repository: ${{ matrix.repo }}
27-
event-type: ${{ matrix.event }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Notify matrix-react-sdk repo that a new SDK build is on develop so it can CI against it
23+
uses: peter-evans/repository-dispatch@v2
24+
with:
25+
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
26+
repository: ${{ matrix.repo }}
27+
event-type: ${{ matrix.event }}

0 commit comments

Comments
 (0)