matrix-public-archive/.eslintrc.json

84 lines
2.0 KiB
JSON
Raw Normal View History

2022-02-07 18:55:11 -07:00
{
"env": {
"es6": true,
2022-02-07 18:55:11 -07:00
"commonjs": true,
"node": true
},
"parserOptions": {
Add lightbox support and Hydrogen URL hashes relative to the room (#12) Add image lightbox support and Hydrogen URL hashes relative to the room Related to https://github.com/vector-im/hydrogen-web/issues/677 Requires the changes from https://github.com/vector-im/hydrogen-web/pull/749 (split out from https://github.com/vector-im/hydrogen-web/pull/653) ![](https://user-images.githubusercontent.com/558581/172526457-38c108e8-8c46-4e0c-9979-734348ec67fc.gif) ### Hydrogen routing relative to the room (remove session and room from the URL hash) Before: Page URL: doesn't work ```html <div class="Timeline_messageBody"> <div class="media" style="max-width: 400px"> <div class="spacer" style="padding-top: 48.75%;"></div> <a href="undefined"> <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;"> </a> <time>2/24 6:20 PM</time> </div> <!--node binding placeholder--> </div> ``` Before (not relative): Page URL: `http://localhost:3050/!HBehERstyQBxyJDLfR:my.synapse.server/date/2022/02/24#/session/123/room/!HBehERstyQBxyJDLfR:my.synapse.server/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk` ```html <div class="Timeline_messageBody"> <div class="media" style="max-width: 400px"> <div class="spacer" style="padding-top: 48.75%;"></div> <a href="#/session/123/room/!HBehERstyQBxyJDLfR:my.synapse.server/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk"> <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;"> </a> <time>2/24 6:20 PM</time> </div> <!--node binding placeholder--> </div> ``` After (nice relative links): Page URL: `http://localhost:3050/!HBehERstyQBxyJDLfR:my.synapse.server/date/2022/02/24#/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk` ```html <div class="Timeline_messageBody"> <div class="media" style="max-width: 400px"> <div class="spacer" style="padding-top: 48.75%;"></div> <a href="#/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk"> <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;"> </a> <time>2/24 6:20 PM</time> </div> <!--node binding placeholder--> </div> ```
2022-06-08 13:03:36 -06:00
"ecmaVersion": 2022,
2022-02-07 18:55:11 -07:00
"sourceType": "script"
},
"extends": ["eslint:recommended", "prettier", "plugin:n/recommended"],
2022-02-07 18:55:11 -07:00
"rules": {
"indent": "off",
"comma-dangle": "off",
"quotes": "off",
"eqeqeq": ["warn", "allow-null"],
"strict": ["error", "safe"],
"no-unused-vars": ["error", { "destructuredArrayIgnorePattern": "^_" }],
2022-02-07 18:55:11 -07:00
"no-extra-boolean-cast": ["warn"],
"complexity": [
"error",
{
"max": 12
}
],
"max-statements-per-line": [
"error",
{
"max": 3
}
],
"no-debugger": "error",
"no-dupe-keys": "error",
"no-unsafe-finally": "error",
"no-with": "error",
"no-useless-call": "error",
"no-spaced-func": "error",
"no-useless-escape": "warn",
"max-statements": ["warn", 30],
"max-depth": ["error", 4],
"no-throw-literal": ["error"],
"no-sequences": "error",
"radix": "error",
"yoda": "error",
"no-nested-ternary": "warn",
"no-whitespace-before-property": "error",
"no-trailing-spaces": ["error"],
"space-in-parens": ["warn", "never"],
"max-nested-callbacks": ["error", 6],
"eol-last": "warn",
"no-mixed-spaces-and-tabs": "error",
"no-negated-condition": "warn",
"no-unneeded-ternary": "error",
"no-use-before-define": ["warn", { "variables": true, "functions": true, "classes": true }],
"no-undef": "error",
"no-param-reassign": "warn",
"no-multi-spaces": [
"warn",
{
"exceptions": {
"Property": true
}
}
],
"key-spacing": [
"warn",
{
"singleLine": {
"beforeColon": false,
"afterColon": true
},
"multiLine": {
"beforeColon": false,
"afterColon": true,
"mode": "minimum"
}
}
],
"n/no-process-exit": "off",
"n/no-unsupported-features/es-syntax": "error",
"n/no-unsupported-features/es-builtins": "error"
2022-02-07 18:55:11 -07:00
}
}