diff --git a/.eslintrc.cjs b/.eslintrc.cjs index cb2ead0c..f4107103 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,42 +1,34 @@ module.exports = { - plugins: [ - "matrix-org", - ], - extends: [ + plugins: ["matrix-org"], + extends: ["plugin:matrix-org/react", "plugin:matrix-org/a11y", "prettier"], + env: { + browser: true, + node: true, + }, + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, + rules: { + "jsx-a11y/media-has-caption": ["off"], + }, + overrides: [ + { + files: ["src/**/*.{ts,tsx}"], + extends: [ + "plugin:matrix-org/typescript", "plugin:matrix-org/react", - "plugin:matrix-org/a11y", "prettier", - ], - env: { - browser: true, - node: true, + ], + rules: { + // We're aiming to convert this code to strict mode + "@typescript-eslint/no-non-null-assertion": "off", + }, }, - parserOptions: { - "ecmaVersion": "latest", - "sourceType": "module", - }, - rules: { - "jsx-a11y/media-has-caption": ["off"], - }, - overrides: [ - { - files: [ - "src/**/*.{ts,tsx}", - ], - extends: [ - "plugin:matrix-org/typescript", - "plugin:matrix-org/react", - "prettier", - ], - rules: { - // We're aiming to convert this code to strict mode - "@typescript-eslint/no-non-null-assertion": "off", - }, - }, - ], - settings: { - react: { - version: "detect", - }, + ], + settings: { + react: { + version: "detect", }, + }, }; diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 490f3566..10def3a6 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -42,7 +42,7 @@ body: id: browser attributes: label: Browser information - description: Which browser are you using? Which version? + description: Which browser are you using? Which version? placeholder: e.g. Chromium Version 92.0.4515.131 validations: required: false @@ -58,10 +58,10 @@ body: id: rageshake attributes: label: Will you send logs? - description: | + description: | To send them, press the 'Submit Feedback' button and check 'Include Debug Logs'. Please link to this issue in the description field. options: - - 'Yes' - - 'No' + - "Yes" + - "No" validations: required: true diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 22411656..a9298638 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -11,7 +11,7 @@ jobs: - name: Yarn cache uses: actions/setup-node@v3 with: - cache: 'yarn' + cache: "yarn" - name: Install dependencies run: "yarn install" - name: Prettier diff --git a/.github/workflows/netlify-main.yaml b/.github/workflows/netlify-main.yaml index a272a007..f281a040 100644 --- a/.github/workflows/netlify-main.yaml +++ b/.github/workflows/netlify-main.yaml @@ -21,7 +21,7 @@ jobs: env: main-branch-cd ref: ${{ github.event.workflow_run.head_sha }} - - name: 'Download artifact' + - name: "Download artifact" uses: actions/github-script@v3.1.0 with: script: | diff --git a/.github/workflows/triage-incoming.yaml b/.github/workflows/triage-incoming.yaml index 50419c6d..3e1d6655 100644 --- a/.github/workflows/triage-incoming.yaml +++ b/.github/workflows/triage-incoming.yaml @@ -2,7 +2,7 @@ name: Move new issues into triage board on: issues: - types: [ opened ] + types: [opened] jobs: add-to-project: @@ -13,13 +13,13 @@ jobs: with: headers: '{"GraphQL-Features": "projects_next_graphql"}' query: | - mutation add_to_project($projectid:ID!,$contentid:ID!) { - addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) { - item { - id - } + mutation add_to_project($projectid:ID!,$contentid:ID!) { + addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) { + item { + id } } + } projectid: ${{ env.PROJECT_ID }} contentid: ${{ github.event.issue.node_id }} env: diff --git a/.vscode/settings.json b/.vscode/settings.json index fe488f68..7fa064e3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,18 +5,18 @@ "editor.tabSize": 2, "[typescriptreact]": { "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascriptreact]": { "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[typescript]": { "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "esbenp.prettier-vscode" } } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e14c75df..0a4a6ac6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,3 @@ -Contributing code to Element -============================ +# Contributing code to Element Element follows the same pattern as the [matrix-js-sdk](https://github.com/matrix-org/matrix-js-sdk/blob/develop/CONTRIBUTING.md). diff --git a/i18next-parser.config.js b/i18next-parser.config.js index b2d58428..a12797ee 100644 --- a/i18next-parser.config.js +++ b/i18next-parser.config.js @@ -6,11 +6,13 @@ export default { createOldCatalogs: false, defaultNamespace: "app", lexers: { - ts: [{ - lexer: "JavascriptLexer", - functions: ["t", "translatedError"], - functionsNamespace: ["useTranslation", "withTranslation"], - }], + ts: [ + { + lexer: "JavascriptLexer", + functions: ["t", "translatedError"], + functionsNamespace: ["useTranslation", "withTranslation"], + }, + ], }, locales: ["en-GB"], output: "public/locales/$LOCALE/$NAMESPACE.json", diff --git a/package.json b/package.json index 185d23c6..90e02c37 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "serve": "vite preview", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook", - "prettier:check": "prettier -c src", - "prettier:format": "prettier -w src", + "prettier:check": "prettier -c .", + "prettier:format": "prettier -w .", "lint": "yarn lint:types && yarn lint:js", "lint:js": "eslint --max-warnings 0 src", "lint:types": "tsc", diff --git a/public/index.html b/public/index.html index c6ddea73..3f582069 100644 --- a/public/index.html +++ b/public/index.html @@ -1,20 +1,19 @@ + + + + + <%- title %> + + - - - - - - <%- title %> - - - - - -
- - - \ No newline at end of file + +
+ + diff --git a/test/mocks/olmMock.ts b/test/mocks/olmMock.ts index 8bc7429e..2c18fde9 100644 --- a/test/mocks/olmMock.ts +++ b/test/mocks/olmMock.ts @@ -1 +1 @@ -module.exports = { loadOlm: jest.fn(async () => {}) } +module.exports = { loadOlm: jest.fn(async () => {}) }; diff --git a/tsconfig.json b/tsconfig.json index e517276f..47d1bdbf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,7 @@ ] }, "include": [ - "./src/**/*.ts", + "./src/**/*.ts", "./src/**/*.tsx", "./test/**/*.ts", "./test/**/*.tsx"