From 62ba6425a73845c235e93d706b7d826f70853c40 Mon Sep 17 00:00:00 2001 From: LitoMore Date: Thu, 3 Jan 2019 18:01:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20no-deprecated-api=20error?= =?UTF-8?q?=20messages=20(#147)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rules/no-deprecated-api.js | 10 ++++++++-- tests/fixtures/no-missing/a.config.js | 5 +++-- tests/fixtures/no-missing/a.js | 5 +++-- tests/fixtures/no-missing/bar/main.js | 5 +++-- tests/fixtures/no-missing/foo/main.js | 5 +++-- tests/fixtures/no-missing/index.js | 5 +++-- 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/lib/rules/no-deprecated-api.js b/lib/rules/no-deprecated-api.js index fed61214..8a6ea86b 100644 --- a/lib/rules/no-deprecated-api.js +++ b/lib/rules/no-deprecated-api.js @@ -90,7 +90,10 @@ const modules = { [READ]: { since: "10.0.0", replacedBy: null }, }, createCipher: { - [READ]: { since: "10.0.0", replacedBy: "'tls.createCipheriv()'" }, + [READ]: { + since: "10.0.0", + replacedBy: "'crypto.createCipheriv()'", + }, }, createCredentials: { [READ]: { @@ -99,7 +102,10 @@ const modules = { }, }, createDecipher: { - [READ]: { since: "10.0.0", replacedBy: "'tls.createDecipheriv()'" }, + [READ]: { + since: "10.0.0", + replacedBy: "'crypto.createDecipheriv()'", + }, }, fips: { [READ]: { diff --git a/tests/fixtures/no-missing/a.config.js b/tests/fixtures/no-missing/a.config.js index ed469db8..b436fe84 100644 --- a/tests/fixtures/no-missing/a.config.js +++ b/tests/fixtures/no-missing/a.config.js @@ -1,2 +1,3 @@ -"use strict"; -console.log("hello!"); +"use strict" + +console.log("hello!") diff --git a/tests/fixtures/no-missing/a.js b/tests/fixtures/no-missing/a.js index ed469db8..b436fe84 100644 --- a/tests/fixtures/no-missing/a.js +++ b/tests/fixtures/no-missing/a.js @@ -1,2 +1,3 @@ -"use strict"; -console.log("hello!"); +"use strict" + +console.log("hello!") diff --git a/tests/fixtures/no-missing/bar/main.js b/tests/fixtures/no-missing/bar/main.js index ed469db8..b436fe84 100644 --- a/tests/fixtures/no-missing/bar/main.js +++ b/tests/fixtures/no-missing/bar/main.js @@ -1,2 +1,3 @@ -"use strict"; -console.log("hello!"); +"use strict" + +console.log("hello!") diff --git a/tests/fixtures/no-missing/foo/main.js b/tests/fixtures/no-missing/foo/main.js index ed469db8..b436fe84 100644 --- a/tests/fixtures/no-missing/foo/main.js +++ b/tests/fixtures/no-missing/foo/main.js @@ -1,2 +1,3 @@ -"use strict"; -console.log("hello!"); +"use strict" + +console.log("hello!") diff --git a/tests/fixtures/no-missing/index.js b/tests/fixtures/no-missing/index.js index ed469db8..b436fe84 100644 --- a/tests/fixtures/no-missing/index.js +++ b/tests/fixtures/no-missing/index.js @@ -1,2 +1,3 @@ -"use strict"; -console.log("hello!"); +"use strict" + +console.log("hello!")