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 "light-dark" /* Used for color-scheme dependent colors */,
50 "add" /* Used in mathml.css */,
55 "max-nesting-depth": [
58 ignore: ["blockless-at-rules"],
62 "no-descending-specificity": null,
63 "no-duplicate-selectors": null,
65 "property-no-unknown": [
68 ignoreProperties: ["overflow-clip-box"],
73 * XXXgijs: we would like to enable this, but we can't right now.
74 * This is because Gecko uses a number of custom pseudoclasses,
75 * and stylelint assumes that for `:unknown-pseudoclass(foo)`,
76 * `foo` should be a known type.
77 * This is tedious but workable for things like `-moz-locale-dir` where
78 * the set of acceptable values (ltr/rtl) is small.
79 * However, for tree cells, the set of values is unlimited (ie
80 * user-defined, based on atoms sent by the JS tree view APIs).
81 * There does not appear to be a way to exempt the contents of these
82 * unknown pseudoclasses, and as a result, this rule is not
83 * usable for us. The 'type' only includes the contents of the
84 * pseudoclass, not the pseudo itself, so we can't filter based on the
86 * Ideally, we would either create an option to the builtin rule
87 * in stylelint itself, or mimic the rule but exempt these, or
88 * add parser support for our custom pseudoclasses.
90 * For now, we just disable this rule.
92 "selector-type-no-unknown": null,
94 * See above - if we enabled this rule, we'd have to allow for a number
95 * of custom elements we use, which are listed here:
96 "selector-type-no-unknown": [
99 ignore: ["custom-elements"],
101 // Modern custom element / storybooked components:
103 // moz-locale-dir trips this rule for some reason:
106 // Migrated XBL elements not part of core XUL that we use at the moment:
111 "popupnotificationcontent",
112 // Legacy XUL elements:
113 // (the commented out ones used to be a thing and aren't used in-tree anymore)
213 "toolbarpaletteitem",
240 "selector-pseudo-class-no-unknown": [
243 ignorePseudoClasses: ["popover-open"],
246 "selector-pseudo-element-no-unknown": [
249 ignorePseudoElements: ["slider-track", "slider-fill", "slider-thumb"],
257 customSyntax: "postcss-scss",
258 extends: "stylelint-config-recommended-scss",
262 "browser/components/aboutwelcome/**",
263 "browser/components/asrouter/**",
264 "browser/components/newtab/**",
266 customSyntax: "postcss-scss",
267 extends: "stylelint-config-standard-scss",
269 "at-rule-disallowed-list": [
270 ["debug", "warn", "error"],
272 message: "Clean up %s directives before committing",
275 "at-rule-no-vendor-prefix": null,
276 "color-function-notation": null,
277 "color-hex-case": "upper",
278 "comment-empty-line-before": [
281 except: ["first-nested"],
282 ignore: ["after-comment", "stylelint-commands"],
285 "custom-property-empty-line-before": null,
286 "custom-property-pattern": null,
287 "declaration-block-no-duplicate-properties": true,
288 "declaration-block-no-redundant-longhand-properties": null,
289 "declaration-no-important": true,
290 "function-no-unknown": [
293 ignoreFunctions: ["div"],
296 "function-url-no-scheme-relative": true,
298 "keyframes-name-pattern": null,
299 "media-feature-name-no-vendor-prefix": null,
300 "no-descending-specificity": null,
301 "no-eol-whitespace": true,
302 "no-missing-end-of-source-newline": true,
303 "number-leading-zero": "always",
304 "number-no-trailing-zeros": true,
305 "property-disallowed-list": [
306 ["margin-left", "margin-right"],
308 message: "Use margin-inline instead of %s",
311 "property-no-unknown": true,
312 "property-no-vendor-prefix": null,
313 "scss/dollar-variable-empty-line-before": null,
314 "scss/double-slash-comment-empty-line-before": [
317 except: ["first-nested"],
318 ignore: ["between-comments", "stylelint-commands", "inside-block"],
321 "selector-class-pattern": null,
322 "selector-no-vendor-prefix": null,
329 "value-keyword-case": null,
330 "value-no-vendor-prefix": null,