@teambit/linter 1.0.330 → 1.0.332

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.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.defender/linter@1.0.330" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.defender/linter@1.0.332" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.defender/linter-preview"]=n():e["teambit.defender/linter-preview"]=n()}(self,(()=>(()=>{"use strict";var e={37150:(e,n,t)=>{Object.defineProperty(n,"Ay",{enumerable:!0,get:function(){return r.default}});var r=o(t(78485));function o(e){return e&&e.__esModule?e:{default:e}}o.__bit_component={id:"teambit.defender/content/linter-overview@1.95.0",homepage:"https://bit.dev/teambit/defender/content/linter-overview",exported:!0}},78485:(e,n,t)=>{var r={id:"teambit.defender/content/linter-overview@1.95.0",homepage:"https://bit.dev/teambit/defender/content/linter-overview",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=c,p(t(41594));var o=t(5016),i=t(65682),a=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},l.apply(this,arguments)}function d(e,n){if(null==e)return{};var t,r,o=s(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function s(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}p.__bit_component=r,l.__bit_component=r,d.__bit_component=r,s.__bit_component=r;var m={},u="wrapper";function c(e){var n=e.components,t=d(e,a);return(0,o.mdx)(u,l({},m,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,o.mdx)("h1",null,"Overview"),(0,o.mdx)("p",null,"Linting helps us maintain consistent code styling and avoid potential bugs by analyzing our source code, statically, before it is compiled and executed."),(0,o.mdx)("p",null,"The Linter aspect simplifies and standardizes the process of component linting. It does so for linting during development (in the workspace) and for linting during component build (in a capsule, as part of the ",(0,o.mdx)("a",{parentName:"p",href:"/builder/build-pipelines"},"Build Pipeline"),")"),(0,o.mdx)("h2",null,"Linting in development"),(0,o.mdx)("p",null,"Bit lints all components in the ",(0,o.mdx)("a",{parentName:"p",href:"/workspace/overview"},"Workspace")," using just a single command. That is true for components of all types, regardless of their specific ",(0,o.mdx)("a",{parentName:"p",href:"/envs/overview"},"Env"),", and as a consequence of that, their specific Linter implementation"," and configuration."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit lint\n")),(0,o.mdx)("p",null,"To learn more on linting during development, please refer to ",(0,o.mdx)("a",{parentName:"p",href:"/linter/workspace-linting"},"Workspace Linting"),"."),(0,o.mdx)("h2",null,"Linting during build"),(0,o.mdx)("p",null,"During build, the lint task is only used for checking linting issues. it will not re-write the components with the auto fix option."),(0,o.mdx)("p",null,"Testing components for distribution is done during ",(0,o.mdx)("inlineCode",{parentName:"p"},"build")," by the Bit ",(0,o.mdx)("a",{parentName:"p",href:"/builder/overview"},"Builder"),"."),(0,o.mdx)("p",null,"Component build can be simulated with ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit build")," and done through ",(0,o.mdx)("a",{parentName:"p",href:"/components/tags"},"Tag")," or ",(0,o.mdx)("a",{parentName:"p",href:"/components/snaps"},"Snap")),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit build\n")),(0,o.mdx)("p",null,"By default, linting is ",(0,o.mdx)("strong",{parentName:"p"},"not")," part of the ",(0,o.mdx)("a",{parentName:"p",href:"/builder/build-pipelines"},"Build Pipeline"),"."),(0,o.mdx)("h2",null,"Configuring and implementing Linters"),(0,o.mdx)("p",null,"The Linter implementation"," is configured in the ",(0,o.mdx)("a",{parentName:"p",href:"/envs/overview"},"Env")," which is configured on your ",(0,o.mdx)("a",{parentName:"p",href:"/components/overview"},"Component"),". Customizing it can be done by ",(0,o.mdx)("a",{parentName:"p",href:"/"},"customizing an existing env with your linter")," or by ",(0,o.mdx)("a",{parentName:"p",href:"/envs/customizing-env"},"implementing your own Env"),"."),(0,o.mdx)("p",null,"Linter can also be implemented into Bit through few interfaces. ")))}c.__bit_component=r,c.isMDXComponent=!0},92265:(e,n,t)=>{var r={id:"teambit.defender/linter@1.0.330",homepage:"https://bit.cloud/teambit/defender/linter",exported:!0};function o(){const e=i(t(41594));return o=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,o.__bit_component=r,i.__bit_component=r;const a=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/linter.svg"}));a.__bit_component=r,n.Logo=a},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};t.r(r),t.d(r,{compositions:()=>f,compositions_metadata:()=>b,overview:()=>v});var o={};t.r(o),t.d(o,{default:()=>c});var i=t(92265),a=(t(41594),t(5016)),p=t(65682),l=t(37150),d=["components"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s.apply(null,arguments)}var m={},u="wrapper";function c(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,d);return(0,a.mdx)(u,s({},m,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)(p.MDXScopeProvider,{components:{LinterOverview:l.Ay},mdxType:"MDXScopeProvider"},(0,a.mdx)(l.Ay,{mdxType:"LinterOverview"})))}c.isMDXComponent=!0;const f=[i],v=[o],b={compositions:[{displayName:"Logo",identifier:"Logo"}]};return r})()));
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.defender/linter-preview"]=n():e["teambit.defender/linter-preview"]=n()}(self,(()=>(()=>{"use strict";var e={212:(e,n,t)=>{Object.defineProperty(n,"Ay",{enumerable:!0,get:function(){return r.default}});var r=o(t(40783));function o(e){return e&&e.__esModule?e:{default:e}}o.__bit_component={id:"teambit.defender/content/linter-overview@1.95.0",homepage:"https://bit.dev/teambit/defender/content/linter-overview",exported:!0}},40783:(e,n,t)=>{var r={id:"teambit.defender/content/linter-overview@1.95.0",homepage:"https://bit.dev/teambit/defender/content/linter-overview",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=c,p(t(41594));var o=t(5016),i=t(65682),a=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},l.apply(this,arguments)}function d(e,n){if(null==e)return{};var t,r,o=s(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function s(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}p.__bit_component=r,l.__bit_component=r,d.__bit_component=r,s.__bit_component=r;var m={},u="wrapper";function c(e){var n=e.components,t=d(e,a);return(0,o.mdx)(u,l({},m,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,o.mdx)("h1",null,"Overview"),(0,o.mdx)("p",null,"Linting helps us maintain consistent code styling and avoid potential bugs by analyzing our source code, statically, before it is compiled and executed."),(0,o.mdx)("p",null,"The Linter aspect simplifies and standardizes the process of component linting. It does so for linting during development (in the workspace) and for linting during component build (in a capsule, as part of the ",(0,o.mdx)("a",{parentName:"p",href:"/builder/build-pipelines"},"Build Pipeline"),")"),(0,o.mdx)("h2",null,"Linting in development"),(0,o.mdx)("p",null,"Bit lints all components in the ",(0,o.mdx)("a",{parentName:"p",href:"/workspace/overview"},"Workspace")," using just a single command. That is true for components of all types, regardless of their specific ",(0,o.mdx)("a",{parentName:"p",href:"/envs/overview"},"Env"),", and as a consequence of that, their specific Linter implementation"," and configuration."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit lint\n")),(0,o.mdx)("p",null,"To learn more on linting during development, please refer to ",(0,o.mdx)("a",{parentName:"p",href:"/linter/workspace-linting"},"Workspace Linting"),"."),(0,o.mdx)("h2",null,"Linting during build"),(0,o.mdx)("p",null,"During build, the lint task is only used for checking linting issues. it will not re-write the components with the auto fix option."),(0,o.mdx)("p",null,"Testing components for distribution is done during ",(0,o.mdx)("inlineCode",{parentName:"p"},"build")," by the Bit ",(0,o.mdx)("a",{parentName:"p",href:"/builder/overview"},"Builder"),"."),(0,o.mdx)("p",null,"Component build can be simulated with ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit build")," and done through ",(0,o.mdx)("a",{parentName:"p",href:"/components/tags"},"Tag")," or ",(0,o.mdx)("a",{parentName:"p",href:"/components/snaps"},"Snap")),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit build\n")),(0,o.mdx)("p",null,"By default, linting is ",(0,o.mdx)("strong",{parentName:"p"},"not")," part of the ",(0,o.mdx)("a",{parentName:"p",href:"/builder/build-pipelines"},"Build Pipeline"),"."),(0,o.mdx)("h2",null,"Configuring and implementing Linters"),(0,o.mdx)("p",null,"The Linter implementation"," is configured in the ",(0,o.mdx)("a",{parentName:"p",href:"/envs/overview"},"Env")," which is configured on your ",(0,o.mdx)("a",{parentName:"p",href:"/components/overview"},"Component"),". Customizing it can be done by ",(0,o.mdx)("a",{parentName:"p",href:"/"},"customizing an existing env with your linter")," or by ",(0,o.mdx)("a",{parentName:"p",href:"/envs/customizing-env"},"implementing your own Env"),"."),(0,o.mdx)("p",null,"Linter can also be implemented into Bit through few interfaces. ")))}c.__bit_component=r,c.isMDXComponent=!0},84861:(e,n,t)=>{var r={id:"teambit.defender/linter@1.0.332",homepage:"https://bit.cloud/teambit/defender/linter",exported:!0};function o(){const e=i(t(41594));return o=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,o.__bit_component=r,i.__bit_component=r;const a=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/linter.svg"}));a.__bit_component=r,n.Logo=a},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};t.r(r),t.d(r,{compositions:()=>f,compositions_metadata:()=>b,overview:()=>v});var o={};t.r(o),t.d(o,{default:()=>c});var i=t(84861),a=(t(41594),t(5016)),p=t(65682),l=t(212),d=["components"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s.apply(null,arguments)}var m={},u="wrapper";function c(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,d);return(0,a.mdx)(u,s({},m,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)(p.MDXScopeProvider,{components:{LinterOverview:l.Ay},mdxType:"MDXScopeProvider"},(0,a.mdx)(l.Ay,{mdxType:"LinterOverview"})))}c.isMDXComponent=!0;const f=[i],v=[o],b={compositions:[{displayName:"Logo",identifier:"Logo"}]};return r})()));
@@ -112,11 +112,7 @@
112
112
  "line": 24,
113
113
  "character": 29
114
114
  },
115
- "name": "EnvsMain",
116
- "componentId": {
117
- "scope": "teambit.envs",
118
- "name": "envs"
119
- }
115
+ "name": "EnvsMain"
120
116
  },
121
117
  "isOptional": false,
122
118
  "isSpread": false
@@ -136,8 +132,7 @@
136
132
  "line": 24,
137
133
  "character": 62
138
134
  },
139
- "name": "LinterService",
140
- "internalFilePath": "linter.service.ts"
135
+ "name": "LinterService"
141
136
  },
142
137
  "isOptional": false,
143
138
  "isSpread": false
@@ -197,11 +192,7 @@
197
192
  "line": 29,
198
193
  "character": 26
199
194
  },
200
- "name": "Component",
201
- "componentId": {
202
- "scope": "teambit.component",
203
- "name": "component"
204
- }
195
+ "name": "Component"
205
196
  }
206
197
  },
207
198
  "isOptional": false,
@@ -266,11 +257,7 @@
266
257
  "line": 35,
267
258
  "character": 22
268
259
  },
269
- "name": "ExecutionContext",
270
- "componentId": {
271
- "scope": "teambit.envs",
272
- "name": "envs"
273
- }
260
+ "name": "ExecutionContext"
274
261
  },
275
262
  "isOptional": false,
276
263
  "isSpread": false
@@ -447,11 +434,7 @@
447
434
  "line": 55,
448
435
  "character": 55
449
436
  },
450
- "name": "EnvsMain",
451
- "componentId": {
452
- "scope": "teambit.envs",
453
- "name": "envs"
454
- }
437
+ "name": "EnvsMain"
455
438
  },
456
439
  {
457
440
  "__schema": "TypeRefSchema",
@@ -460,11 +443,7 @@
460
443
  "line": 55,
461
444
  "character": 65
462
445
  },
463
- "name": "CLIMain",
464
- "componentId": {
465
- "scope": "teambit.harmony",
466
- "name": "cli"
467
- }
446
+ "name": "CLIMain"
468
447
  },
469
448
  {
470
449
  "__schema": "TypeRefSchema",
@@ -473,11 +452,7 @@
473
452
  "line": 55,
474
453
  "character": 74
475
454
  },
476
- "name": "ComponentMain",
477
- "componentId": {
478
- "scope": "teambit.component",
479
- "name": "component"
480
- }
455
+ "name": "ComponentMain"
481
456
  },
482
457
  {
483
458
  "__schema": "TypeRefSchema",
@@ -486,11 +461,7 @@
486
461
  "line": 55,
487
462
  "character": 89
488
463
  },
489
- "name": "LoggerMain",
490
- "componentId": {
491
- "scope": "teambit.harmony",
492
- "name": "logger"
493
- }
464
+ "name": "LoggerMain"
494
465
  },
495
466
  {
496
467
  "__schema": "TypeRefSchema",
@@ -499,11 +470,7 @@
499
470
  "line": 55,
500
471
  "character": 101
501
472
  },
502
- "name": "Workspace",
503
- "componentId": {
504
- "scope": "teambit.workspace",
505
- "name": "workspace"
506
- }
473
+ "name": "Workspace"
507
474
  }
508
475
  ]
509
476
  },
@@ -630,8 +597,7 @@
630
597
  "line": 18,
631
598
  "character": 14
632
599
  },
633
- "name": "FixTypes",
634
- "internalFilePath": "linter-context.ts"
600
+ "name": "FixTypes"
635
601
  },
636
602
  "isOptional": true
637
603
  }
@@ -1093,11 +1059,7 @@
1093
1059
  "line": 165,
1094
1060
  "character": 47
1095
1061
  },
1096
- "name": "BuildContext",
1097
- "componentId": {
1098
- "scope": "teambit.pipelines",
1099
- "name": "builder"
1100
- }
1062
+ "name": "BuildContext"
1101
1063
  },
1102
1064
  "isOptional": true,
1103
1065
  "isSpread": false
@@ -1374,8 +1336,7 @@
1374
1336
  "line": 82,
1375
1337
  "character": 13
1376
1338
  },
1377
- "name": "LintMessage",
1378
- "internalFilePath": "linter.ts"
1339
+ "name": "LintMessage"
1379
1340
  }
1380
1341
  },
1381
1342
  "isOptional": false
@@ -1841,11 +1802,7 @@
1841
1802
  "line": 11,
1842
1803
  "character": 26
1843
1804
  },
1844
- "name": "BuildContext",
1845
- "componentId": {
1846
- "scope": "teambit.pipelines",
1847
- "name": "builder"
1848
- }
1805
+ "name": "BuildContext"
1849
1806
  },
1850
1807
  "isOptional": false,
1851
1808
  "isSpread": false
@@ -1867,11 +1824,7 @@
1867
1824
  "line": 11,
1868
1825
  "character": 49
1869
1826
  },
1870
- "name": "BuiltTaskResult",
1871
- "componentId": {
1872
- "scope": "teambit.pipelines",
1873
- "name": "builder"
1874
- }
1827
+ "name": "BuiltTaskResult"
1875
1828
  }
1876
1829
  ]
1877
1830
  },
@@ -1903,7 +1856,7 @@
1903
1856
  "_legacy": {
1904
1857
  "scope": "teambit.defender",
1905
1858
  "name": "linter",
1906
- "version": "1.0.330"
1859
+ "version": "1.0.332"
1907
1860
  },
1908
1861
  "_scope": "teambit.defender"
1909
1862
  }
@@ -2009,10 +1962,6 @@
2009
1962
  "character": 21
2010
1963
  },
2011
1964
  "name": "ComponentMap",
2012
- "componentId": {
2013
- "scope": "teambit.component",
2014
- "name": "component"
2015
- },
2016
1965
  "typeArgs": [
2017
1966
  {
2018
1967
  "__schema": "KeywordTypeSchema",
@@ -2050,7 +1999,7 @@
2050
1999
  "_legacy": {
2051
2000
  "scope": "teambit.defender",
2052
2001
  "name": "linter",
2053
- "version": "1.0.330"
2002
+ "version": "1.0.332"
2054
2003
  },
2055
2004
  "_scope": "teambit.defender"
2056
2005
  }
@@ -2163,8 +2112,7 @@
2163
2112
  "line": 21,
2164
2113
  "character": 14
2165
2114
  },
2166
- "name": "FixTypes",
2167
- "internalFilePath": "linter-context.ts"
2115
+ "name": "FixTypes"
2168
2116
  },
2169
2117
  "doc": {
2170
2118
  "__schema": "DocSchema",
@@ -2299,8 +2247,7 @@
2299
2247
  "line": 21,
2300
2248
  "character": 14
2301
2249
  },
2302
- "name": "FixTypes",
2303
- "internalFilePath": "linter-context.ts"
2250
+ "name": "FixTypes"
2304
2251
  },
2305
2252
  "isOptional": true
2306
2253
  }
@@ -2355,10 +2302,6 @@
2355
2302
  "character": 13
2356
2303
  },
2357
2304
  "name": "EnvHandler",
2358
- "componentId": {
2359
- "scope": "teambit.envs",
2360
- "name": "envs"
2361
- },
2362
2305
  "typeArgs": [
2363
2306
  {
2364
2307
  "__schema": "TypeRefSchema",
@@ -2508,8 +2451,7 @@
2508
2451
  "line": 18,
2509
2452
  "character": 14
2510
2453
  },
2511
- "name": "FixTypes",
2512
- "internalFilePath": "linter-context.ts"
2454
+ "name": "FixTypes"
2513
2455
  },
2514
2456
  "isOptional": true
2515
2457
  }
@@ -2572,11 +2514,7 @@
2572
2514
  "line": 24,
2573
2515
  "character": 29
2574
2516
  },
2575
- "name": "EnvsMain",
2576
- "componentId": {
2577
- "scope": "teambit.envs",
2578
- "name": "envs"
2579
- }
2517
+ "name": "EnvsMain"
2580
2518
  },
2581
2519
  "isOptional": false,
2582
2520
  "isSpread": false
@@ -2596,8 +2534,7 @@
2596
2534
  "line": 24,
2597
2535
  "character": 62
2598
2536
  },
2599
- "name": "LinterService",
2600
- "internalFilePath": "linter.service.ts"
2537
+ "name": "LinterService"
2601
2538
  },
2602
2539
  "isOptional": false,
2603
2540
  "isSpread": false
@@ -2657,11 +2594,7 @@
2657
2594
  "line": 29,
2658
2595
  "character": 26
2659
2596
  },
2660
- "name": "Component",
2661
- "componentId": {
2662
- "scope": "teambit.component",
2663
- "name": "component"
2664
- }
2597
+ "name": "Component"
2665
2598
  }
2666
2599
  },
2667
2600
  "isOptional": false,
@@ -2726,11 +2659,7 @@
2726
2659
  "line": 35,
2727
2660
  "character": 22
2728
2661
  },
2729
- "name": "ExecutionContext",
2730
- "componentId": {
2731
- "scope": "teambit.envs",
2732
- "name": "envs"
2733
- }
2662
+ "name": "ExecutionContext"
2734
2663
  },
2735
2664
  "isOptional": false,
2736
2665
  "isSpread": false
@@ -2907,11 +2836,7 @@
2907
2836
  "line": 55,
2908
2837
  "character": 55
2909
2838
  },
2910
- "name": "EnvsMain",
2911
- "componentId": {
2912
- "scope": "teambit.envs",
2913
- "name": "envs"
2914
- }
2839
+ "name": "EnvsMain"
2915
2840
  },
2916
2841
  {
2917
2842
  "__schema": "TypeRefSchema",
@@ -2920,11 +2845,7 @@
2920
2845
  "line": 55,
2921
2846
  "character": 65
2922
2847
  },
2923
- "name": "CLIMain",
2924
- "componentId": {
2925
- "scope": "teambit.harmony",
2926
- "name": "cli"
2927
- }
2848
+ "name": "CLIMain"
2928
2849
  },
2929
2850
  {
2930
2851
  "__schema": "TypeRefSchema",
@@ -2933,11 +2854,7 @@
2933
2854
  "line": 55,
2934
2855
  "character": 74
2935
2856
  },
2936
- "name": "ComponentMain",
2937
- "componentId": {
2938
- "scope": "teambit.component",
2939
- "name": "component"
2940
- }
2857
+ "name": "ComponentMain"
2941
2858
  },
2942
2859
  {
2943
2860
  "__schema": "TypeRefSchema",
@@ -2946,11 +2863,7 @@
2946
2863
  "line": 55,
2947
2864
  "character": 89
2948
2865
  },
2949
- "name": "LoggerMain",
2950
- "componentId": {
2951
- "scope": "teambit.harmony",
2952
- "name": "logger"
2953
- }
2866
+ "name": "LoggerMain"
2954
2867
  },
2955
2868
  {
2956
2869
  "__schema": "TypeRefSchema",
@@ -2959,11 +2872,7 @@
2959
2872
  "line": 55,
2960
2873
  "character": 101
2961
2874
  },
2962
- "name": "Workspace",
2963
- "componentId": {
2964
- "scope": "teambit.workspace",
2965
- "name": "workspace"
2966
- }
2875
+ "name": "Workspace"
2967
2876
  }
2968
2877
  ]
2969
2878
  },
@@ -3579,8 +3488,7 @@
3579
3488
  "line": 82,
3580
3489
  "character": 13
3581
3490
  },
3582
- "name": "LintMessage",
3583
- "internalFilePath": "linter.ts"
3491
+ "name": "LintMessage"
3584
3492
  }
3585
3493
  },
3586
3494
  "isOptional": false
@@ -4301,11 +4209,7 @@
4301
4209
  "line": 165,
4302
4210
  "character": 47
4303
4211
  },
4304
- "name": "BuildContext",
4305
- "componentId": {
4306
- "scope": "teambit.pipelines",
4307
- "name": "builder"
4308
- }
4212
+ "name": "BuildContext"
4309
4213
  },
4310
4214
  "isOptional": true,
4311
4215
  "isSpread": false
@@ -4445,11 +4349,7 @@
4445
4349
  "line": 11,
4446
4350
  "character": 26
4447
4351
  },
4448
- "name": "BuildContext",
4449
- "componentId": {
4450
- "scope": "teambit.pipelines",
4451
- "name": "builder"
4452
- }
4352
+ "name": "BuildContext"
4453
4353
  },
4454
4354
  "isOptional": false,
4455
4355
  "isSpread": false
@@ -4471,11 +4371,7 @@
4471
4371
  "line": 11,
4472
4372
  "character": 49
4473
4373
  },
4474
- "name": "BuiltTaskResult",
4475
- "componentId": {
4476
- "scope": "teambit.pipelines",
4477
- "name": "builder"
4478
- }
4374
+ "name": "BuiltTaskResult"
4479
4375
  }
4480
4376
  ]
4481
4377
  },
@@ -4507,7 +4403,7 @@
4507
4403
  "_legacy": {
4508
4404
  "scope": "teambit.defender",
4509
4405
  "name": "linter",
4510
- "version": "1.0.330"
4406
+ "version": "1.0.332"
4511
4407
  },
4512
4408
  "_scope": "teambit.defender"
4513
4409
  }
@@ -4598,8 +4494,7 @@
4598
4494
  "line": 5,
4599
4495
  "character": 30
4600
4496
  },
4601
- "name": "FixType",
4602
- "internalFilePath": "linter-context.ts"
4497
+ "name": "FixType"
4603
4498
  }
4604
4499
  ]
4605
4500
  }
@@ -4711,8 +4606,7 @@
4711
4606
  "line": 21,
4712
4607
  "character": 14
4713
4608
  },
4714
- "name": "FixTypes",
4715
- "internalFilePath": "linter-context.ts"
4609
+ "name": "FixTypes"
4716
4610
  },
4717
4611
  "isOptional": true
4718
4612
  }
@@ -4808,10 +4702,6 @@
4808
4702
  "character": 21
4809
4703
  },
4810
4704
  "name": "ComponentMap",
4811
- "componentId": {
4812
- "scope": "teambit.component",
4813
- "name": "component"
4814
- },
4815
4705
  "typeArgs": [
4816
4706
  {
4817
4707
  "__schema": "KeywordTypeSchema",
@@ -4849,7 +4739,7 @@
4849
4739
  "_legacy": {
4850
4740
  "scope": "teambit.defender",
4851
4741
  "name": "linter",
4852
- "version": "1.0.330"
4742
+ "version": "1.0.332"
4853
4743
  },
4854
4744
  "_scope": "teambit.defender"
4855
4745
  }
@@ -4962,8 +4852,7 @@
4962
4852
  "line": 21,
4963
4853
  "character": 14
4964
4854
  },
4965
- "name": "FixTypes",
4966
- "internalFilePath": "linter-context.ts"
4855
+ "name": "FixTypes"
4967
4856
  },
4968
4857
  "doc": {
4969
4858
  "__schema": "DocSchema",
@@ -5032,10 +4921,6 @@
5032
4921
  "character": 13
5033
4922
  },
5034
4923
  "name": "EnvHandler",
5035
- "componentId": {
5036
- "scope": "teambit.envs",
5037
- "name": "envs"
5038
- },
5039
4924
  "typeArgs": [
5040
4925
  {
5041
4926
  "__schema": "TypeRefSchema",
@@ -5060,7 +4945,7 @@
5060
4945
  "componentId": {
5061
4946
  "scope": "teambit.defender",
5062
4947
  "name": "linter",
5063
- "version": "1.0.330"
4948
+ "version": "1.0.332"
5064
4949
  },
5065
4950
  "taggedModuleExports": []
5066
4951
  }
@@ -1,4 +1,4 @@
1
- import { TimerResponse } from '@teambit/legacy/dist/toolbox/timer';
1
+ import { TimerResponse } from '@teambit/toolbox.time.timer';
2
2
  import { Command, CommandOptions } from '@teambit/cli';
3
3
  import { ComponentFactory, ComponentID } from '@teambit/component';
4
4
  import { Workspace } from '@teambit/workspace';
package/dist/lint.cmd.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.LintCmd = void 0;
7
- function _timer() {
8
- const data = require("@teambit/legacy/dist/toolbox/timer");
9
- _timer = function () {
7
+ function _toolboxTime() {
8
+ const data = require("@teambit/toolbox.time.timer");
9
+ _toolboxTime = function () {
10
10
  return data;
11
11
  };
12
12
  return data;
@@ -133,7 +133,7 @@ class LintCmd {
133
133
  return `total of ${_chalk().default.green(itemsCount.toString())} ${_chalk().default.cyan(fieldLabel)} (from ${_chalk().default.green(componentsCount.toString())} components)`;
134
134
  }
135
135
  async json([pattern], linterOptions) {
136
- const timer = _timer().Timer.create();
136
+ const timer = _toolboxTime().Timer.create();
137
137
  timer.start();
138
138
  const componentsIds = await this.getIdsToLint(pattern, linterOptions.changed);
139
139
  const componentsToLint = await this.workspace.getMany(componentsIds);
@@ -1 +1 @@
1
- {"version":3,"names":["_timer","data","require","_constants","_chalk","_interopRequireDefault","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LintCmd","constructor","linter","componentHost","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","linterOptions","code","json","lintResults","componentsIdsToLint","title","chalk","bold","cyan","length","toString","groupedByIsClean","groupBy","results","res","isClean","undefined","totalErrorCount","totalFatalErrorCount","totalWarningCount","dirtyComponentsOutputs","false","map","lintRes","compTitle","componentId","ignoreVersion","compOutput","output","join","cleanComponentsCount","true","cleanComponentsOutput","green","summary","getSummarySection","finalOutput","compact","duration","seconds","summaryTitle","totalFieldsMap","itemsDataField","componentsDataField","label","summaryTotals","item","renderTotalLine","filter","Boolean","componentsCount","itemsCount","fieldLabel","timer","Timer","create","start","componentsIds","getIdsToLint","changed","componentsToLint","getMany","opts","fix","fixTypes","fixType","split","linterResults","lint","jsonLinterResults","toJsonLintResults","timerResponse","stop","comp","id","idsByPattern","getNewAndModifiedIds","listIds","exports","totalFixableErrorCount","totalFixableWarningCount","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","newResults","resultsWithoutComponent","result","assign","component","omit","flatten","errors"],"sources":["lint.cmd.ts"],"sourcesContent":["import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentFactory, ComponentID } from '@teambit/component';\nimport chalk from 'chalk';\nimport { EnvsExecutionResult } from '@teambit/envs';\nimport { Workspace } from '@teambit/workspace';\nimport { compact, flatten, groupBy, omit } from 'lodash';\nimport { LinterMain } from './linter.main.runtime';\nimport { ComponentLintResult, LintResults } from './linter';\nimport { FixTypes, LinterOptions } from './linter-context';\n\nexport type LintCmdOptions = {\n changed?: boolean;\n fix?: boolean;\n fixType?: string;\n json?: boolean;\n};\n\n/**\n * A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component\n */\nexport type JsonComponentLintResult = Omit<ComponentLintResult, 'component'> & {\n componentId: ComponentID;\n};\n\nexport type JsonLintDataResults = Omit<LintResults, 'results'> & { results: JsonComponentLintResult[] };\n/**\n * A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component\n */\nexport type JsonLintResultsData = {\n duration: TimerResponse;\n lintResults: JsonLintDataResults;\n componentsIdsToLint: string[];\n};\n\nexport type JsonLintResults = {\n code: number;\n data: JsonLintResultsData;\n};\n\nexport class LintCmd implements Command {\n name = 'lint [component-pattern]';\n description = 'lint components in the development workspace';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n helpUrl = 'reference/linting/linter-overview';\n group = 'development';\n options = [\n ['c', 'changed', 'lint only new and modified components'],\n ['f', 'fix', 'automatically fix problems'],\n ['', 'fix-type <fixType>', 'specify the types of fixes to apply (problem, suggestion, layout)'],\n ['j', 'json', 'return the lint results in json format'],\n ] as CommandOptions;\n\n constructor(private linter: LinterMain, private componentHost: ComponentFactory, private workspace: Workspace) {}\n\n async report([pattern]: [string], linterOptions: LintCmdOptions) {\n const { code, data } = await this.json([pattern], linterOptions);\n const { lintResults, componentsIdsToLint } = data;\n const title = chalk.bold(\n `linting total of ${chalk.cyan(componentsIdsToLint.length.toString())} component(s) in workspace '${chalk.cyan(\n this.componentHost.name\n )}'`\n );\n\n const groupedByIsClean = groupBy(lintResults.results, (res) => {\n if (res.isClean !== undefined) {\n return res.isClean;\n }\n // The is clean field was added in a later version of the linter, so if it's not there, we will calculate it\n // based on the errors/warnings count\n return res.totalErrorCount + (res.totalFatalErrorCount || 0) + res.totalWarningCount === 0;\n });\n\n const dirtyComponentsOutputs = (groupedByIsClean.false || [])\n .map((lintRes) => {\n const compTitle = chalk.bold.cyan(lintRes.componentId.toString({ ignoreVersion: true }));\n const compOutput = lintRes.output;\n return `${compTitle}\\n${compOutput}`;\n })\n .join('\\n');\n\n const cleanComponentsCount = groupedByIsClean.true?.length || 0;\n const cleanComponentsOutput = cleanComponentsCount\n ? `total of ${chalk.green(cleanComponentsCount.toString())} component(s) has no linting issues`\n : '';\n\n const summary = this.getSummarySection(data);\n const finalOutput = compact([title, dirtyComponentsOutputs, cleanComponentsOutput, summary]).join('\\n\\n');\n return { code, data: finalOutput };\n }\n\n private getSummarySection(data: JsonLintResultsData) {\n const { duration, lintResults, componentsIdsToLint } = data;\n const { seconds } = duration;\n const summaryTitle = `linted ${chalk.cyan(componentsIdsToLint.length.toString())} components in ${chalk.cyan(\n seconds.toString()\n )} seconds`;\n\n const totalFieldsMap = [\n { itemsDataField: 'totalErrorCount', componentsDataField: 'totalComponentsWithErrorCount', label: 'Errors' },\n {\n itemsDataField: 'totalFatalErrorCount',\n componentsDataField: 'totalComponentsWithFatalErrorCount',\n label: 'FatalErrors',\n },\n {\n itemsDataField: 'totalFixableErrorCount',\n componentsDataField: 'totalComponentsWithFixableErrorCount',\n label: 'FixableErrors',\n },\n {\n itemsDataField: 'totalFixableWarningCount',\n componentsDataField: 'totalComponentsWithFixableWarningCount',\n label: 'FixableWarnings',\n },\n {\n itemsDataField: 'totalWarningCount',\n componentsDataField: 'totalComponentsWithWarningCount',\n label: 'Warnings',\n },\n ];\n\n const summaryTotals = totalFieldsMap\n .map((item) =>\n this.renderTotalLine(lintResults[item.componentsDataField], lintResults[item.itemsDataField], item.label)\n )\n .filter(Boolean)\n .join('\\n');\n const summary = `${summaryTitle}\\n${summaryTotals}`;\n return summary;\n }\n\n private renderTotalLine(componentsCount: number, itemsCount: number, fieldLabel: string): string | undefined {\n if (itemsCount === 0) return undefined;\n return `total of ${chalk.green(itemsCount.toString())} ${chalk.cyan(fieldLabel)} (from ${chalk.green(\n componentsCount.toString()\n )} components)`;\n }\n\n async json([pattern]: [string], linterOptions: LintCmdOptions): Promise<JsonLintResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToLint(pattern, linterOptions.changed);\n const componentsToLint = await this.workspace.getMany(componentsIds);\n const opts: LinterOptions = {\n fix: linterOptions.fix,\n fixTypes: linterOptions.fixType ? (linterOptions.fixType.split(',') as FixTypes) : undefined,\n };\n const linterResults = await this.linter.lint(componentsToLint, opts);\n const jsonLinterResults = toJsonLintResults(linterResults);\n const timerResponse = timer.stop();\n let code = 0;\n if (jsonLinterResults.totalErrorCount || jsonLinterResults.totalFatalErrorCount) {\n code = 1;\n }\n return {\n code,\n data: {\n duration: timerResponse,\n lintResults: jsonLinterResults,\n componentsIdsToLint: componentsToLint.map((comp) => comp.id.toString()),\n },\n };\n }\n\n private async getIdsToLint(pattern: string, changed = false): Promise<ComponentID[]> {\n if (pattern) {\n return this.workspace.idsByPattern(pattern);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.componentHost.listIds();\n }\n}\n\nfunction toJsonLintResults(results: EnvsExecutionResult<LintResults>): JsonLintDataResults {\n let totalErrorCount = 0;\n let totalFatalErrorCount = 0;\n let totalFixableErrorCount = 0;\n let totalFixableWarningCount = 0;\n let totalWarningCount = 0;\n let totalComponentsWithErrorCount = 0;\n let totalComponentsWithFatalErrorCount = 0;\n let totalComponentsWithFixableErrorCount = 0;\n let totalComponentsWithFixableWarningCount = 0;\n let totalComponentsWithWarningCount = 0;\n\n const newResults = results.results.map((res) => {\n const resultsWithoutComponent = res.data?.results.map((result) => {\n return Object.assign({}, { componentId: result.component.id }, omit(result, ['component']));\n });\n\n if (res.data) {\n if (res.data.totalErrorCount) {\n totalErrorCount += res.data.totalErrorCount;\n totalComponentsWithErrorCount += res.data.totalComponentsWithErrorCount ?? 0;\n }\n if (res.data.totalFatalErrorCount) {\n totalFatalErrorCount += res.data.totalFatalErrorCount;\n totalComponentsWithFatalErrorCount += res.data.totalComponentsWithFatalErrorCount ?? 0;\n }\n if (res.data.totalFixableErrorCount) {\n totalFixableErrorCount += res.data.totalFixableErrorCount;\n totalComponentsWithFixableErrorCount += res.data.totalComponentsWithFixableErrorCount ?? 0;\n }\n if (res.data.totalFixableWarningCount) {\n totalFixableWarningCount += res.data.totalFixableWarningCount;\n totalComponentsWithFixableWarningCount += res.data.totalComponentsWithFixableWarningCount ?? 0;\n }\n if (res.data.totalWarningCount) {\n totalWarningCount += res.data.totalWarningCount;\n totalComponentsWithWarningCount += res.data.totalComponentsWithWarningCount ?? 0;\n }\n }\n\n return compact(resultsWithoutComponent);\n });\n\n const isClean =\n totalComponentsWithErrorCount === 0 &&\n totalComponentsWithWarningCount === 0 &&\n totalComponentsWithFatalErrorCount === 0;\n\n return {\n results: compact(flatten(newResults)),\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n isClean,\n errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyD,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAA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I,CAACwH,oCAAoC,IAAI,CAAC;MAC5F;MACA,IAAIrE,GAAG,CAACnD,IAAI,CAACqH,wBAAwB,EAAE;QACrCA,wBAAwB,IAAIlE,GAAG,CAACnD,IAAI,CAACqH,wBAAwB;QAC7DI,sCAAsC,IAAItE,GAAG,CAACnD,IAAI,CAACyH,sCAAsC,IAAI,CAAC;MAChG;MACA,IAAItE,GAAG,CAACnD,IAAI,CAACwD,iBAAiB,EAAE;QAC9BA,iBAAiB,IAAIL,GAAG,CAACnD,IAAI,CAACwD,iBAAiB;QAC/CkE,+BAA+B,IAAIvE,GAAG,CAACnD,IAAI,CAAC0H,+BAA+B,IAAI,CAAC;MAClF;IACF;IAEA,OAAO,IAAAhD,iBAAO,EAACkD,uBAAuB,CAAC;EACzC,CAAC,CAAC;EAEF,MAAMxE,OAAO,GACXkE,6BAA6B,KAAK,CAAC,IACnCI,+BAA+B,KAAK,CAAC,IACrCH,kCAAkC,KAAK,CAAC;EAE1C,OAAO;IACLrE,OAAO,EAAE,IAAAwB,iBAAO,EAAC,IAAAuD,iBAAO,EAACN,UAAU,CAAC,CAAC;IACrCrE,eAAe;IACfC,oBAAoB;IACpB6D,sBAAsB;IACtBC,wBAAwB;IACxB7D,iBAAiB;IACjB8D,6BAA6B;IAC7BC,kCAAkC;IAClCC,oCAAoC;IACpCC,sCAAsC;IACtCC,+BAA+B;IAC/BtE,OAAO;IACP8E,MAAM,EAAEhF,OAAO,EAAEgF;EACnB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_toolboxTime","data","require","_constants","_chalk","_interopRequireDefault","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LintCmd","constructor","linter","componentHost","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","linterOptions","code","json","lintResults","componentsIdsToLint","title","chalk","bold","cyan","length","toString","groupedByIsClean","groupBy","results","res","isClean","undefined","totalErrorCount","totalFatalErrorCount","totalWarningCount","dirtyComponentsOutputs","false","map","lintRes","compTitle","componentId","ignoreVersion","compOutput","output","join","cleanComponentsCount","true","cleanComponentsOutput","green","summary","getSummarySection","finalOutput","compact","duration","seconds","summaryTitle","totalFieldsMap","itemsDataField","componentsDataField","label","summaryTotals","item","renderTotalLine","filter","Boolean","componentsCount","itemsCount","fieldLabel","timer","Timer","create","start","componentsIds","getIdsToLint","changed","componentsToLint","getMany","opts","fix","fixTypes","fixType","split","linterResults","lint","jsonLinterResults","toJsonLintResults","timerResponse","stop","comp","id","idsByPattern","getNewAndModifiedIds","listIds","exports","totalFixableErrorCount","totalFixableWarningCount","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","newResults","resultsWithoutComponent","result","assign","component","omit","flatten","errors"],"sources":["lint.cmd.ts"],"sourcesContent":["import { TimerResponse, Timer } from '@teambit/toolbox.time.timer';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentFactory, ComponentID } from '@teambit/component';\nimport chalk from 'chalk';\nimport { EnvsExecutionResult } from '@teambit/envs';\nimport { Workspace } from '@teambit/workspace';\nimport { compact, flatten, groupBy, omit } from 'lodash';\nimport { LinterMain } from './linter.main.runtime';\nimport { ComponentLintResult, LintResults } from './linter';\nimport { FixTypes, LinterOptions } from './linter-context';\n\nexport type LintCmdOptions = {\n changed?: boolean;\n fix?: boolean;\n fixType?: string;\n json?: boolean;\n};\n\n/**\n * A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component\n */\nexport type JsonComponentLintResult = Omit<ComponentLintResult, 'component'> & {\n componentId: ComponentID;\n};\n\nexport type JsonLintDataResults = Omit<LintResults, 'results'> & { results: JsonComponentLintResult[] };\n/**\n * A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component\n */\nexport type JsonLintResultsData = {\n duration: TimerResponse;\n lintResults: JsonLintDataResults;\n componentsIdsToLint: string[];\n};\n\nexport type JsonLintResults = {\n code: number;\n data: JsonLintResultsData;\n};\n\nexport class LintCmd implements Command {\n name = 'lint [component-pattern]';\n description = 'lint components in the development workspace';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n helpUrl = 'reference/linting/linter-overview';\n group = 'development';\n options = [\n ['c', 'changed', 'lint only new and modified components'],\n ['f', 'fix', 'automatically fix problems'],\n ['', 'fix-type <fixType>', 'specify the types of fixes to apply (problem, suggestion, layout)'],\n ['j', 'json', 'return the lint results in json format'],\n ] as CommandOptions;\n\n constructor(private linter: LinterMain, private componentHost: ComponentFactory, private workspace: Workspace) {}\n\n async report([pattern]: [string], linterOptions: LintCmdOptions) {\n const { code, data } = await this.json([pattern], linterOptions);\n const { lintResults, componentsIdsToLint } = data;\n const title = chalk.bold(\n `linting total of ${chalk.cyan(componentsIdsToLint.length.toString())} component(s) in workspace '${chalk.cyan(\n this.componentHost.name\n )}'`\n );\n\n const groupedByIsClean = groupBy(lintResults.results, (res) => {\n if (res.isClean !== undefined) {\n return res.isClean;\n }\n // The is clean field was added in a later version of the linter, so if it's not there, we will calculate it\n // based on the errors/warnings count\n return res.totalErrorCount + (res.totalFatalErrorCount || 0) + res.totalWarningCount === 0;\n });\n\n const dirtyComponentsOutputs = (groupedByIsClean.false || [])\n .map((lintRes) => {\n const compTitle = chalk.bold.cyan(lintRes.componentId.toString({ ignoreVersion: true }));\n const compOutput = lintRes.output;\n return `${compTitle}\\n${compOutput}`;\n })\n .join('\\n');\n\n const cleanComponentsCount = groupedByIsClean.true?.length || 0;\n const cleanComponentsOutput = cleanComponentsCount\n ? `total of ${chalk.green(cleanComponentsCount.toString())} component(s) has no linting issues`\n : '';\n\n const summary = this.getSummarySection(data);\n const finalOutput = compact([title, dirtyComponentsOutputs, cleanComponentsOutput, summary]).join('\\n\\n');\n return { code, data: finalOutput };\n }\n\n private getSummarySection(data: JsonLintResultsData) {\n const { duration, lintResults, componentsIdsToLint } = data;\n const { seconds } = duration;\n const summaryTitle = `linted ${chalk.cyan(componentsIdsToLint.length.toString())} components in ${chalk.cyan(\n seconds.toString()\n )} seconds`;\n\n const totalFieldsMap = [\n { itemsDataField: 'totalErrorCount', componentsDataField: 'totalComponentsWithErrorCount', label: 'Errors' },\n {\n itemsDataField: 'totalFatalErrorCount',\n componentsDataField: 'totalComponentsWithFatalErrorCount',\n label: 'FatalErrors',\n },\n {\n itemsDataField: 'totalFixableErrorCount',\n componentsDataField: 'totalComponentsWithFixableErrorCount',\n label: 'FixableErrors',\n },\n {\n itemsDataField: 'totalFixableWarningCount',\n componentsDataField: 'totalComponentsWithFixableWarningCount',\n label: 'FixableWarnings',\n },\n {\n itemsDataField: 'totalWarningCount',\n componentsDataField: 'totalComponentsWithWarningCount',\n label: 'Warnings',\n },\n ];\n\n const summaryTotals = totalFieldsMap\n .map((item) =>\n this.renderTotalLine(lintResults[item.componentsDataField], lintResults[item.itemsDataField], item.label)\n )\n .filter(Boolean)\n .join('\\n');\n const summary = `${summaryTitle}\\n${summaryTotals}`;\n return summary;\n }\n\n private renderTotalLine(componentsCount: number, itemsCount: number, fieldLabel: string): string | undefined {\n if (itemsCount === 0) return undefined;\n return `total of ${chalk.green(itemsCount.toString())} ${chalk.cyan(fieldLabel)} (from ${chalk.green(\n componentsCount.toString()\n )} components)`;\n }\n\n async json([pattern]: [string], linterOptions: LintCmdOptions): Promise<JsonLintResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToLint(pattern, linterOptions.changed);\n const componentsToLint = await this.workspace.getMany(componentsIds);\n const opts: LinterOptions = {\n fix: linterOptions.fix,\n fixTypes: linterOptions.fixType ? (linterOptions.fixType.split(',') as FixTypes) : undefined,\n };\n const linterResults = await this.linter.lint(componentsToLint, opts);\n const jsonLinterResults = toJsonLintResults(linterResults);\n const timerResponse = timer.stop();\n let code = 0;\n if (jsonLinterResults.totalErrorCount || jsonLinterResults.totalFatalErrorCount) {\n code = 1;\n }\n return {\n code,\n data: {\n duration: timerResponse,\n lintResults: jsonLinterResults,\n componentsIdsToLint: componentsToLint.map((comp) => comp.id.toString()),\n },\n };\n }\n\n private async getIdsToLint(pattern: string, changed = false): Promise<ComponentID[]> {\n if (pattern) {\n return this.workspace.idsByPattern(pattern);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.componentHost.listIds();\n }\n}\n\nfunction toJsonLintResults(results: EnvsExecutionResult<LintResults>): JsonLintDataResults {\n let totalErrorCount = 0;\n let totalFatalErrorCount = 0;\n let totalFixableErrorCount = 0;\n let totalFixableWarningCount = 0;\n let totalWarningCount = 0;\n let totalComponentsWithErrorCount = 0;\n let totalComponentsWithFatalErrorCount = 0;\n let totalComponentsWithFixableErrorCount = 0;\n let totalComponentsWithFixableWarningCount = 0;\n let totalComponentsWithWarningCount = 0;\n\n const newResults = results.results.map((res) => {\n const resultsWithoutComponent = res.data?.results.map((result) => {\n return Object.assign({}, { componentId: result.component.id }, omit(result, ['component']));\n });\n\n if (res.data) {\n if (res.data.totalErrorCount) {\n totalErrorCount += res.data.totalErrorCount;\n totalComponentsWithErrorCount += res.data.totalComponentsWithErrorCount ?? 0;\n }\n if (res.data.totalFatalErrorCount) {\n totalFatalErrorCount += res.data.totalFatalErrorCount;\n totalComponentsWithFatalErrorCount += res.data.totalComponentsWithFatalErrorCount ?? 0;\n }\n if (res.data.totalFixableErrorCount) {\n totalFixableErrorCount += res.data.totalFixableErrorCount;\n totalComponentsWithFixableErrorCount += res.data.totalComponentsWithFixableErrorCount ?? 0;\n }\n if (res.data.totalFixableWarningCount) {\n totalFixableWarningCount += res.data.totalFixableWarningCount;\n totalComponentsWithFixableWarningCount += res.data.totalComponentsWithFixableWarningCount ?? 0;\n }\n if (res.data.totalWarningCount) {\n totalWarningCount += res.data.totalWarningCount;\n totalComponentsWithWarningCount += res.data.totalComponentsWithWarningCount ?? 0;\n }\n }\n\n return compact(resultsWithoutComponent);\n });\n\n const isClean =\n totalComponentsWithErrorCount === 0 &&\n totalComponentsWithWarningCount === 0 &&\n totalComponentsWithFatalErrorCount === 0;\n\n return {\n results: compact(flatten(newResults)),\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n isClean,\n errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyD,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAA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,GAAG,CAACnD,IAAI,CAACyH,sCAAsC,IAAI,CAAC;MAChG;MACA,IAAItE,GAAG,CAACnD,IAAI,CAACwD,iBAAiB,EAAE;QAC9BA,iBAAiB,IAAIL,GAAG,CAACnD,IAAI,CAACwD,iBAAiB;QAC/CkE,+BAA+B,IAAIvE,GAAG,CAACnD,IAAI,CAAC0H,+BAA+B,IAAI,CAAC;MAClF;IACF;IAEA,OAAO,IAAAhD,iBAAO,EAACkD,uBAAuB,CAAC;EACzC,CAAC,CAAC;EAEF,MAAMxE,OAAO,GACXkE,6BAA6B,KAAK,CAAC,IACnCI,+BAA+B,KAAK,CAAC,IACrCH,kCAAkC,KAAK,CAAC;EAE1C,OAAO;IACLrE,OAAO,EAAE,IAAAwB,iBAAO,EAAC,IAAAuD,iBAAO,EAACN,UAAU,CAAC,CAAC;IACrCrE,eAAe;IACfC,oBAAoB;IACpB6D,sBAAsB;IACtBC,wBAAwB;IACxB7D,iBAAiB;IACjB8D,6BAA6B;IAC7BC,kCAAkC;IAClCC,oCAAoC;IACpCC,sCAAsC;IACtCC,+BAA+B;IAC/BtE,OAAO;IACP8E,MAAM,EAAEhF,OAAO,EAAEgF;EACnB,CAAC;AACH","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@1.0.330/dist/linter.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@1.0.330/dist/linter.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@1.0.332/dist/linter.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@1.0.332/dist/linter.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/linter",
3
- "version": "1.0.330",
3
+ "version": "1.0.332",
4
4
  "homepage": "https://bit.cloud/teambit/defender/linter",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.defender",
8
8
  "name": "linter",
9
- "version": "1.0.330"
9
+ "version": "1.0.332"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -14,20 +14,21 @@
14
14
  "graphql-tag": "2.12.1",
15
15
  "cli-highlight": "2.1.9",
16
16
  "@teambit/harmony": "0.4.6",
17
- "@teambit/cli": "0.0.907",
18
- "@teambit/component": "1.0.330",
19
- "@teambit/envs": "1.0.330",
20
- "@teambit/workspace": "1.0.330",
21
- "@teambit/builder": "1.0.330",
22
- "@teambit/isolator": "1.0.330",
23
- "@teambit/logger": "0.0.1000"
17
+ "@teambit/cli": "0.0.909",
18
+ "@teambit/component": "1.0.332",
19
+ "@teambit/envs": "1.0.332",
20
+ "@teambit/toolbox.time.timer": "0.0.1",
21
+ "@teambit/workspace": "1.0.332",
22
+ "@teambit/builder": "1.0.332",
23
+ "@teambit/isolator": "1.0.332",
24
+ "@teambit/logger": "0.0.1002"
24
25
  },
25
26
  "devDependencies": {
26
27
  "@types/lodash": "4.14.165",
27
28
  "@types/mocha": "9.1.0",
28
29
  "chai": "4.3.0",
29
30
  "@teambit/defender.content.linter-overview": "1.95.0",
30
- "@teambit/harmony.envs.core-aspect-env": "0.0.39"
31
+ "@teambit/harmony.envs.core-aspect-env": "0.0.42"
31
32
  },
32
33
  "peerDependencies": {
33
34
  "react": "^17.0.0 || ^18.0.0",