-
Notifications
You must be signed in to change notification settings - Fork 78
/
.eslintrc.js
103 lines (100 loc) · 3.03 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
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
* 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,
ecmaVersion: 9,
},
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',
'ng-clarity-eslint-rules',
],
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',
'@typescript-eslint/parameter-properties': ['error', { prefer: 'parameter-property' }],
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',
// custom eslint-rules
'ng-clarity-eslint-rules/no-parameter-property-this-in-constructor': 'error',
},
},
{
files: ['**/*.json'],
rules: {
'license-header/header': 'off',
},
},
],
};