eslint-config-angular-strict 2.3.79 → 2.3.81

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.
Files changed (3) hide show
  1. package/index.js +48 -0
  2. package/logo.svg +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -47,6 +47,12 @@ export default [
47
47
  'no-fallthrough': 'off',
48
48
  'no-param-reassign': ['error', { props: false }],
49
49
  'no-plusplus': 'off',
50
+ 'no-restricted-syntax': [
51
+ 'error',
52
+ { selector: 'TSEnumDeclaration', message: 'Enums must live in enums.ts or *.enum.ts files' },
53
+ { selector: 'TSInterfaceDeclaration', message: 'Interfaces must live in *.interface.ts files' },
54
+ { selector: 'TSTypeAliasDeclaration', message: 'Types must live in types.ts or *.type.ts files' },
55
+ ],
50
56
  'no-return-assign': 'off',
51
57
  'no-underscore-dangle': ['error', { allowAfterThis: true }],
52
58
  'radix': ['error', 'as-needed'],
@@ -294,4 +300,46 @@ export default [
294
300
  'unicorn/template-indent': 'off',
295
301
  },
296
302
  },
303
+
304
+ // *.interface.ts: only interfaces allowed
305
+ {
306
+ files: ['**/*.interface.ts'],
307
+ rules: {
308
+ 'no-restricted-syntax': [
309
+ 'error',
310
+ {
311
+ selector: 'Program > :not(ImportDeclaration, TSInterfaceDeclaration, ExportNamedDeclaration:has(> TSInterfaceDeclaration))',
312
+ message: 'Only interfaces allowed in *.interface.ts',
313
+ },
314
+ ],
315
+ },
316
+ },
317
+
318
+ // enums.ts / *.enum.ts: only enums allowed
319
+ {
320
+ files: ['**/enums.ts', '**/*.enum.ts'],
321
+ rules: {
322
+ 'no-restricted-syntax': [
323
+ 'error',
324
+ {
325
+ selector: 'Program > :not(ImportDeclaration, TSEnumDeclaration, ExportNamedDeclaration:has(> TSEnumDeclaration))',
326
+ message: 'Only enums allowed in enums.ts / *.enum.ts',
327
+ },
328
+ ],
329
+ },
330
+ },
331
+
332
+ // types.ts / *.type.ts: only type aliases allowed
333
+ {
334
+ files: ['**/types.ts', '**/*.type.ts'],
335
+ rules: {
336
+ 'no-restricted-syntax': [
337
+ 'error',
338
+ {
339
+ selector: 'Program > :not(ImportDeclaration, TSTypeAliasDeclaration, ExportNamedDeclaration:has(> TSTypeAliasDeclaration))',
340
+ message: 'Only type aliases allowed in types.ts / *.type.ts',
341
+ },
342
+ ],
343
+ },
344
+ },
297
345
  ];
package/logo.svg CHANGED
@@ -1 +1 @@
1
- <svg height="200" viewBox="0 0 200 200" width="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" x1="0%" x2="100%" y1="0%" y2="100%"><stop offset="0" stop-color="#dd0031"/><stop offset="1" stop-color="#c3002f"/></linearGradient><linearGradient id="b" x1="0%" x2="100%" y1="0%" y2="100%"><stop offset="0" stop-color="#4b32c3"/><stop offset="1" stop-color="#3b28a3"/></linearGradient><circle cx="100" cy="100" fill="url(#a)" r="95"/><path d="m100 25 60 25-5 75-55 50-55-50-5-75z" fill="#fff" opacity=".95"/><path d="m100 45 30 20v40l-30 20-30-20v-40z" fill="url(#b)"/><path d="m100 55-15 40h10l3-7h4l3 7h10zm-4 23 4-10 4 10z" fill="#fff"/><g fill="url(#b)"><rect height="3" rx="1.5" width="50" x="75" y="135"/><rect height="2" rx="1" width="40" x="80" y="142"/><rect height="2" rx="1" width="30" x="85" y="148"/></g></svg>
1
+ <svg height="190" viewBox="5 5 190 190" width="190" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" x1="0%" x2="100%" y1="0%" y2="100%"><stop offset="0" stop-color="#dd0031"/><stop offset="1" stop-color="#c3002f"/></linearGradient><linearGradient id="b" x1="0%" x2="100%" y1="0%" y2="100%"><stop offset="0" stop-color="#4b32c3"/><stop offset="1" stop-color="#3b28a3"/></linearGradient><circle cx="100" cy="100" fill="url(#a)" r="95"/><path d="m100 25 60 25-5 75-55 50-55-50-5-75z" fill="#fff" opacity=".95"/><path d="m100 45 30 20v40l-30 20-30-20v-40z" fill="url(#b)"/><path d="m100 55-15 40h10l3-7h4l3 7h10zm-4 23 4-10 4 10z" fill="#fff"/><g fill="url(#b)"><rect height="3" rx="1.5" width="50" x="75" y="135"/><rect height="2" rx="1" width="40" x="80" y="142"/><rect height="2" rx="1" width="30" x="85" y="148"/></g></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-angular-strict",
3
- "version": "2.3.79",
3
+ "version": "2.3.81",
4
4
  "description": "Modern ESLint configuration with strict rules for Angular development.",
5
5
  "keywords": [
6
6
  "angular",