Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: .eslintrc.js

Issue 2907763004: js_checker.py: Replace custom GetElementByIdCheck with ESLint no-restricted-properties. (Closed)
Patch Set: Resolve conflicts. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/web_dev_style/js_checker.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: .eslintrc.js
diff --git a/.eslintrc.js b/.eslintrc.js
index 79c117d75acb46214eed58cf677500cfcc9bfe50..270ced09cde8dc6fe2e0b341e38e72b9b8f50444 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -11,7 +11,16 @@ module.exports = {
'rules': {
// Enabled checks.
'no-extra-semi': 'error',
+ 'no-restricted-properties': ['error', {
+ 'object': 'document',
+ 'property': 'getElementById',
+ 'message': 'Use $(\'id\') or getSVGElement(\'id\') ' +
+ 'from chrome://resources/js/util.js instead of ' +
+ 'document.getElementById(\'id\')',
+ },
+ ],
'semi': ['error', 'always'],
+
// TODO(dpapad): Add more checks according to our styleguide.
},
};
« no previous file with comments | « no previous file | tools/web_dev_style/js_checker.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698