UNPKG

1.33 kBJavaScriptView Raw
1// Copyright 2021 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
5const path = require('path');
6const rulesDirPlugin = require('eslint-plugin-rulesdir');
7rulesDirPlugin.RULES_DIR = path.join(__dirname, '..', 'scripts', 'eslint_rules', 'lib');
8
9module.exports = {
10 'overrides': [{
11 'files': ['*.ts'],
12 'rules': {
13 '@typescript-eslint/naming-convention': [
14 'error', {
15 'selector': ['function', 'variable', 'accessor', 'method', 'property', 'parameterProperty'],
16 'format': ['camelCase'],
17 },
18 {
19 // Allow camelCase and UPPER_CASE for constants.
20 'selector': 'variable',
21 'modifiers': ['const'],
22 'format': ['camelCase', 'UPPER_CASE'],
23 },
24 {
25 'selector': 'classProperty',
26 'modifiers': ['static', 'readonly'],
27 'format': ['UPPER_CASE'],
28 },
29 {
30 'selector': 'enumMember',
31 'format': ['PascalCase', 'UPPER_CASE'],
32 },
33 {
34 'selector': ['typeLike'],
35 'format': ['PascalCase'],
36 },
37 {
38 'selector': 'parameter',
39 'format': ['camelCase'],
40 'leadingUnderscore': 'allow',
41 }
42 ]
43 }
44 }]
45};