From 6c0afbb68d5360655a08b659f3d345f84a72b9ff Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 4 Aug 2020 14:37:35 -0700 Subject: [PATCH] stylelint: Move .stylelintrc to stylelint.config.js. Signed-off-by: Anders Kaseorg --- docs/testing/linters.md | 2 +- .stylelintrc => stylelint.config.js | 18 ++++++++++-------- tools/lint | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) rename .stylelintrc => stylelint.config.js (94%) diff --git a/docs/testing/linters.md b/docs/testing/linters.md index 570f1a651a..857001faa4 100644 --- a/docs/testing/linters.md +++ b/docs/testing/linters.md @@ -215,7 +215,7 @@ clean those files up eventually. Zulip uses [stylelint](https://github.com/stylelint/stylelint) to lint its CSS; see our -[configuration](https://github.com/zulip/zulip/blob/master/.stylelintrc) +[configuration](https://github.com/zulip/zulip/blob/master/stylelint.config.js) for the rules we currently enforce. #### Shell scripts diff --git a/.stylelintrc b/stylelint.config.js similarity index 94% rename from .stylelintrc rename to stylelint.config.js index 1f59d95834..03191aa5a1 100644 --- a/.stylelintrc +++ b/stylelint.config.js @@ -1,6 +1,8 @@ -{ - "rules": { - # Stylistic rules for CSS. +"use strict"; + +module.exports = { + rules: { + // Stylistic rules for CSS. "function-comma-space-after": "always", "function-comma-space-before": "never", "function-max-empty-lines": 0, @@ -58,10 +60,10 @@ "at-rule-semicolon-space-before": "never", "comment-whitespace-inside": "always", - "indentation": 4, - - # Limit language features + indentation: 4, + + // Limit language features "color-no-hex": true, "color-named": "never", - } -} + }, +}; diff --git a/tools/lint b/tools/lint index d547027c79..228f65cf56 100755 --- a/tools/lint +++ b/tools/lint @@ -51,7 +51,7 @@ def run() -> None: linter_config.external_linter('css', ['node', 'node_modules/.bin/stylelint'], ['css', 'scss'], fix_arg='--fix', description="Standard CSS style and formatting linter " - "(config: .stylelintrc)") + "(config: stylelint.config.js)") linter_config.external_linter('eslint', ['node', 'node_modules/.bin/eslint', '--quiet', '--cache', '--ext', '.js,.ts'], ['js', 'ts'], fix_arg='--fix',