Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: stylelint-config-eyeo/index.js

Issue 29541680: Issue 5109 - Create stylelintrc for websites and ui modules (Closed) Base URL: https://hg.adblockplus.org/codingtools
Patch Set: Created Sept. 11, 2017, 9:21 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: stylelint-config-eyeo/index.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/stylelint-config-eyeo/index.js
@@ -0,0 +1,55 @@
+/*
+ * This file is part of Adblock Plus <https://adblockplus.org/>,
+ * Copyright (C) 2006-present eyeo GmbH
+ *
+ * Adblock Plus is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Adblock Plus is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+"use strict"
+
+module.exports = {
+ "extends": "stylelint-config-recommended",
+ "rules": {
+
+ // Opening braces go on their own line
+ "block-closing-brace-empty-line-before": "never",
+ "block-closing-brace-newline-after": "always",
+ "block-closing-brace-newline-before": "always-multi-line",
+ "block-closing-brace-space-after": "always-single-line",
+ "block-closing-brace-space-before": "always-single-line",
Thomas Greiner 2017/09/13 18:12:52 Which part of the coding style does this rule refe
ire 2017/09/14 08:33:00 We link to the Google HTML/CSS Style guide, which
Thomas Greiner 2017/09/14 10:52:15 This rule is not about the opening but the closing
ire 2017/09/15 08:54:11 Under 4.2.5 Declaration Block Separation, it says:
Thomas Greiner 2017/09/15 16:58:29 There seems to be a misunderstanding - sorry about
ire 2017/09/18 07:36:20 Ah right! Yes seems I was mixing the two up. Two
Thomas Greiner 2017/11/14 13:18:30 I can't find any mentions of it being prohibited i
ire 2017/11/15 06:38:32 Okay. I will remove two rules: "block-opening-brac
ire 2017/11/15 06:38:32 Done.
+ "block-opening-brace-newline-after": "always-multi-line",
+ "block-opening-brace-newline-before": "always-multi-line",
Thomas Greiner 2017/09/13 18:12:52 Allowing single-line rules here sounds incompatibl
ire 2017/09/14 08:33:00 I think I assumed that single-line rules were okay
Thomas Greiner 2017/09/14 10:52:15 It's the "Opening braces go on their own line" gui
ire 2017/09/15 08:54:11 Stylelint will consider that a single line (I beli
Thomas Greiner 2017/09/15 16:58:29 True, seems like it.
+ "block-opening-brace-space-after": "always-single-line",
+ "block-opening-brace-space-before": "always-single-line",
+
+ // Use double over single quotation marks
+ "string-quotes": "double",
+
+ // CSS color values should be specified in hexadecimal where possible
ire 2017/09/11 09:26:38 I couldn't find stylelint rules for these. Not sur
Thomas Greiner 2017/09/13 18:12:52 It's more of a guideline than a strict rule. Some
ire 2017/09/14 08:33:00 Okay thanks. Done.
+
+ // CSS shorthand properties usage is optional
+
+ // CSS rule declaration order should follow the WordPress CSS Coding Standards
ire 2017/09/11 09:26:38 The declaration order is no longer part of styleli
Thomas Greiner 2017/09/13 18:12:52 Given that this rule can be quite confusing for so
ire 2017/09/14 08:33:00 Okay. I think we should add it in a separate commi
Thomas Greiner 2017/09/14 10:52:15 I totally agree.
ire 2017/09/15 08:54:12 Great. Created the issue here https://issues.adblo
Thomas Greiner 2017/09/15 16:58:29 Awesome, thanks.
+
+ // CSS number values should specify units where possible
+ "unit-no-unknown": true,
Thomas Greiner 2017/09/13 18:12:52 This is not what "should specify units where possi
ire 2017/09/14 08:33:00 Seems I misunderstood the "unit-no-unknown" rule :
Thomas Greiner 2017/09/14 10:52:15 I included this in https://issues.adblockplus.org/
ire 2017/09/15 08:54:11 Acknowledged.
+
+ // Don't omit the optional leading 0 for decimal numbers
+ "number-leading-zero": "always",
+ "number-no-trailing-zeros": true,
+
+ // Indent by 2 spaces
+ "indentation": 2,
ire 2017/09/11 09:26:38 This isn't actually documented in https://adblockp
Thomas Greiner 2017/09/13 18:12:52 Under "General" we link to https://developer.mozil
ire 2017/09/14 08:33:00 Acknowledged.
+
+ },
+}

Powered by Google App Engine
This is Rietveld