govuk_publishing_components 17.17.0 → 17.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a73c8ab529cbf7f34bc87819610f1a34c4d1ab4219e031e69d2e6e6287d35d07
4
- data.tar.gz: 8842d27cb7a805aded2e5635eed953f7c309fe3431d2ada9a42f44d779f0c29a
3
+ metadata.gz: aa3b2ab5c6bae378fcfbc364a38f985840b75717cdcf7d36c30ff52cb1b21c69
4
+ data.tar.gz: bdb08fde76441407c58750c41322d2fe458a80611998076482a26c9da97d677f
5
5
  SHA512:
6
- metadata.gz: 97d75185e1696714bf58e31a5c2a96ebaec9ed6929edec3a38c9840e5d3621789c31b1ae4f7dea9cddafd3c198d13cfb09b78a18fd598befc9da0230ce54115c
7
- data.tar.gz: 5792263743cd2d46dffa7243d682d703ae3e2f0bb3b6c9e597245716031a0220a6eddb24d92f34ac152dd28a8244705f33d262053a6f63dbffe80c88afdf6a0b
6
+ metadata.gz: d46360f64ea06b1798025f91d3823567f8d2347330702bc6a6cbe9a152471aa59a6daca4ff8de19d4644a44dc7f27ea0c3c85d6ef4acc1746257ff59429b7dce
7
+ data.tar.gz: 1bc32915bb2f1794a3fb74abc1f9d492ea7d841c2d5d7d9176b9d12c3ee0e03f7d84643c150dfb77ca3b7fc2e0cc0369ee77cd816bb14103350c7ceae0f55a28
@@ -14,10 +14,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
14
14
  this.$module.cookieBannerConfirmationMessage = this.$module.querySelector('.gem-c-cookie-banner__confirmation')
15
15
 
16
16
  this.setupCookieMessage()
17
-
18
- // Listen for cross-origin communication messages (e.g. hideCookieBanner for when previewing GOV.UK pages
19
- // in publishing applications
20
- this.listenForCrossOriginMessages()
21
17
  }
22
18
 
23
19
  CookieBanner.prototype.setupCookieMessage = function () {
@@ -43,10 +39,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
43
39
  }
44
40
 
45
41
  CookieBanner.prototype.showCookieMessage = function () {
46
- // Hide the cookie banner on the cookie settings page, to avoid circular journeys
47
- if (this.$module.cookieBanner && window.location.pathname === '/help/cookies') {
48
- this.$module.style.display = 'none'
49
- } else {
42
+ // Show the cookie banner if not in the cookie settings page or in an iframe
43
+ if (!this.isInCookiesPage() && !this.isInIframe()) {
50
44
  var shouldHaveCookieMessage = (this.$module && window.GOVUK.cookie('seen_cookie_message') !== 'true')
51
45
 
52
46
  if (shouldHaveCookieMessage) {
@@ -89,36 +83,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
89
83
  window.addEventListener('message', this.receiveMessage.bind(this), false)
90
84
  }
91
85
 
92
- CookieBanner.prototype.receiveMessage = function (event) {
93
- var trustedDomain = 'publishing.service.gov.uk'
94
- var origin = event.origin
95
-
96
- // Return if no origin is given or the browser doesn't support lastIndexOf
97
- if (!origin || !origin.lastIndexOf) {
98
- return
99
- }
100
-
101
- // Polyfill origin.endsWith(trustedDomain) for IE
102
- var offset = origin.length - trustedDomain.length
103
- var trustedOrigin = offset >= 0 && origin.lastIndexOf(trustedDomain, offset) === offset
104
-
105
- // Return if the given origin is not trusted
106
- if (!trustedOrigin) {
107
- return
108
- }
86
+ CookieBanner.prototype.isInCookiesPage = function () {
87
+ return window.location.pathname === '/help/cookies'
88
+ }
109
89
 
110
- // Read JSON data from event
111
- var dataObject = {}
112
- try {
113
- dataObject = JSON.parse(event.data)
114
- } catch (err) {
115
- // Don't throw errors as the emmited message may not be in a JSON format
116
- } finally {
117
- if (dataObject.hideCookieBanner === 'true') {
118
- // Visually hide the cookie banner
119
- this.$module.style.display = 'none'
120
- }
121
- }
90
+ CookieBanner.prototype.isInIframe = function () {
91
+ return window.parent && window.location !== window.parent.location
122
92
  }
123
93
 
124
94
  Modules.CookieBanner = CookieBanner
@@ -13,8 +13,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
13
13
  this.createBarcharts($element)
14
14
  }
15
15
 
16
- this.embedYoutube = function ($element) {
17
- var enhancement = new window.GOVUK.GovspeakYoutubeLinkEnhancement($element)
16
+ this.embedYoutube = function ($jqElement) {
17
+ var enhancement = new window.GOVUK.GovspeakYoutubeLinkEnhancement($jqElement[0])
18
18
  enhancement.init()
19
19
  }
20
20
 
@@ -1,71 +1,89 @@
1
- // = require govuk_publishing_components/vendor/jquery-ui-1.10.2.custom
2
- // = require govuk_publishing_components/vendor/jquery.player.min
3
-
4
- window.GOVUK = window.GOVUK || {};
5
-
6
- (function (GOVUK, $) {
1
+ (function () {
7
2
  'use strict'
3
+ window.GOVUK = window.GOVUK || {}
4
+ var GOVUK = window.GOVUK || {}
8
5
 
9
6
  var YoutubeLinkEnhancement = function ($element) {
10
7
  this.$element = $element
11
8
  }
12
9
 
13
10
  YoutubeLinkEnhancement.prototype.init = function () {
14
- var $youtubeLinks = this.$element.find('a[href*="youtube.com"], a[href*="youtu.be"]')
15
- var _this = this
16
-
17
- $youtubeLinks.each(function () {
18
- var $link = $(this)
19
- // if users have disabled 'campaigns' cookie in the new cookie page settings
20
- // we also need to disable the youtube video embed
21
- if (_this.hasDisabledEmbed($link) || !YoutubeLinkEnhancement.campaignCookies()) {
22
- return true
23
- }
11
+ if (!this.campaignCookiesAllowed()) {
12
+ return
13
+ }
14
+
15
+ var $youtubeLinks = this.$element.querySelectorAll('a[href*="youtube.com"], a[href*="youtu.be"]')
24
16
 
25
- var videoId = YoutubeLinkEnhancement.parseVideoId($link.attr('href'))
26
- if (videoId) {
27
- _this.embedVideo($link, videoId)
17
+ if ($youtubeLinks.length > 0) {
18
+ YoutubeLinkEnhancement.insertApiScript()
19
+ }
20
+
21
+ for (var i = 0; i < $youtubeLinks.length; ++i) {
22
+ var $link = $youtubeLinks[i]
23
+
24
+ var videoId = YoutubeLinkEnhancement.parseVideoId($link.getAttribute('href'))
25
+
26
+ if (!this.hasDisabledEmbed($link) && videoId) {
27
+ this.setupVideo($link, videoId)
28
28
  }
29
- })
29
+ }
30
30
  }
31
31
 
32
32
  YoutubeLinkEnhancement.prototype.hasDisabledEmbed = function ($link) {
33
- return $link.attr('data-youtube-player') === 'off'
33
+ return $link.getAttribute('data-youtube-player') === 'off'
34
34
  }
35
35
 
36
- YoutubeLinkEnhancement.prototype.embedVideo = function ($link, videoId) {
37
- var $mediaPlayer = $('<span class="media-player" />')
36
+ YoutubeLinkEnhancement.prototype.setupVideo = function ($link, videoId) {
37
+ var elementId = YoutubeLinkEnhancement.nextId()
38
38
 
39
- $link.parent().replaceWith($mediaPlayer)
39
+ var parentPara = $link.parentNode
40
+ var parentContainer = parentPara.parentNode
40
41
 
41
- var protocol = this.protocol()
42
+ var youtubeVideoContainer = document.createElement('div')
43
+ youtubeVideoContainer.className += 'gem-c-govspeak__youtube-video'
44
+ youtubeVideoContainer.innerHTML = '<span id="' + elementId + '" data-video-id="' + videoId + '"></span>'
42
45
 
43
- $mediaPlayer.player({
44
- id: YoutubeLinkEnhancement.nextId(),
45
- media: videoId,
46
- captions: this.captions($link),
47
- url: protocol + '//www.youtube.com/apiplayer?enablejsapi=1&version=3&playerapiid='
48
- })
46
+ parentContainer.replaceChild(youtubeVideoContainer, parentPara)
47
+ this.insertVideo(elementId, videoId, $link.textContent)
49
48
  }
50
49
 
51
- YoutubeLinkEnhancement.prototype.protocol = function () {
52
- var scheme = document.location.protocol
53
- if (scheme === 'file:') {
54
- scheme = 'https:'
50
+ YoutubeLinkEnhancement.prototype.insertVideo = function (elementId, videoId, title) {
51
+ var videoInsert = function () {
52
+ new window.YT.Player(elementId, { // eslint-disable-line no-new
53
+ videoId: videoId,
54
+ host: 'https://www.youtube-nocookie.com',
55
+ playerVars: {
56
+ // enables the player to be controlled via IFrame or JavaScript Player API calls
57
+ enablejsapi: 1,
58
+ // don't show related videos
59
+ rel: 0,
60
+ // disable option to allow single key shortcuts due to (WCAG SC 2.1.4)
61
+ // https://www.w3.org/WAI/WCAG21/quickref/#character-key-shortcuts
62
+ disablekb: 1,
63
+ // prevent the YouTube logo from displaying in the control bar
64
+ modestbranding: 1
65
+ },
66
+ events: {
67
+ onReady: function (event) {
68
+ // update iframe title attribute once video is ready
69
+ event.target.a.setAttribute('title', title + ' (video)')
70
+ }
71
+ }
72
+ })
55
73
  }
56
- return scheme
57
- }
58
74
 
59
- YoutubeLinkEnhancement.prototype.captions = function ($link) {
60
- var $captions = $link.siblings('.captions')
61
- if ($captions.length) {
62
- return $captions.first().attr('href')
75
+ videoInsert = videoInsert.bind(this)
76
+
77
+ if (YoutubeLinkEnhancement.playerApiReady) {
78
+ videoInsert.call()
79
+ } else {
80
+ YoutubeLinkEnhancement.queuedInserts.push(videoInsert)
63
81
  }
64
82
  }
65
83
 
66
- YoutubeLinkEnhancement.campaignCookies = function () {
67
- var cookiePolicy = window.GOVUK.getCookie('cookie_policy') ? JSON.parse(window.GOVUK.getCookie('cookie_policy')) : 'undefined'
68
- return cookiePolicy !== 'undefined' ? cookiePolicy.campaigns : true
84
+ YoutubeLinkEnhancement.prototype.campaignCookiesAllowed = function () {
85
+ var cookiePolicy = window.GOVUK.getConsentCookie()
86
+ return cookiePolicy !== null ? cookiePolicy.campaigns : true
69
87
  }
70
88
 
71
89
  YoutubeLinkEnhancement.nextId = function () {
@@ -74,6 +92,18 @@ window.GOVUK = window.GOVUK || {};
74
92
  return 'youtube-' + this.embedCount
75
93
  }
76
94
 
95
+ YoutubeLinkEnhancement.insertApiScript = function () {
96
+ if (this.apiScriptInserted) {
97
+ return
98
+ }
99
+
100
+ var tag = document.createElement('script')
101
+ tag.src = 'https://www.youtube.com/player_api'
102
+ var firstScriptTag = document.getElementsByTagName('script')[0]
103
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag)
104
+ this.apiScriptInserted = true
105
+ }
106
+
77
107
  // This is a public class method so it can be used outside of this embed to
78
108
  // check that user input for videos will be supported in govspeak
79
109
  YoutubeLinkEnhancement.parseVideoId = function (url) {
@@ -99,5 +129,17 @@ window.GOVUK = window.GOVUK || {};
99
129
  }
100
130
  }
101
131
 
132
+ YoutubeLinkEnhancement.apiScriptInserted = false
133
+ YoutubeLinkEnhancement.playerApiReady = false
134
+ // an array of functions to be called once the Youtube Player API is ready
135
+ YoutubeLinkEnhancement.queuedInserts = []
136
+
137
+ window.onYouTubePlayerAPIReady = function () {
138
+ YoutubeLinkEnhancement.playerApiReady = true
139
+ for (var i = 0; i < YoutubeLinkEnhancement.queuedInserts.length; i++) {
140
+ YoutubeLinkEnhancement.queuedInserts[i].call()
141
+ }
142
+ }
143
+
102
144
  GOVUK.GovspeakYoutubeLinkEnhancement = YoutubeLinkEnhancement
103
- })(window.GOVUK, window.jQuery)
145
+ })()
@@ -5,18 +5,23 @@
5
5
  // - alphagov/whitehall: ✔︎
6
6
  // - alphagov/govspeak: ✔︎
7
7
 
8
- .gem-c-govspeak {
9
- // Video player styles from frontend toolkit
10
- @import "design-patterns/media-player";
11
-
12
- .media-player {
13
- @include media-player;
8
+ .gem-c-govspeak__youtube-video {
9
+ position: relative;
10
+ height: 0;
11
+ overflow: hidden;
12
+ margin-top: govuk-spacing(2);
13
+ margin-bottom: govuk-spacing(2);
14
+ padding-top: 0;
15
+ padding-left: 0;
16
+ padding-right: 0;
17
+ padding-bottom: 56.25%;
18
+ }
14
19
 
15
- // We need a specific styling on form elements otherwise it falls through
16
- // to the browser default, this is needed in govuk_publishing_components
17
- // as there is not a global reset like there is in govuk_frontend_toolkit
18
- button {
19
- @include govuk-font($size: 16);
20
- }
21
- }
20
+ .gem-c-govspeak__youtube-video iframe {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ width: 100%;
25
+ height: 100%;
26
+ border: 0;
22
27
  }
@@ -10,7 +10,7 @@ body: |
10
10
  Some JavaScript behaviours are applied to this component:
11
11
 
12
12
  - Progressively enhanced, accessible charts (using [Magna Charta](https://github.com/alphagov/magna-charta), derived from tabular data (see [example](./govspeak/charts))
13
- - Progressively enhanced, accessible embedded YouTube player (using [AccessibleMediaPlayer](https://github.com/alphagov/Accessible-Media-Player)) (see [example](./govspeak/with_youtube_embed))
13
+ - Progressively enhanced, accessible embedded YouTube player (see [example](./govspeak/with_youtube_embed))
14
14
 
15
15
  accessibility_criteria: |
16
16
  - headings must be part of a correct heading structure for the page
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '17.17.0'.freeze
2
+ VERSION = '17.18.0'.freeze
3
3
  end
@@ -49,7 +49,7 @@
49
49
  "/"
50
50
  ],
51
51
  "_resolved": "git://github.com/alphagov/accessible-autocomplete.git#3523dd9fffc70cbd9f6f555f75863c33a709f49e",
52
- "_shasum": "6b92563be16d251f4344b0504115d55cd173ce3c",
52
+ "_shasum": "e6d17f81172b18852c851434307a096874ef1731",
53
53
  "_shrinkwrap": null,
54
54
  "_spec": "accessible-autocomplete@git://github.com/alphagov/accessible-autocomplete.git#add-multiselect-support",
55
55
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
@@ -5,6 +5,12 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## v2.4.1 - 2019-07-19
9
+
10
+ ### Fixed
11
+ - Improve parse perf when using `@typescript-eslint/parser` ([#1409], thanks [@bradzacher])
12
+ - Improve support for Typescript declare structures ([#1356], thanks [@christophercurrie])
13
+
8
14
  ## v2.4.0 - 2019-04-13
9
15
 
10
16
  ### Added
@@ -46,6 +52,8 @@ Yanked due to critical issue with cache key resulting from #839.
46
52
 
47
53
 
48
54
 
55
+ [#1409]: https://github.com/benmosher/eslint-plugin-import/pull/1409
56
+ [#1356]: https://github.com/benmosher/eslint-plugin-import/pull/1356
49
57
  [#1290]: https://github.com/benmosher/eslint-plugin-import/pull/1290
50
58
  [#1218]: https://github.com/benmosher/eslint-plugin-import/pull/1218
51
59
  [#1166]: https://github.com/benmosher/eslint-plugin-import/issues/1166
@@ -55,3 +63,5 @@ Yanked due to critical issue with cache key resulting from #839.
55
63
  [@hulkish]: https://github.com/hulkish
56
64
  [@timkraut]: https://github.com/timkraut
57
65
  [@vikr01]: https://github.com/vikr01
66
+ [@bradzacher]: https://github.com/bradzacher
67
+ [@christophercurrie]: https://github.com/christophercurrie
@@ -15,19 +15,19 @@
15
15
  ],
16
16
  "_from": "eslint-module-utils@>=2.2.0 <3.0.0",
17
17
  "_hasShrinkwrap": false,
18
- "_id": "eslint-module-utils@2.4.0",
18
+ "_id": "eslint-module-utils@2.4.1",
19
19
  "_inCache": true,
20
20
  "_location": "/eslint-module-utils",
21
- "_nodeVersion": "11.14.0",
21
+ "_nodeVersion": "12.6.0",
22
22
  "_npmOperationalInternal": {
23
23
  "host": "s3://npm-registry-packages",
24
- "tmp": "tmp/eslint-module-utils_2.4.0_1555165951942_0.13399718189883947"
24
+ "tmp": "tmp/eslint-module-utils_2.4.1_1563572981159_0.08107138249336288"
25
25
  },
26
26
  "_npmUser": {
27
27
  "name": "ljharb",
28
28
  "email": "ljharb@gmail.com"
29
29
  },
30
- "_npmVersion": "6.7.0",
30
+ "_npmVersion": "6.9.0",
31
31
  "_phantomChildren": {},
32
32
  "_requested": {
33
33
  "raw": "eslint-module-utils@^2.2.0",
@@ -41,8 +41,8 @@
41
41
  "_requiredBy": [
42
42
  "/eslint-plugin-import"
43
43
  ],
44
- "_resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz",
45
- "_shasum": "8b93499e9b00eab80ccb6614e69f03678e84e09a",
44
+ "_resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz",
45
+ "_shasum": "7b4675875bf96b0dbf1b21977456e5bb1f5e018c",
46
46
  "_shrinkwrap": null,
47
47
  "_spec": "eslint-module-utils@^2.2.0",
48
48
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ/node_modules/eslint-plugin-import",
@@ -61,12 +61,12 @@
61
61
  "devDependencies": {},
62
62
  "directories": {},
63
63
  "dist": {
64
- "integrity": "sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw==",
65
- "shasum": "8b93499e9b00eab80ccb6614e69f03678e84e09a",
66
- "tarball": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz",
64
+ "integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==",
65
+ "shasum": "7b4675875bf96b0dbf1b21977456e5bb1f5e018c",
66
+ "tarball": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz",
67
67
  "fileCount": 11,
68
- "unpackedSize": 19702,
69
- "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcsfMACRA9TVsSAnZWagAAAb0P/jzyK/kCjy2g5LSnHST0\npptJwTPEmXh8Klrx15BN+ouKpp9FGucJjKTL2UTvLoK/MBMd/qtdB2a6T8X0\nVWJmsXm5L1T3HR8pHoVSninUZ2iRKEZmDb5JmP9FrB3dBb8X4mVdzDTok005\nNz3d6pu86q06E73djsHWs+ffaxma7tJzL5k/+sQONG2tIIaFKMG17Jfz+cql\nh7sh8W4xLHVlXqJYbeJXujjNnw9uA6VBkV7l0mdLCHlnMcXLq7eIe1aWUEru\nBTOHb6sZhOUrcrZo3kmCY2oKTQgoyj/4CK5g988GNqAVRgM8jwT4mOcm9cjZ\nUy4++D7gVJh4pBbQLVtO/xASvdeRlI5tQJ3SxWJ1lUPVQb5o2EK9oq0Yn8SY\nu9QQHHrXdq8/qrO3W2+B6bx9WuJgsqpUUlw+z577Lte54CQ86M+5C9FLthVT\nn1zIwex/zjvMxkFvIm6QvfH1borcRK5KRxZcyUGSVp/geVXVIR3lAhEIr16m\nq1vNalMF+n8NZW6EDAINuLBfhF6n1OBGnvHpec8h+qkcfM3x6xGCY7l3cK7x\nQh7O6/NEbsb6+5TplstI7SZWadT4xJGQrrPblUe9KRRs2NulYTZF8iiG7nG+\nVDA2uRiXkD3OgNezAb42IYuj9nCVYoWI9J4p/z8CYwQ6eH3//zrOLrbjcXC5\nIVsU\r\n=Mt+c\r\n-----END PGP SIGNATURE-----\r\n"
68
+ "unpackedSize": 20606,
69
+ "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdMjr1CRA9TVsSAnZWagAAPCwP/je5sVyJtj4SvCYxnkPm\nAb6FfogEbO0D0BhgiHfbJ39R0y1kuDZfy+N5QJ2mHhIigP4zG6O8s4XodSkk\n2AFIb0VmNwXDJvf6zdQE4EL7KohvVoLdaFocEnbmGeLJTfdEf86lLCSlAs14\nN7L33LxGxRAISlnoLnOZ+YHsyLcKpgCwOfYlN/tD3guWgSQYwudTZu4t+Bez\nagT3MHmtYck9MSr49rWG21P1rStlFDD3dwkSMNRke6zZc2HHGf4bT6lVpA2o\nwXDroNAIknzIpvx6H9Pqiyc5AcITupc+/q+PLzT47fov8DQiWVELwJjpO8AN\n/VSUMq/HwJ1teYWzhUtW8KcOvqLrzXW9+nbGbbVDTtrTMg65Mni+L4tg+BTb\nvjuc+W5iTuyCYTmOD0y8Oywatb4HTl/zA/+qe0Z3DegRA48yMvJQ0r9IOUQ+\nFChGxLVFV0Xsn47MGWOGsMj8ztn1PB0XQkyDz5xLu8bbPhTjhbQ0cGRTYvM4\nPU6wsma7T6BI/RYSCBvL/FBMyivEa882HqpTLldGL31ft0u7ND0TQ6RTMdJX\nD83SVQEU2LSDrKS+wPSX5kB77HFH8HTPJKrPnil287NXYBLnBeQm1FM0dwaz\no0e6j4hgelJ/fs0a6HqW/KlDL2afsblPbHhAtvkHoErbhFmm0yggXtfGEUEo\nJWGO\r\n=HGfA\r\n-----END PGP SIGNATURE-----\r\n"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=4"
@@ -103,5 +103,5 @@
103
103
  "scripts": {
104
104
  "test": "echo \"Error: no test specified\" && exit 1"
105
105
  },
106
- "version": "2.4.0"
106
+ "version": "2.4.1"
107
107
  }
@@ -31,7 +31,14 @@ exports.default = function parse(path, content, context) {
31
31
  // provide the `filePath` like eslint itself does, in `parserOptions`
32
32
  // https://github.com/eslint/eslint/blob/3ec436ee/lib/linter.js#L637
33
33
  parserOptions.filePath = path
34
-
34
+
35
+ // @typescript-eslint/parser will parse the entire project with typechecking if you provide
36
+ // "project" or "projects" in parserOptions. Removing these options means the parser will
37
+ // only parse one file in isolate mode, which is much, much faster.
38
+ // https://github.com/benmosher/eslint-plugin-import/issues/1408#issuecomment-509298962
39
+ delete parserOptions.project;
40
+ delete parserOptions.projects;
41
+
35
42
  // require the parser relative to the main module (i.e., ESLint)
36
43
  const parser = moduleRequire(parserPath)
37
44
 
@@ -2,7 +2,7 @@
2
2
  exports.__esModule = true
3
3
 
4
4
 
5
- const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[{*]))/m
5
+ const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[{*=]))/m
6
6
  /**
7
7
  * detect possible imports/exports without a full parse.
8
8
  *
@@ -18,7 +18,7 @@ exports.test = function isMaybeUnambiguousModule(content) {
18
18
  }
19
19
 
20
20
  // future-/Babel-proof at the expense of being a little loose
21
- const unambiguousNodeType = /^(Exp|Imp)ort.*Declaration$/
21
+ const unambiguousNodeType = /^(?:(?:Exp|Imp)ort.*Declaration|TSExportAssignment)$/
22
22
 
23
23
  /**
24
24
  * Given an AST, return true if the AST unambiguously represents a module.
@@ -1,3 +1,11 @@
1
+ ## 6.2.1 (2019-07-21)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
6
+
7
+ Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
8
+
1
9
  ## 6.2.0 (2019-07-04)
2
10
 
3
11
  ### Bug fixes