WebUI: Use ESLint checks to prevent @ts-ignore statements.
This is partially enforcing [1] from the TS styleguide. The new check is disabled in a few folders that still exhibit such violations. [1] https://google.github.io/styleguide/tsguide.html#ts-ignore Bug: 40519637,346830791 Change-Id: I8bbf32b19a9cae87da31540c1abc04ac6f29caf0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5628015 Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org> Reviewed-by: Luciano Pacheco <lucmult@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: Rebekah Potter <rbpotter@chromium.org> Cr-Commit-Position: refs/heads/main@{#1314729}
This commit is contained in:
@ -291,6 +291,9 @@ module.exports = {
|
||||
},
|
||||
}
|
||||
}],
|
||||
|
||||
// https://google.github.io/styleguide/tsguide.html#ts-ignore
|
||||
'@typescript-eslint/ban-ts-comment': ['error', {'ts-ignore': true}],
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
@ -11,5 +11,8 @@ module.exports = {
|
||||
|
||||
// Turn off since there are many violations in this folder.
|
||||
'@typescript-eslint/consistent-type-imports' : 'off',
|
||||
|
||||
// Turn off until violations in this folder are fixed.
|
||||
'@typescript-eslint/ban-ts-comment' : 'off',
|
||||
},
|
||||
};
|
||||
|
10
chrome/test/data/webui/side_panel/read_anything/.eslintrc.js
Normal file
10
chrome/test/data/webui/side_panel/read_anything/.eslintrc.js
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright 2024 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
module.exports = {
|
||||
'rules' : {
|
||||
// TODO(crbug.com/346830791): Fix all violations and re-enable.
|
||||
'@typescript-eslint/ban-ts-comment' : 'off',
|
||||
},
|
||||
};
|
@ -56,6 +56,7 @@ export class MockChromeFileManagerPrivateDirectoryChanged {
|
||||
|
||||
window.chrome.fileManagerPrivate = window.chrome.fileManagerPrivate || {};
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
|
||||
// @ts-ignore: The file_manager_private.d.ts don't allow to overwrite
|
||||
// `onDirectoryChanged`.
|
||||
window.chrome.fileManagerPrivate.onDirectoryChanged =
|
||||
|
Reference in New Issue
Block a user