Repository: DevExpress/devextreme-vue
Pull request #89 (2018-05-31 11:06:30)

Fix linting and add it to CI


Patch:
diff --git a/gulpfile.js b/gulpfile.js
index 39117ab..07a45fc 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -110,7 +110,7 @@ gulp.task(NPM_BUILD, [NPM_LICENSE, NPM_PACKAGE, NPM_README, GENERATE], () => {
 gulp.task(NPM_PACK, [NPM_BUILD], shell.task(['npm pack'], { cwd: config.npm.dist }));
 
 gulp.task(LINT, () => {
-  return gulp.src([config.src, config.generator.src, config.example.src])
+  return gulp.src([config.src, config.generator.src])
     .pipe(tslint({
         formatter: "verbose"
     }))
diff --git a/shippable.yml b/shippable.yml
index 3cdde3c..2d2014a 100644
--- a/shippable.yml
+++ b/shippable.yml
@@ -13,6 +13,7 @@ build:
   ci:
     - npm install
     - npm run build
+    - npm run lint
     - npm run test
   cache: true
   cache_dir_list:
diff --git a/tools/src/component-generator.ts b/tools/src/component-generator.ts
index 1c7074a..f60c9c9 100644
--- a/tools/src/component-generator.ts
+++ b/tools/src/component-generator.ts
@@ -75,7 +75,7 @@ const renderSimpleProp: (model: IProp) => string = createTempate(`
 const renderExtendedProp: (model: IProp) => string = createTempate(`
     <#= it.name #>: {<#? it.types #>
       type: <#? it.types.length > 1 #>[<#?#><#= it.types.join(', ') #><#? it.types.length > 1 #>]<#?#><#?#><#? it.acceptableValues #>,
-      validator: (v) => <#? it.isArray #>!Array.isArray(v) || v.filter(i => [<#= it.acceptableValues.join(', ') #>].indexOf(i) === -1).length === 0<#??#>typeof(v) !== <#? it.acceptableValueType #>"<#= it.acceptableValueType #>"<#??#>"string"<#?#> || [<#= it.acceptableValues.join(', ') #>].indexOf(v) !== -1<#?#>
+      validator: (v) => <#? it.isArray #>!Array.isArray(v) || v.filter(i => [\n        <#= it.acceptableValues.join(',\\n        ') #>\n      ].indexOf(i) === -1).length === 0<#??#>typeof(v) !== <#? it.acceptableValueType #>"<#= it.acceptableValueType #>"<#??#>"string"<#?#> || [\n        <#= it.acceptableValues.join(',\\n        ') #>\n      ].indexOf(v) !== -1<#?#>
     <#?#>}
 `.trimRight());
 // tslint:enable:max-line-length


Test patch:
diff --git a/tools/src/component-generator.test.ts b/tools/src/component-generator.test.ts
index 6472c9c..bb3759f 100644
--- a/tools/src/component-generator.test.ts
+++ b/tools/src/component-generator.test.ts
@@ -164,11 +164,17 @@ const DxCLASS_NAME: VueConstructor = Vue.extend({
   props: {
     PROP1: {
       type: TYPE1,
-      validator: (v) => typeof(v) !== "string" || ["VAL1", "VAL2"].indexOf(v) !== -1
+      validator: (v) => typeof(v) !== "string" || [
+        "VAL1",
+        "VAL2"
+      ].indexOf(v) !== -1
     },
     PROP2: {
       type: TYPE2,
-      validator: (v) => typeof(v) !== "TYPE3" || ["VAL1", "VAL2"].indexOf(v) !== -1
+      validator: (v) => typeof(v) !== "TYPE3" || [
+        "VAL1",
+        "VAL2"
+      ].indexOf(v) !== -1
     }
   },
   computed: {
@@ -220,7 +226,10 @@ const DxCLASS_NAME: VueConstructor = Vue.extend({
   props: {
     PROP1: {
       type: TYPE1,
-      validator: (v) => !Array.isArray(v) || v.filter(i => ["VAL1", "VAL2"].indexOf(i) === -1).length === 0
+      validator: (v) => !Array.isArray(v) || v.filter(i => [
+        "VAL1",
+        "VAL2"
+      ].indexOf(i) === -1).length === 0
     }
   },
   computed: {