Apply restricted property rules to all files

This commit is contained in:
J. Ryan Stinnett 2021-06-30 14:27:03 +01:00
parent a9f35e8c69
commit 2baace7658

View file

@ -24,6 +24,18 @@ module.exports = {
// It's disabled here, but we should using it sparingly. // It's disabled here, but we should using it sparingly.
"react/jsx-no-bind": "off", "react/jsx-no-bind": "off",
"react/jsx-key": ["error"], "react/jsx-key": ["error"],
"no-restricted-properties": [
"error",
...buildRestrictedPropertiesOptions(
["window.innerHeight", "window.innerWidth", "window.visualViewport"],
"Use UIStore to access window dimensions instead.",
),
...buildRestrictedPropertiesOptions(
["*.mxcUrlToHttp", "*.getHttpUriForMxc"],
"Use Media helper instead to centralise access for customisation.",
),
],
}, },
overrides: [{ overrides: [{
files: [ files: [
@ -49,18 +61,6 @@ module.exports = {
"@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-explicit-any": "off",
// We'd rather not do this but we do // We'd rather not do this but we do
"@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/ban-ts-comment": "off",
"no-restricted-properties": [
"error",
...buildRestrictedPropertiesOptions(
["window.innerHeight", "window.innerWidth", "window.visualViewport"],
"Use UIStore to access window dimensions instead.",
),
...buildRestrictedPropertiesOptions(
["*.mxcUrlToHttp", "*.getHttpUriForMxc"],
"Use Media helper instead to centralise access for customisation.",
),
],
}, },
}], }],
}; };