2023-09-23 06:05:13 +08:00
|
|
|
const COPYRIGHT_HEADER = `/*
|
2024-09-11 06:18:55 +08:00
|
|
|
Copyright %%CURRENT_YEAR%% New Vector Ltd.
|
2023-09-23 06:05:13 +08:00
|
|
|
|
2024-09-11 06:18:55 +08:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
Please see LICENSE in the repository root for full details.
|
2023-09-23 06:05:13 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
2022-05-03 22:32:16 +08:00
|
|
|
module.exports = {
|
2024-11-06 22:33:06 +08:00
|
|
|
plugins: ["matrix-org", "rxjs"],
|
2023-06-30 23:43:28 +08:00
|
|
|
extends: [
|
|
|
|
"plugin:matrix-org/react",
|
|
|
|
"plugin:matrix-org/a11y",
|
|
|
|
"plugin:matrix-org/typescript",
|
2023-09-23 06:05:13 +08:00
|
|
|
"prettier",
|
2024-11-06 22:33:06 +08:00
|
|
|
"plugin:rxjs/recommended",
|
2023-06-30 23:43:28 +08:00
|
|
|
],
|
|
|
|
parserOptions: {
|
2023-09-23 06:05:13 +08:00
|
|
|
ecmaVersion: "latest",
|
2023-06-30 23:43:28 +08:00
|
|
|
sourceType: "module",
|
|
|
|
project: ["./tsconfig.json"],
|
|
|
|
},
|
2022-12-10 03:34:25 +08:00
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
node: true,
|
|
|
|
},
|
|
|
|
rules: {
|
2023-09-23 06:05:13 +08:00
|
|
|
"matrix-org/require-copyright-header": ["error", COPYRIGHT_HEADER],
|
|
|
|
"jsx-a11y/media-has-caption": "off",
|
2023-10-11 22:30:57 +08:00
|
|
|
// We should use the js-sdk logger, never console directly.
|
|
|
|
"no-console": ["error"],
|
2023-12-20 00:00:33 +08:00
|
|
|
"react/display-name": "error",
|
2024-09-10 15:49:35 +08:00
|
|
|
// Encourage proper usage of Promises:
|
|
|
|
"@typescript-eslint/no-floating-promises": "error",
|
|
|
|
"@typescript-eslint/no-misused-promises": "error",
|
|
|
|
"@typescript-eslint/promise-function-async": "error",
|
|
|
|
"@typescript-eslint/require-await": "error",
|
|
|
|
"@typescript-eslint/await-thenable": "error",
|
2022-12-10 03:34:25 +08:00
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
react: {
|
|
|
|
version: "detect",
|
2022-05-03 22:32:16 +08:00
|
|
|
},
|
2022-12-10 03:34:25 +08:00
|
|
|
},
|
2022-05-03 22:32:16 +08:00
|
|
|
};
|