forked from vmware-clarity/ng-clarity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
90 lines (88 loc) · 2.65 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* 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 memberOrderingConfig = require('./.eslintrc-member-ordering');
module.exports = {
env: {
browser: true,
es6: true,
node: true,
jasmine: true,
},
extends: ['eslint:recommended', 'plugin:json/recommended-with-comments', 'prettier'],
parserOptions: {
sourceType: 'module',
allowImportExportEverywhere: true,
},
plugins: ['import', '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: ['license-header', '@typescript-eslint', 'jasmine', 'unused-imports', 'decorator-position'],
rules: {
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'no-public',
},
],
'@typescript-eslint/member-ordering': ['error', memberOrderingConfig],
'@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',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-var-requires': 'error',
curly: 'error',
'decorator-position/decorator-position': 'error',
eqeqeq: 'error',
'grouped-accessor-pairs': ['error', 'getBeforeSet'],
'import/no-absolute-path': ['error'],
'import/no-useless-path-segments': ['error'],
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
groups: [
['builtin', 'external'],
['parent', 'sibling'],
],
'newlines-between': 'always',
},
],
'jasmine/no-focused-tests': 'error',
'no-irregular-whitespace': ['error', { skipTemplates: true }],
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
'unused-imports/no-unused-imports-ts': 'error',
},
},
{
files: ['**/*.json'],
rules: {
'license-header/header': 'off',
},
},
],
};