diff --git a/packages/google-cloud-vision/package.json b/packages/google-cloud-vision/package.json index a2dd975ec0b..bbade437883 100644 --- a/packages/google-cloud-vision/package.json +++ b/packages/google-cloud-vision/package.json @@ -57,12 +57,12 @@ "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "eslint src/ samples/ system-test/ test/", - "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", + "lint": "eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", - "test": "npm run cover" + "test": "npm run cover", + "fix": "eslint --fix '**/*.js'" }, "dependencies": { "@google-cloud/promisify": "^0.3.0", diff --git a/packages/google-cloud-vision/samples/.eslintrc.yml b/packages/google-cloud-vision/samples/.eslintrc.yml index a855d877f08..0aa37ac630e 100644 --- a/packages/google-cloud-vision/samples/.eslintrc.yml +++ b/packages/google-cloud-vision/samples/.eslintrc.yml @@ -1,5 +1,4 @@ --- rules: no-console: off - - + node/no-missing-require: off diff --git a/packages/google-cloud-vision/samples/package.json b/packages/google-cloud-vision/samples/package.json index 31a2591a682..71a6957a9ce 100644 --- a/packages/google-cloud-vision/samples/package.json +++ b/packages/google-cloud-vision/samples/package.json @@ -4,7 +4,6 @@ "private": true, "license": "Apache-2.0", "author": "Google Inc.", - "repository": "googleapis/nodejs-vision", "engines": { "node": ">=8" }, @@ -12,7 +11,6 @@ "test": "ava -T 1m --verbose system-test/*.test.js" }, "dependencies": { - "@google-cloud/automl": "^0.1.1", "@google-cloud/vision": "^0.22.0", "async": "^2.6.1", diff --git a/packages/google-cloud-vision/smoke-test/.eslintrc.yml b/packages/google-cloud-vision/smoke-test/.eslintrc.yml new file mode 100644 index 00000000000..2e6882e46d2 --- /dev/null +++ b/packages/google-cloud-vision/smoke-test/.eslintrc.yml @@ -0,0 +1,6 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off + no-console: off diff --git a/packages/google-cloud-vision/smoke-test/image_annotator_smoke_test.js b/packages/google-cloud-vision/smoke-test/image_annotator_smoke_test.js index 5b5ae522c67..131d2f65a8c 100644 --- a/packages/google-cloud-vision/smoke-test/image_annotator_smoke_test.js +++ b/packages/google-cloud-vision/smoke-test/image_annotator_smoke_test.js @@ -39,7 +39,8 @@ describe('ImageAnnotatorSmokeTest', () => { features: features, }; const requests = [requestsElement]; - client.batchAnnotateImages({requests: requests}) + client + .batchAnnotateImages({requests: requests}) .then(responses => { const response = responses[0]; console.log(response); diff --git a/packages/google-cloud-vision/synth.py b/packages/google-cloud-vision/synth.py index 9bae6a28d11..6a2963d83ef 100644 --- a/packages/google-cloud-vision/synth.py +++ b/packages/google-cloud-vision/synth.py @@ -21,23 +21,18 @@ logging.basicConfig(level=logging.DEBUG) +# Run the gapic generator gapic = gcp.GAPICGenerator() -common_templates = gcp.CommonTemplates() - - versions = ['v1', 'v1p1beta1', 'v1p2beta1', 'v1p3beta1'] - for version in versions: library = gapic.node_library('vision', version) s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) -templates = common_templates.node_library(package_name="@google-cloud/vision") +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library() s.copy(templates) - -''' -Node.js specific cleanup -''' +# Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'prettier']) -subprocess.run(['npm', 'run', 'lint']) +subprocess.run(['npm', 'run', 'fix']) diff --git a/packages/google-cloud-vision/system-test/.eslintrc.yml b/packages/google-cloud-vision/system-test/.eslintrc.yml index 2eb0c97e825..f9605165c0f 100644 --- a/packages/google-cloud-vision/system-test/.eslintrc.yml +++ b/packages/google-cloud-vision/system-test/.eslintrc.yml @@ -2,6 +2,4 @@ env: mocha: true rules: - node/no-unpublished-require: off no-console: off - node/no-deprecated-api: off diff --git a/packages/google-cloud-vision/test/.eslintrc.yml b/packages/google-cloud-vision/test/.eslintrc.yml index 9084b7fb5ad..6db2a46c535 100644 --- a/packages/google-cloud-vision/test/.eslintrc.yml +++ b/packages/google-cloud-vision/test/.eslintrc.yml @@ -1,6 +1,3 @@ --- env: mocha: true -rules: - node/no-unpublished-require: off - node/no-deprecated-api: off