@disid/eslint-plugin 0.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,246 @@
1
+ import tsEsLint from 'typescript-eslint';
2
+ import patterns from '../patterns/index.js';
3
+ import angularESLintPlugin from '@angular-eslint/eslint-plugin';
4
+ import globals from 'globals';
5
+ import path from 'path';
6
+ /** @type { import("eslint").Linter.Config[] } */
7
+ export default [
8
+ {
9
+ files: [patterns.tsPattern],
10
+ plugins: {
11
+ '@angular-eslint': angularESLintPlugin.configs.recommended.plugins,
12
+ },
13
+ languageOptions: {
14
+ parser: tsEsLint.parser,
15
+ parserOptions: {
16
+ project: [path.resolve(import.meta.dirname, './tsconfig.json')],
17
+ tsconfigRootDir: import.meta.dirname,
18
+ sourceType: 'module',
19
+ },
20
+ ecmaVersion: 2022,
21
+ sourceType: 'module',
22
+ globals: {
23
+ ...globals.browser,
24
+ ...globals.node,
25
+ },
26
+ },
27
+ rules: {
28
+ ...tsEsLint.configs.recommended,
29
+ 'deprecation/deprecation': 'warn',
30
+ 'import/order': [
31
+ 'warn',
32
+ {
33
+ alphabetize: { order: 'asc', caseInsensitive: false },
34
+ 'newlines-between': 'always',
35
+ groups: [
36
+ 'external',
37
+ 'builtin',
38
+ 'internal',
39
+ ['parent', 'sibling', 'index'],
40
+ ],
41
+ pathGroups: [
42
+ {
43
+ pattern: '{@angular/**,rxjs,rxjs/operators}',
44
+ group: 'external',
45
+ position: 'before',
46
+ },
47
+ { pattern: '@disid/**', group: 'internal', position: 'before' },
48
+ ],
49
+ pathGroupsExcludedImportTypes: [],
50
+ },
51
+ ],
52
+ '@typescript-eslint/no-dynamic-delete': 'error',
53
+ '@typescript-eslint/no-invalid-void-type': 'error',
54
+ 'no-useless-constructor': 'off',
55
+ '@typescript-eslint/no-useless-constructor': 'error',
56
+ '@typescript-eslint/prefer-ts-expect-error': 'error',
57
+ '@typescript-eslint/prefer-literal-enum-member': 'error',
58
+ '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
59
+ '@typescript-eslint/no-floating-promises': 'error',
60
+ '@typescript-eslint/explicit-member-accessibility': 'off',
61
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
62
+ '@typescript-eslint/ban-types': [
63
+ 'error',
64
+ {
65
+ types: {
66
+ DisidSafeAny: {
67
+ message: 'Avoid using the `DisidSafeAny` type. Did you mean `any`?',
68
+ },
69
+ Object: {
70
+ message: 'Avoid using the `Object` type. Did you mean `object`?',
71
+ },
72
+ Function: {
73
+ message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
74
+ },
75
+ Boolean: {
76
+ message: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
77
+ },
78
+ Number: {
79
+ message: 'Avoid using the `Number` type. Did you mean `number`?',
80
+ },
81
+ String: {
82
+ message: 'Avoid using the `String` type. Did you mean `string`?',
83
+ },
84
+ Symbol: {
85
+ message: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
86
+ },
87
+ },
88
+ },
89
+ ],
90
+ '@typescript-eslint/consistent-type-assertions': 'error',
91
+ '@typescript-eslint/dot-notation': 'error',
92
+ '@typescript-eslint/naming-convention': [
93
+ 'error',
94
+ {
95
+ selector: 'default',
96
+ format: ['camelCase'],
97
+ leadingUnderscore: 'allow',
98
+ trailingUnderscore: 'allow',
99
+ },
100
+ {
101
+ selector: 'variable',
102
+ format: ['camelCase', 'UPPER_CASE', 'snake_case'],
103
+ leadingUnderscore: 'allow',
104
+ trailingUnderscore: 'allow',
105
+ },
106
+ {
107
+ selector: 'typeLike',
108
+ format: ['PascalCase'],
109
+ },
110
+ {
111
+ selector: 'enumMember',
112
+ format: ['UPPER_CASE', 'PascalCase'],
113
+ },
114
+ ],
115
+ '@typescript-eslint/no-empty-function': 'off',
116
+ '@typescript-eslint/no-empty-interface': 'error',
117
+ '@typescript-eslint/no-misused-new': 'error',
118
+ '@typescript-eslint/no-namespace': 'error',
119
+ '@typescript-eslint/no-non-null-assertion': 'error',
120
+ '@typescript-eslint/no-unused-expressions': 'off',
121
+ '@typescript-eslint/no-use-before-define': 'off',
122
+ '@typescript-eslint/no-var-requires': 'off',
123
+ '@typescript-eslint/prefer-for-of': 'error',
124
+ '@typescript-eslint/prefer-function-type': 'error',
125
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
126
+ '@typescript-eslint/triple-slash-reference': [
127
+ 'error',
128
+ { path: 'always', types: 'prefer-import', lib: 'always' },
129
+ ],
130
+ '@typescript-eslint/unified-signatures': 'error',
131
+ '@typescript-eslint/no-shadow': ['error', { hoist: 'all' }],
132
+ '@typescript-eslint/member-ordering': [
133
+ 'error',
134
+ {
135
+ default: [
136
+ 'signature',
137
+ 'call-signature',
138
+ 'public-static-field',
139
+ 'protected-static-field',
140
+ 'private-static-field',
141
+ '#private-static-field',
142
+ 'static-field',
143
+ 'public-instance-field',
144
+ 'public-abstract-field',
145
+ 'protected-instance-field',
146
+ 'protected-abstract-field',
147
+ 'private-instance-field',
148
+ '#private-instance-field',
149
+ 'instance-field',
150
+ 'public-field',
151
+ 'protected-field',
152
+ 'private-field',
153
+ '#private-field',
154
+ 'field',
155
+ 'abstract-field',
156
+ 'public-decorated-field',
157
+ 'protected-decorated-field',
158
+ 'private-decorated-field',
159
+ 'decorated-field',
160
+ 'public-decorated-method',
161
+ 'protected-decorated-method',
162
+ 'private-decorated-method',
163
+ 'decorated-method',
164
+ 'static-initialization',
165
+ 'public-constructor',
166
+ 'protected-constructor',
167
+ 'private-constructor',
168
+ 'constructor',
169
+ 'public-static-method',
170
+ 'protected-static-method',
171
+ 'private-static-method',
172
+ '#private-static-method',
173
+ 'static-method',
174
+ 'public-instance-method',
175
+ 'public-abstract-method',
176
+ 'protected-instance-method',
177
+ 'protected-abstract-method',
178
+ 'private-instance-method',
179
+ '#private-instance-method',
180
+ 'instance-method',
181
+ 'abstract-method',
182
+ 'public-method',
183
+ 'protected-method',
184
+ 'private-method',
185
+ '#private-method',
186
+ 'method',
187
+ ],
188
+ },
189
+ ],
190
+ '@typescript-eslint/array-type': 'error',
191
+ '@typescript-eslint/no-explicit-any': ['error', { ignoreRestArgs: true }],
192
+ '@typescript-eslint/no-inferrable-types': 'off',
193
+ '@typescript-eslint/no-unused-vars': 'warn',
194
+ '@typescript-eslint/no-dupe-class-members': ['error'],
195
+ '@typescript-eslint/quotes': 0,
196
+ '@typescript-eslint/brace-style': 'off',
197
+ '@typescript-eslint/comma-dangle': 'off',
198
+ '@typescript-eslint/comma-spacing': 'off',
199
+ '@typescript-eslint/func-call-spacing': 'off',
200
+ '@typescript-eslint/indent': 'off',
201
+ '@typescript-eslint/keyword-spacing': 'off',
202
+ '@typescript-eslint/member-delimiter-style': 'off',
203
+ '@typescript-eslint/no-extra-parens': 'off',
204
+ '@typescript-eslint/no-extra-semi': 'off',
205
+ '@typescript-eslint/object-curly-spacing': 'off',
206
+ '@typescript-eslint/semi': 'off',
207
+ '@typescript-eslint/space-before-function-paren': 'off',
208
+ '@typescript-eslint/space-infix-ops': 'off',
209
+ '@typescript-eslint/type-annotation-spacing': 'off',
210
+ '@typescript-eslint/explicit-function-return-type': 'off',
211
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
212
+ '@angular-eslint/sort-lifecycle-methods': 'error',
213
+ '@angular-eslint/component-class-suffix': 'warn',
214
+ '@angular-eslint/component-selector': [
215
+ 'error',
216
+ {
217
+ type: ['element', 'attribute'],
218
+ prefix: 'app',
219
+ style: 'kebab-case',
220
+ },
221
+ ],
222
+ '@angular-eslint/contextual-lifecycle': 'error',
223
+ '@angular-eslint/directive-class-suffix': 'warn',
224
+ '@angular-eslint/no-conflicting-lifecycle': 'error',
225
+ '@angular-eslint/no-host-metadata-property': 'error',
226
+ '@angular-eslint/no-input-rename': 'warn',
227
+ '@angular-eslint/no-inputs-metadata-property': 'error',
228
+ '@angular-eslint/no-output-native': 'error',
229
+ '@angular-eslint/no-output-on-prefix': 'error',
230
+ '@angular-eslint/no-output-rename': 'warn',
231
+ '@angular-eslint/no-outputs-metadata-property': 'error',
232
+ '@angular-eslint/use-lifecycle-interface': 'error',
233
+ '@angular-eslint/use-pipe-transform-interface': 'error',
234
+ '@angular-eslint/no-empty-lifecycle-method': 'error',
235
+ '@angular-eslint/directive-selector': [
236
+ 'error',
237
+ {
238
+ type: 'attribute',
239
+ prefix: 'app',
240
+ style: 'camelCase',
241
+ },
242
+ ],
243
+ },
244
+ },
245
+ ];
246
+ //# sourceMappingURL=ts.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ts.config.js","sourceRoot":"","sources":["../../../../../libs/eslint-plugin/configs/ts.config.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,mBAAmB,MAAM,+BAA+B,CAAC;AAChE,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,iDAAiD;AACjD,eAAe;IACb;QACE,KAAK,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC3B,OAAO,EAAE;YACP,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO;SACnE;QACD,eAAe,EAAE;YACf,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,aAAa,EAAE;gBACb,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;gBAC/D,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO;gBACpC,UAAU,EAAE,QAAQ;aACrB;YACD,WAAW,EAAE,IAAI;YACjB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE;gBACP,GAAG,OAAO,CAAC,OAAO;gBAClB,GAAG,OAAO,CAAC,IAAI;aAChB;SACF;QACD,KAAK,EAAE;YACL,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW;YAC/B,yBAAyB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