Merge pull request #784 from robintown/prettier-everything

Apply Prettier to the entire project
This commit is contained in:
Robin 2022-12-10 18:55:15 -05:00 committed by GitHub
commit 1ec598453b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 72 additions and 80 deletions

View file

@ -1,28 +1,20 @@
module.exports = { module.exports = {
plugins: [ plugins: ["matrix-org"],
"matrix-org", extends: ["plugin:matrix-org/react", "plugin:matrix-org/a11y", "prettier"],
],
extends: [
"plugin:matrix-org/react",
"plugin:matrix-org/a11y",
"prettier",
],
env: { env: {
browser: true, browser: true,
node: true, node: true,
}, },
parserOptions: { parserOptions: {
"ecmaVersion": "latest", ecmaVersion: "latest",
"sourceType": "module", sourceType: "module",
}, },
rules: { rules: {
"jsx-a11y/media-has-caption": ["off"], "jsx-a11y/media-has-caption": ["off"],
}, },
overrides: [ overrides: [
{ {
files: [ files: ["src/**/*.{ts,tsx}"],
"src/**/*.{ts,tsx}",
],
extends: [ extends: [
"plugin:matrix-org/typescript", "plugin:matrix-org/typescript",
"plugin:matrix-org/react", "plugin:matrix-org/react",

View file

@ -61,7 +61,7 @@ body:
description: | description: |
To send them, press the 'Submit Feedback' button and check 'Include Debug Logs'. Please link to this issue in the description field. To send them, press the 'Submit Feedback' button and check 'Include Debug Logs'. Please link to this issue in the description field.
options: options:
- 'Yes' - "Yes"
- 'No' - "No"
validations: validations:
required: true required: true

View file

@ -11,7 +11,7 @@ jobs:
- name: Yarn cache - name: Yarn cache
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
cache: 'yarn' cache: "yarn"
- name: Install dependencies - name: Install dependencies
run: "yarn install" run: "yarn install"
- name: Prettier - name: Prettier

View file

@ -21,7 +21,7 @@ jobs:
env: main-branch-cd env: main-branch-cd
ref: ${{ github.event.workflow_run.head_sha }} ref: ${{ github.event.workflow_run.head_sha }}
- name: 'Download artifact' - name: "Download artifact"
uses: actions/github-script@v3.1.0 uses: actions/github-script@v3.1.0
with: with:
script: | script: |

View file

@ -2,7 +2,7 @@ name: Move new issues into triage board
on: on:
issues: issues:
types: [ opened ] types: [opened]
jobs: jobs:
add-to-project: add-to-project:

View file

@ -5,18 +5,18 @@
"editor.tabSize": 2, "editor.tabSize": 2,
"[typescriptreact]": { "[typescriptreact]": {
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[javascriptreact]": { "[javascriptreact]": {
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[typescript]": { "[typescript]": {
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[javascript]": { "[javascript]": {
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode"
} }
} }

View file

@ -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). Element follows the same pattern as the [matrix-js-sdk](https://github.com/matrix-org/matrix-js-sdk/blob/develop/CONTRIBUTING.md).

View file

@ -6,11 +6,13 @@ export default {
createOldCatalogs: false, createOldCatalogs: false,
defaultNamespace: "app", defaultNamespace: "app",
lexers: { lexers: {
ts: [{ ts: [
{
lexer: "JavascriptLexer", lexer: "JavascriptLexer",
functions: ["t", "translatedError"], functions: ["t", "translatedError"],
functionsNamespace: ["useTranslation", "withTranslation"], functionsNamespace: ["useTranslation", "withTranslation"],
}], },
],
}, },
locales: ["en-GB"], locales: ["en-GB"],
output: "public/locales/$LOCALE/$NAMESPACE.json", output: "public/locales/$LOCALE/$NAMESPACE.json",

View file

@ -7,8 +7,8 @@
"serve": "vite preview", "serve": "vite preview",
"storybook": "start-storybook -p 6006", "storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook", "build-storybook": "build-storybook",
"prettier:check": "prettier -c src", "prettier:check": "prettier -c .",
"prettier:format": "prettier -w src", "prettier:format": "prettier -w .",
"lint": "yarn lint:types && yarn lint:js", "lint": "yarn lint:types && yarn lint:js",
"lint:js": "eslint --max-warnings 0 src", "lint:js": "eslint --max-warnings 0 src",
"lint:types": "tsc", "lint:types": "tsc",

View file

@ -1,20 +1,19 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.png" /> <link rel="icon" type="image/svg+xml" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta
<title> name="viewport"
<%- title %> content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
</title> />
<title><%- title %></title>
<script> <script>
window.global = window; window.global = window;
</script> </script>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
</body> </body>
</html> </html>

View file

@ -1 +1 @@
module.exports = { loadOlm: jest.fn(async () => {}) } module.exports = { loadOlm: jest.fn(async () => {}) };