1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 const fs = require("fs");
10 const path = require("path");
12 function readFile(path) {
14 .readFileSync(path, { encoding: "utf-8" })
16 .filter(p => p && !p.startsWith("#"));
21 path.join(__dirname, "tools", "rewriting", "ThirdPartyPaths.txt")
23 ...readFile(path.join(__dirname, "tools", "rewriting", "Generated.txt")),
27 extends: ["stylelint-config-recommended"],
30 /* Disabled because of `-moz-element(#foo)` which gets misparsed. */
31 "color-no-invalid-hex": null,
32 "font-family-no-missing-generic-family-keyword": [
45 "function-no-unknown": [
49 "-moz-image-rect" /* Used for cropping images */,
50 "add" /* Used in mathml.css */,
55 "no-descending-specificity": null,
56 "no-duplicate-selectors": null,
58 "property-no-unknown": [
61 ignoreProperties: ["overflow-clip-box"],
66 * XXXgijs: we would like to enable this, but we can't right now.
67 * This is because Gecko uses a number of custom pseudoclasses,
68 * and stylelint assumes that for `:unknown-pseudoclass(foo)`,
69 * `foo` should be a known type.
70 * This is tedious but workable for things like `-moz-locale-dir` where
71 * the set of acceptable values (ltr/rtl) is small.
72 * However, for tree cells, the set of values is unlimited (ie
73 * user-defined, based on atoms sent by the JS tree view APIs).
74 * There does not appear to be a way to exempt the contents of these
75 * unknown pseudoclasses, and as a result, this rule is not
76 * usable for us. The 'type' only includes the contents of the
77 * pseudoclass, not the pseudo itself, so we can't filter based on the
79 * Ideally, we would either create an option to the builtin rule
80 * in stylelint itself, or mimic the rule but exempt these, or
81 * add parser support for our custom pseudoclasses.
83 * For now, we just disable this rule.
85 "selector-type-no-unknown": null,
87 * See above - if we enabled this rule, we'd have to allow for a number
88 * of custom elements we use, which are listed here:
89 "selector-type-no-unknown": [
92 ignore: ["custom-elements"],
94 // Modern custom element / storybooked components:
96 // moz-locale-dir trips this rule for some reason:
99 // Migrated XBL elements not part of core XUL that we use at the moment:
104 "popupnotificationcontent",
105 // Legacy XUL elements:
106 // (the commented out ones used to be a thing and aren't used in-tree anymore)
206 "toolbarpaletteitem",
233 "selector-pseudo-class-no-unknown": [
236 ignorePseudoClasses: ["popover-open"],