[go: nahoru, domu]

blob: 7b88ee1db6691acf1f40dbf703ef9306a30d9ad2 [file] [log] [blame]
dpapadff82d512017-05-25 18:40:151// 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
5module.exports = {
6 'root': true,
7 'env': {
8 'browser': true,
dpapada06173092020-10-17 03:06:169 'es2020': true,
Christopher Lama5f2ad02018-12-05 10:05:5810 },
11 'parserOptions': {
dpapada06173092020-10-17 03:06:1612 'ecmaVersion': 2020,
dpapad12b3c472019-05-29 02:16:0513 'sourceType': 'module',
dpapadff82d512017-05-25 18:40:1514 },
15 'rules': {
16 // Enabled checks.
Dan Beam1a0d9dcb2019-01-08 09:05:3517 'brace-style': ['error', '1tbs'],
18 'curly': ['error', 'multi-line', 'consistent'],
Dan Beamb1536652019-02-26 07:36:2519 'no-extra-boolean-cast': 'error',
dpapadff82d512017-05-25 18:40:1520 'no-extra-semi': 'error',
dpapad728cff02017-06-01 01:06:4221 'no-new-wrappers': 'error',
Christopher Lama5f2ad02018-12-05 10:05:5822 'no-restricted-properties': [
23 'error',
24 {
25 'object': 'document',
26 'property': 'getElementById',
27 'message': 'Use $(\'id\') or getSVGElement(\'id\') ' +
28 'from chrome://resources/js/util.js instead of ' +
29 'document.getElementById(\'id\')',
dpapad2674f9282017-05-31 19:40:3930 },
dpapad7b493a42019-06-22 02:07:0931 {
32 'property': '__lookupGetter__',
33 'message': 'Use Object.getOwnPropertyDescriptor',
34 },
35 {
36 'property': '__lookupSetter__',
37 'message': 'Use Object.getOwnPropertyDescriptor',
38 },
39 {
40 'property': '__defineGetter__',
41 'message': 'Use Object.defineProperty',
42 },
43 {
44 'property': '__defineSetter__',
45 'message': 'Use Object.defineProperty',
46 },
Dan Beam1aa00a122020-01-16 00:40:4147 {
48 'object': 'cr',
49 'property': 'exportPath',
50 'message': 'Use ES modules or cr.define() instead',
51 },
dpapad2674f9282017-05-31 19:40:3952 ],
Demetrios Papadopouloscf870bde2019-11-26 19:14:3453 'no-var': 'error',
54 'prefer-const': 'error',
dpapad1e511b12017-05-31 03:31:2655 'semi': ['error', 'always'],
dpapad2674f9282017-05-31 19:40:3956
dpapadff82d512017-05-25 18:40:1557 // TODO(dpapad): Add more checks according to our styleguide.
58 },
dpapadac97d7b62021-06-14 07:20:2659
60 'overrides': [{
61 'files': ['**/*.ts'],
62 'parser': './third_party/node/node_modules/@typescript-eslint/parser',
63 }]
dpapadff82d512017-05-25 18:40:1564};