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 +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +7 -37
- data/app/assets/javascripts/govuk_publishing_components/components/govspeak.js +2 -2
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +87 -45
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +18 -13
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/accessible-autocomplete/package.json +1 -1
- data/node_modules/eslint-module-utils/CHANGELOG.md +10 -0
- data/node_modules/eslint-module-utils/package.json +12 -12
- data/node_modules/eslint-module-utils/parse.js +8 -1
- data/node_modules/eslint-module-utils/unambiguous.js +2 -2
- data/node_modules/standard/node_modules/acorn/CHANGELOG.md +8 -0
- data/node_modules/standard/node_modules/acorn/dist/acorn.d.ts +1 -1
- data/node_modules/standard/node_modules/acorn/dist/acorn.js +14 -8
- data/node_modules/standard/node_modules/acorn/dist/acorn.mjs +14 -8
- data/node_modules/standard/node_modules/acorn/package.json +10 -10
- metadata +2 -4
- data/app/assets/javascripts/govuk_publishing_components/vendor/jquery-ui-1.10.2.custom.js +0 -1639
- data/app/assets/javascripts/govuk_publishing_components/vendor/jquery.player.min.js +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa3b2ab5c6bae378fcfbc364a38f985840b75717cdcf7d36c30ff52cb1b21c69
|
4
|
+
data.tar.gz: bdb08fde76441407c58750c41322d2fe458a80611998076482a26c9da97d677f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
//
|
47
|
-
if (this
|
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.
|
93
|
-
|
94
|
-
|
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
|
-
|
111
|
-
|
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 ($
|
17
|
-
var enhancement = new window.GOVUK.GovspeakYoutubeLinkEnhancement($
|
16
|
+
this.embedYoutube = function ($jqElement) {
|
17
|
+
var enhancement = new window.GOVUK.GovspeakYoutubeLinkEnhancement($jqElement[0])
|
18
18
|
enhancement.init()
|
19
19
|
}
|
20
20
|
|
data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
CHANGED
@@ -1,71 +1,89 @@
|
|
1
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
26
|
-
|
27
|
-
|
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.
|
33
|
+
return $link.getAttribute('data-youtube-player') === 'off'
|
34
34
|
}
|
35
35
|
|
36
|
-
YoutubeLinkEnhancement.prototype.
|
37
|
-
var
|
36
|
+
YoutubeLinkEnhancement.prototype.setupVideo = function ($link, videoId) {
|
37
|
+
var elementId = YoutubeLinkEnhancement.nextId()
|
38
38
|
|
39
|
-
$link.
|
39
|
+
var parentPara = $link.parentNode
|
40
|
+
var parentContainer = parentPara.parentNode
|
40
41
|
|
41
|
-
var
|
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
|
-
|
44
|
-
|
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.
|
52
|
-
var
|
53
|
-
|
54
|
-
|
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
|
-
|
60
|
-
|
61
|
-
if (
|
62
|
-
|
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.
|
67
|
-
var cookiePolicy = window.GOVUK.
|
68
|
-
return cookiePolicy !==
|
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
|
-
})(
|
145
|
+
})()
|
data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss
CHANGED
@@ -5,18 +5,23 @@
|
|
5
5
|
// - alphagov/whitehall: ✔︎
|
6
6
|
// - alphagov/govspeak: ✔︎
|
7
7
|
|
8
|
-
.gem-c-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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 (
|
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
|
@@ -49,7 +49,7 @@
|
|
49
49
|
"/"
|
50
50
|
],
|
51
51
|
"_resolved": "git://github.com/alphagov/accessible-autocomplete.git#3523dd9fffc70cbd9f6f555f75863c33a709f49e",
|
52
|
-
"_shasum": "
|
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.
|
18
|
+
"_id": "eslint-module-utils@2.4.1",
|
19
19
|
"_inCache": true,
|
20
20
|
"_location": "/eslint-module-utils",
|
21
|
-
"_nodeVersion": "
|
21
|
+
"_nodeVersion": "12.6.0",
|
22
22
|
"_npmOperationalInternal": {
|
23
23
|
"host": "s3://npm-registry-packages",
|
24
|
-
"tmp": "tmp/eslint-module-utils_2.4.
|
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.
|
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.
|
45
|
-
"_shasum": "
|
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-
|
65
|
-
"shasum": "
|
66
|
-
"tarball": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.
|
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":
|
69
|
-
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\
|
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.
|
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*[{
|
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
|