forked from vmware-clarity/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
61 lines (59 loc) · 1.88 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
const bannedTSTypes = {
Array: 'Use [] instead.',
Object: 'Use {} instead.',
Boolean: 'Use `boolean` instead.',
Number: 'Use `number` instead.',
String: 'Use `string` instead.',
};
module.exports = {
env: {
browser: true,
es6: true,
node: true,
jasmine: true,
},
extends: ['eslint:recommended', 'plugin:json/recommended-with-comments', 'prettier'],
parserOptions: {
ecmaVersion: 2020,
},
plugins: ['license-header'],
rules: {
curly: 'error',
eqeqeq: 'error',
'no-var': 'error',
'no-irregular-whitespace': ['error', { skipTemplates: true }],
'license-header/header': ['error', './.license-header.js'],
},
overrides: [
{
files: ['**/*.ts'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['@typescript-eslint', 'jasmine', 'license-header', 'unused-imports'],
rules: {
'@typescript-eslint/ban-types': ['error', { types: bannedTSTypes }],
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
'@typescript-eslint/no-explicit-any': 'off', // Would LOVE to turn this on
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-var-requires': 'error',
curly: 'error',
eqeqeq: 'error',
'jasmine/no-focused-tests': 'error',
'no-irregular-whitespace': ['error', { skipTemplates: true }],
'unused-imports/no-unused-imports-ts': 'error',
},
},
{
files: ['**/*.json'],
rules: {
'license-header/header': 'off',
},
},
],
root: true,
};