mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
5a99243629
Previously, we had a `showFooter` boolean on the application controller which would be set true/false in various routes by different routes/controllers. A global `routeWillChange` hook would set it `false` before every route transition, and the destination route/controller would have to set it `true` for the footer to show correctly. This commit replaces that with a new 'declarative' system. Instead of having to set the value true/false manually, UIs which need the footer to be hidden can simply include the `{{hide-application-footer}}` helper in their template when needed. The helper/service will automatically keep track of all the current invocations of that helper, and only show the footer when there are 0 invocations. This significantly simplifies things, and removes the need for many observers and controller injections, both of which are considered 'code smells' in modern Ember applications.
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
module.exports = {
|
|
plugins: ["ember-template-lint-plugin-discourse"],
|
|
extends: "discourse:recommended",
|
|
|
|
rules: {
|
|
"no-action-modifiers": true,
|
|
"no-args-paths": true,
|
|
"no-attrs-in-components": true,
|
|
"no-capital-arguments": false, // TODO: we extensively use `args` argument name
|
|
"no-curly-component-invocation": {
|
|
allow: [
|
|
// These are helpers, not components
|
|
"directory-item-header-title",
|
|
"directory-item-user-field-value",
|
|
"directory-item-value",
|
|
"directory-table-header-title",
|
|
"loading-spinner",
|
|
"directory-item-label",
|
|
"hide-application-footer",
|
|
],
|
|
},
|
|
"no-implicit-this": {
|
|
allow: ["loading-spinner", "hide-application-footer"],
|
|
},
|
|
"require-mandatory-role-attributes": false,
|
|
"require-media-caption": false,
|
|
// Begin prettier compatibility
|
|
"eol-last": false,
|
|
"self-closing-void-elements": false,
|
|
"block-indentation": false,
|
|
quotes: false,
|
|
// End prettier compatibility
|
|
},
|
|
};
|