WebUI: Enforce TypeScript interface/type delimiter style with ESLint.
Per the styleguide at [1], interfaces should use semicolon as a
delimiter, whereas types should use a comma.
Enforcing via the @typescript-eslint/member-delimiter-style ESLint check
and fixing all violations using the --fix flag. Also, enforcing the
presence of a trailing comma, as required by [2].
[1] https://google.github.io/styleguide/tsguide.html#member-property-declarations
[2] https://google.github.io/styleguide/jsguide.html#features-objects-use-trailing-comma
Bug: 720034
Change-Id: I28e02fd573f46c2bd289663c1103ff42ed81e587
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3547610
Reviewed-by: Jeffrey Young <[email protected]>
Reviewed-by: John Lee <[email protected]>
Commit-Queue: Demetrios Papadopoulos <[email protected]>
Cr-Commit-Position: refs/heads/main@{#985892}
diff --git a/.eslintrc.js b/.eslintrc.js
index fbde0a1..437589b 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -75,6 +75,29 @@
'semi': 'off',
'@typescript-eslint/semi': ['error'],
+
+ '@typescript-eslint/member-delimiter-style': ['error', {
+ multiline: {
+ delimiter: 'comma',
+ requireLast: true,
+ },
+ singleline: {
+ delimiter: 'comma',
+ requireLast: false,
+ },
+ overrides: {
+ interface: {
+ multiline: {
+ delimiter: 'semi',
+ requireLast: true,
+ },
+ singleline: {
+ delimiter: 'semi',
+ requireLast: false,
+ },
+ },
+ },
+ }]
}
}]
};