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 10086986c84..235497830db 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 469b25ac6a5..0604f3e1a97 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 b6727ecffc3..574cee9d9da 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 fb79585433b..dd5b8417cd7 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 338eb7a9e1d..e28d26290c1 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 de74d8917fd..b5644f64858 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 73732b7fb9b..a78b038d644 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 63e0365feff..5c094e34e31 100644 --- a/examples/search.js +++ b/examples/search.js @@ -14,6 +14,8 @@ * limitations under the License. */ +'use strict'; + const puppeteer = require('puppeteer'); (async() => {