Files
element-call/.eslintrc.cjs
T

62 lines
1.6 KiB
JavaScript
Raw Normal View History

2023-09-22 18:05:13 -04:00
const COPYRIGHT_HEADER = `/*
2024-09-10 18:18:55 -04:00
Copyright %%CURRENT_YEAR%% New Vector Ltd.
2023-09-22 18:05:13 -04:00
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
2024-09-10 18:18:55 -04:00
Please see LICENSE in the repository root for full details.
2023-09-22 18:05:13 -04:00
*/
`;
2022-05-03 15:32:16 +01:00
module.exports = {
2024-11-06 14:33:06 +00:00
plugins: ["matrix-org", "rxjs"],
2023-06-30 16:43:28 +01:00
extends: [
"plugin:matrix-org/react",
"plugin:matrix-org/a11y",
"plugin:matrix-org/typescript",
2023-09-22 18:05:13 -04:00
"prettier",
2024-11-06 14:33:06 +00:00
"plugin:rxjs/recommended",
2023-06-30 16:43:28 +01:00
],
parserOptions: {
2023-09-22 18:05:13 -04:00
ecmaVersion: "latest",
2023-06-30 16:43:28 +01:00
sourceType: "module",
project: ["./tsconfig.json"],
},
2022-12-09 14:34:25 -05:00
env: {
browser: true,
node: true,
},
rules: {
2023-09-22 18:05:13 -04:00
"matrix-org/require-copyright-header": ["error", COPYRIGHT_HEADER],
"jsx-a11y/media-has-caption": "off",
"react/display-name": "error",
// 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",
// To help ensure that we get proper vite/rollup lazy loading (e.g. for matrix-js-sdk):
"@typescript-eslint/consistent-type-imports": [
"error",
{ fixStyle: "inline-type-imports" },
],
// To encourage good usage of RxJS:
2024-11-20 10:32:21 +00:00
"rxjs/no-exposed-subjects": "error",
2025-06-18 17:14:03 -04:00
"rxjs/finnish": ["error", { names: { "^this$": false } }],
2022-12-09 14:34:25 -05:00
},
overrides: [
{
files: ["src/*/**"],
rules: {
// In application code we should use the js-sdk logger, never console directly.
"no-console": ["error"],
},
},
],
2022-12-09 14:34:25 -05:00
settings: {
react: {
version: "detect",
2022-05-03 15:32:16 +01:00
},
2022-12-09 14:34:25 -05:00
},
2022-05-03 15:32:16 +01:00
};