From 60ace82875f03a24fc26570bccc682d6bb82d353 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Fri, 25 Aug 2017 03:33:41 +0300 Subject: [PATCH] add 'use strict'; to examples (#530) This patch: - adds 'use strict'; to examples - enforces 'use strict' in examples with .eslintrc.js --- examples/.eslintrc.js | 1 + examples/block-images.js | 2 ++ examples/detect-sniff.js | 2 ++ examples/pdf.js | 2 ++ examples/proxy.js | 2 ++ examples/screenshot-fullpage.js | 2 ++ examples/screenshot.js | 2 ++ examples/search.js | 2 ++ 8 files changed, 15 insertions(+) diff --git a/examples/.eslintrc.js b/examples/.eslintrc.js index 10086986..23549783 100644 --- a/examples/.eslintrc.js +++ b/examples/.eslintrc.js @@ -11,5 +11,6 @@ module.exports = { */ "rules": { "indent": [2, 2, { "SwitchCase": 1, "CallExpression": {"arguments": 2}, "MemberExpression": 2, "outerIIFEBody": 0 }], + "strict": [2, "global"], } }; diff --git a/examples/block-images.js b/examples/block-images.js index 469b25ac..0604f3e1 100644 --- a/examples/block-images.js +++ b/examples/block-images.js @@ -14,6 +14,8 @@ * limitations under the License. */ +'use strict'; + const puppeteer = require('puppeteer'); (async() => { diff --git a/examples/detect-sniff.js b/examples/detect-sniff.js index b6727ecf..574cee9d 100644 --- a/examples/detect-sniff.js +++ b/examples/detect-sniff.js @@ -14,6 +14,8 @@ * limitations under the License. */ +'use strict'; + const puppeteer = require('puppeteer'); function sniffDetector() { diff --git a/examples/pdf.js b/examples/pdf.js index fb795854..dd5b8417 100644 --- a/examples/pdf.js +++ b/examples/pdf.js @@ -14,6 +14,8 @@ * limitations under the License. */ +'use strict'; + const puppeteer = require('puppeteer'); (async() => { diff --git a/examples/proxy.js b/examples/proxy.js index 338eb7a9..e28d2629 100644 --- a/examples/proxy.js +++ b/examples/proxy.js @@ -14,6 +14,8 @@ * limitations under the License. */ +'use strict'; + const puppeteer = require('puppeteer'); (async() => { diff --git a/examples/screenshot-fullpage.js b/examples/screenshot-fullpage.js index de74d891..b5644f64 100644 --- a/examples/screenshot-fullpage.js +++ b/examples/screenshot-fullpage.js @@ -14,6 +14,8 @@ * limitations under the License. */ +'use strict'; + const puppeteer = require('puppeteer'); const devices = require('puppeteer/DeviceDescriptors'); diff --git a/examples/screenshot.js b/examples/screenshot.js index 73732b7f..a78b038d 100644 --- a/examples/screenshot.js +++ b/examples/screenshot.js @@ -14,6 +14,8 @@ * limitations under the License. */ +'use strict'; + const puppeteer = require('puppeteer'); (async() => { diff --git a/examples/search.js b/examples/search.js index 63e0365f..5c094e34 100644 --- a/examples/search.js +++ b/examples/search.js @@ -14,6 +14,8 @@ * limitations under the License. */ +'use strict'; + const puppeteer = require('puppeteer'); (async() => {