dpapad | ff82d51 | 2017-05-25 18:40:15 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | module.exports = { |
| 6 | 'root': true, |
| 7 | 'env': { |
| 8 | 'browser': true, |
Christopher Lam | a5f2ad0 | 2018-12-05 10:05:58 | [diff] [blame] | 9 | 'es6': true, |
| 10 | }, |
| 11 | 'parserOptions': { |
| 12 | 'ecmaVersion': 2017, |
dpapad | ff82d51 | 2017-05-25 18:40:15 | [diff] [blame] | 13 | }, |
| 14 | 'rules': { |
| 15 | // Enabled checks. |
Dan Beam | 1a0d9dcb | 2019-01-08 09:05:35 | [diff] [blame] | 16 | 'brace-style': ['error', '1tbs'], |
| 17 | 'curly': ['error', 'multi-line', 'consistent'], |
Dan Beam | b153665 | 2019-02-26 07:36:25 | [diff] [blame] | 18 | 'no-extra-boolean-cast': 'error', |
dpapad | ff82d51 | 2017-05-25 18:40:15 | [diff] [blame] | 19 | 'no-extra-semi': 'error', |
dpapad | 728cff0c | 2017-06-01 01:06:42 | [diff] [blame] | 20 | 'no-new-wrappers': 'error', |
Christopher Lam | a5f2ad0 | 2018-12-05 10:05:58 | [diff] [blame] | 21 | 'no-restricted-properties': [ |
| 22 | 'error', |
| 23 | { |
| 24 | 'object': 'document', |
| 25 | 'property': 'getElementById', |
| 26 | 'message': 'Use $(\'id\') or getSVGElement(\'id\') ' + |
| 27 | 'from chrome://resources/js/util.js instead of ' + |
| 28 | 'document.getElementById(\'id\')', |
dpapad | 2674f928 | 2017-05-31 19:40:39 | [diff] [blame] | 29 | }, |
| 30 | ], |
dpapad | 1e511b1 | 2017-05-31 03:31:26 | [diff] [blame] | 31 | 'semi': ['error', 'always'], |
dpapad | 2674f928 | 2017-05-31 19:40:39 | [diff] [blame] | 32 | |
dpapad | ff82d51 | 2017-05-25 18:40:15 | [diff] [blame] | 33 | // TODO(dpapad): Add more checks according to our styleguide. |
| 34 | }, |
| 35 | }; |