mirror of https://github.com/zulip/zulip.git
lint: Use Prettier for JavaScript files.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
b65d2e063d
commit
ed183fb95f
|
@ -0,0 +1 @@
|
|||
/static/third
|
|
@ -1,3 +1,19 @@
|
|||
module.exports = {
|
||||
bracketSpacing: false,
|
||||
tabWidth: 4,
|
||||
trailingComma: "all",
|
||||
overrides: [
|
||||
{
|
||||
files: ["frontend_tests/casper_tests/*.js", "frontend_tests/casper_lib/*.js"],
|
||||
options: {
|
||||
trailingComma: "es5",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**.yml", "**.yaml"],
|
||||
options: {
|
||||
tabWidth: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -93,9 +93,10 @@ def run() -> None:
|
|||
linter_config.external_linter('isort', ['isort'], ['py'],
|
||||
description="Sorts Python import statements",
|
||||
check_arg=['--check-only', '--diff'])
|
||||
linter_config.external_linter('prettier', ['node_modules/.bin/prettier'], ['yaml', 'yml'],
|
||||
linter_config.external_linter('prettier', ['node_modules/.bin/prettier'],
|
||||
['js', 'ts', 'yaml', 'yml'],
|
||||
check_arg=['--check'], fix_arg=['--write'],
|
||||
description="Formats YAML files",
|
||||
description="Formats JavaScript and YAML",
|
||||
# https://github.com/prettier/prettier/pull/8703
|
||||
suppress_line=lambda line: line in ["Checking formatting...\n", "All matched files use Prettier code style!\n"])
|
||||
|
||||
|
|
Loading…
Reference in New Issue