2023-09-23 06:05:13 +08:00
|
|
|
const COPYRIGHT_HEADER = `/*
|
|
|
|
Copyright %%CURRENT_YEAR%% New Vector Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
2022-05-03 22:32:16 +08:00
|
|
|
module.exports = {
|
2022-12-10 03:34:25 +08:00
|
|
|
plugins: ["matrix-org"],
|
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",
|
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-07-10 23:20:59 +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
|
|
|
};
|