FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Revert "JS deps updates 🐣" · devhttps/frontend@031de58 · GitHub

Revert "JS deps updates 🐣" · devhttps/frontend@031de58 · GitHub
Skip to content

Navigation Menu

Commit 031de58

Browse files
authored
Revert "JS deps updates 🐣"
1 parent 9eba071 commit 031de58

33 files changed

Lines changed: 644 additions & 723 deletions

‎package.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@
5858
"cpy": "^4.0.1",
5959
"cssnano": "^3.8.1",
6060
"cssstats": "^3.0.0",
61-
"eslint": "^3.19.0",
62-
"eslint-config-airbnb": "^14.1.0",
63-
"eslint-config-prettier": "^1.6.0",
61+
"eslint": "^3.16.1",
62+
"eslint-config-airbnb": "13.0.0",
63+
"eslint-config-prettier": "^1.4.1",
6464
"eslint-import-resolver-webpack": "^0.8.0",
6565
"eslint-plugin-flow-header": "https://github.com/eirikurn/eslint-plugin-flow-header",
6666
"eslint-plugin-flowtype": "^2.30.0",
6767
"eslint-plugin-guardian-frontend": "file:dev/eslint-plugin-guardian-frontend",
68-
"eslint-plugin-import": "^2.2.0",
68+
"eslint-plugin-import": "2.2.0",
6969
"eslint-plugin-jasmine": "^1.8.1",
70-
"eslint-plugin-jsx-a11y": "^4.0.0",
70+
"eslint-plugin-jsx-a11y": "2.2.3",
7171
"eslint-plugin-prettier": "^2.0.1",
72-
"eslint-plugin-react": "^6.9.0",
72+
"eslint-plugin-react": "6.8.0",
7373
"esprima": "1.2.2",
7474
"execa": "^0.5.0",
7575
"figures": "^2.0.0",
@@ -82,7 +82,7 @@
8282
"hasha": "^2.2.0",
8383
"jasmine-core": "^2.3.2",
8484
"jest": "^19.0.2",
85-
"jest-teamcity-reporter": "^0.6.2",
85+
"jest-teamcity-reporter": "^0.4.0",
8686
"karma": "^1.3.0",
8787
"karma-coverage": "^1.1.1",
8888
"karma-jasmine": "^1.0.2",
@@ -111,7 +111,7 @@
111111
"postcss": "^5.2.6",
112112
"postcss-pxtorem": "^3.3.1",
113113
"postcss-reporter": "^1.4.1",
114-
"prettier": "^0.22.0",
114+
"prettier": "^0.20.0",
115115
"prettysize": "^0.0.3",
116116
"raw-loader": "^0.5.1",
117117
"request": "^2.81.0",

‎static/src/javascripts/lib/$.spec.js‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ describe('$', () => {
2525
).toEqual('<span class="test-class"></span>');
2626
});
2727

28-
test('applies a function to an array of elements described by a selector', () => {
29-
$.forEachElement('.parent > *', el => el.classList.add('red'));
30-
expect($('.child').hasClass('red')).toBe(true);
31-
expect($('.sibling').hasClass('red')).toBe(true);
32-
});
28+
test(
29+
'applies a function to an array of elements described by a selector',
30+
() => {
31+
$.forEachElement('.parent > *', el => el.classList.add('red'));
32+
expect($('.child').hasClass('red')).toBe(true);
33+
expect($('.sibling').hasClass('red')).toBe(true);
34+
}
35+
);
3336

3437
test("can find an element's ancestor", () => {
3538
expect(

‎static/src/javascripts/lib/sha1.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const Sha1 = {
4545
// add length (in bits) into final pair of 32-bit integers (big-endian) [§5.1.1]
4646
// note: most significant word would be (len-1)*8 >>> 32, but since JS converts
4747
// bitwise-op args to 32 bits, we need to simulate this by arithmetic operators
48-
M[N - 1][14] = (msg.length - 1) * 8 / 2 ** 32;
48+
M[N - 1][14] = (msg.length - 1) * 8 / (2 ** 32);
4949
M[N - 1][14] = Math.floor(M[N - 1][14]);
5050
M[N - 1][15] = (msg.length - 1) * 8 & 0xffffffff;
5151

‎static/src/javascripts/lib/timeout.spec.js‎

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,43 @@ import timeout from 'lib/timeout';
55

66
const chance = new Chance();
77

8-
const wait = time =>
9-
new Promise(resolve => {
10-
setTimeout(resolve, time);
11-
});
8+
const wait = time => new Promise(resolve => {
9+
setTimeout(resolve, time);
10+
});
1211

1312
describe('timeout', () => {
14-
test("resolves with the promised value if the timeout doesn't fire", done => {
15-
const time = chance.integer({ min: 0, max: 10 });
16-
const value = chance.integer();
13+
test(
14+
"resolves with the promised value if the timeout doesn't fire",
15+
done => {
16+
const time = chance.integer({ min: 0, max: 10 });
17+
const value = chance.integer();
1718

18-
timeout(time, Promise.resolve(value))
19-
.then(result => {
20-
expect(result).toBe(value);
21-
return wait(time);
22-
})
23-
.then(done)
24-
.catch(done.fail);
25-
});
19+
timeout(time, Promise.resolve(value))
20+
.then(result => {
21+
expect(result).toBe(value);
22+
return wait(time);
23+
})
24+
.then(done)
25+
.catch(done.fail);
26+
}
27+
);
2628

27-
test("rejects with the promised error if the timeout doesn't fire", done => {
28-
const time = chance.integer({ min: 0, max: 10 });
29-
const message = chance.sentence();
29+
test(
30+
"rejects with the promised error if the timeout doesn't fire",
31+
done => {
32+
const time = chance.integer({ min: 0, max: 10 });
33+
const message = chance.sentence();
3034

31-
timeout(time, Promise.reject(new Error(message)))
32-
.then(done.fail)
33-
.catch(error => {
34-
expect(error.message).toBe(message);
35-
return wait(time);
36-
})
37-
.then(done)
38-
.catch(done.fail);
39-
});
35+
timeout(time, Promise.reject(new Error(message)))
36+
.then(done.fail)
37+
.catch(error => {
38+
expect(error.message).toBe(message);
39+
return wait(time);
40+
})
41+
.then(done)
42+
.catch(done.fail);
43+
}
44+
);
4045

4146
test('rejects with timeout if promise never returns', done => {
4247
const time = chance.integer({ min: 0, max: 10 });

‎static/src/javascripts/lib/url.js‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,13 @@ const replaceQueryString = (params: Object) =>
4949
updateQueryString(params, history.replaceState.bind(history));
5050

5151
// take an Object, construct into a query, e.g. {page: 1, pageSize: 10} => page=1&pageSize=10
52-
const constructQuery = (query: Object): string =>
53-
Object.keys(query)
54-
.map(param => {
55-
const value = query[param];
56-
const queryValue = Array.isArray(value) ? value.join(',') : value;
57-
return `${param}=${queryValue}`;
58-
})
59-
.join('&');
52+
const constructQuery = (query: Object): string => Object.keys(query)
53+
.map(param => {
54+
const value = query[param];
55+
const queryValue = Array.isArray(value) ? value.join(',') : value;
56+
return `${param}=${queryValue}`;
57+
})
58+
.join('&');
6059

6160
const getPath = (url: string): string => {
6261
const a: HTMLAnchorElement = document.createElement('a');

‎static/src/javascripts/projects/common/modules/check-mediator.spec.js‎

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,35 +61,44 @@ describe('Check Mediator', () => {
6161
checkMediator.resolveCheck('check-1', true);
6262
});
6363

64-
test('resolves a check with dependent checks as true when passCondition is EVERYCHECKPASSED', done => {
65-
checkMediator.waitForCheck('check-2').then(result => {
66-
expect(result).toBe(true);
67-
done();
68-
});
64+
test(
65+
'resolves a check with dependent checks as true when passCondition is EVERYCHECKPASSED',
66+
done => {
67+
checkMediator.waitForCheck('check-2').then(result => {
68+
expect(result).toBe(true);
69+
done();
70+
});
6971

70-
checkMediator.resolveCheck('check-3', true);
71-
checkMediator.resolveCheck('check-4', true);
72-
});
72+
checkMediator.resolveCheck('check-3', true);
73+
checkMediator.resolveCheck('check-4', true);
74+
}
75+
);
7376

74-
test('resolves a check with dependent checks as false when passCondition is EVERYCHECKPASSED', done => {
75-
checkMediator.waitForCheck('check-5').then(result => {
76-
expect(result).toBe(false);
77-
done();
78-
});
77+
test(
78+
'resolves a check with dependent checks as false when passCondition is EVERYCHECKPASSED',
79+
done => {
80+
checkMediator.waitForCheck('check-5').then(result => {
81+
expect(result).toBe(false);
82+
done();
83+
});
7984

80-
checkMediator.resolveCheck('check-6', true);
81-
checkMediator.resolveCheck('check-7', false);
82-
});
85+
checkMediator.resolveCheck('check-6', true);
86+
checkMediator.resolveCheck('check-7', false);
87+
}
88+
);
8389

84-
test('resolves a check with dependent checks as true when passCondition is SOMECHECKSPASSED', done => {
85-
checkMediator.waitForCheck('check-8').then(result => {
86-
expect(result).toBe(true);
87-
done();
88-
});
90+
test(
91+
'resolves a check with dependent checks as true when passCondition is SOMECHECKSPASSED',
92+
done => {
93+
checkMediator.waitForCheck('check-8').then(result => {
94+
expect(result).toBe(true);
95+
done();
96+
});
8997

90-
checkMediator.resolveCheck('check-9', true);
91-
checkMediator.resolveCheck('check-10', false);
92-
});
98+
checkMediator.resolveCheck('check-9', true);
99+
checkMediator.resolveCheck('check-10', false);
100+
}
101+
);
93102

94103
test('rejects a check if not registered', done => {
95104
checkMediator.waitForCheck('check-666').catch(error => {

‎tools/__tasks__/compile/conf/copy.js‎

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@ const { conf, target, hash, src } = require('../../config').paths;
55

66
module.exports = {
77
description: 'Copy assets',
8-
task: () =>
9-
Promise.all([
10-
cpy(['curl.js'], conf, {
11-
cwd: path.resolve(
12-
path.dirname(require.resolve('curl')),
13-
'..',
14-
'dist',
15-
'curl-with-js-and-domReady'
16-
),
17-
}),
18-
cpy(
19-
['**/head*.css', 'inline/**/*.css'],
20-
path.resolve(conf, 'inline-stylesheets'),
21-
{
22-
cwd: path.resolve(target, 'stylesheets'),
23-
}
8+
task: () => Promise.all([
9+
cpy(['curl.js'], conf, {
10+
cwd: path.resolve(
11+
path.dirname(require.resolve('curl')),
12+
'..',
13+
'dist',
14+
'curl-with-js-and-domReady'
2415
),
25-
cpy(['**/assets.map'], path.resolve(conf), {
26-
cwd: path.resolve(hash, 'assets'),
27-
}),
28-
cpy(['polyfill.io'], path.resolve(conf), {
29-
cwd: path.resolve(src, 'javascripts'),
30-
}),
31-
]),
16+
}),
17+
cpy(
18+
['**/head*.css', 'inline/**/*.css'],
19+
path.resolve(conf, 'inline-stylesheets'),
20+
{
21+
cwd: path.resolve(target, 'stylesheets'),
22+
}
23+
),
24+
cpy(['**/assets.map'], path.resolve(conf), {
25+
cwd: path.resolve(hash, 'assets'),
26+
}),
27+
cpy(['polyfill.io'], path.resolve(conf), {
28+
cwd: path.resolve(src, 'javascripts'),
29+
}),
30+
]),
3231
};

‎tools/__tasks__/compile/css/sass.js‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,22 @@ module.exports = {
55
task: [
66
{
77
description: 'Old IE',
8-
task: () =>
9-
compile('old-ie.*.scss', {
10-
browsers: 'Explorer 8',
11-
remify: false,
12-
}),
8+
task: () => compile('old-ie.*.scss', {
9+
browsers: 'Explorer 8',
10+
remify: false,
11+
}),
1312
},
1413
{
1514
description: 'IE9',
16-
task: () =>
17-
compile('ie9.*.scss', {
18-
browsers: 'Explorer 9',
19-
}),
15+
task: () => compile('ie9.*.scss', {
16+
browsers: 'Explorer 9',
17+
}),
2018
},
2119
{
2220
description: 'Email',
23-
task: () =>
24-
compile('head.email-{article,front}.scss', {
25-
remify: false,
26-
}),
21+
task: () => compile('head.email-{article,front}.scss', {
22+
remify: false,
23+
}),
2724
},
2825
{
2926
description: 'Modern',

‎tools/__tasks__/compile/fonts/index.js‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,29 @@ const toDataURI = (srcPath, data) =>
2424
.extname(srcPath)
2525
.substr(1)]};base64,${data.toString()})`;
2626

27-
const generateCSS = (fontFamily, font) =>
28-
readFile(path.resolve(src, 'fonts', `${font.src}`), 'base64')
29-
.then(data =>
30-
postcss([perfectionist({ format: 'compressed' })]).process(
31-
`
27+
const generateCSS = (fontFamily, font) => readFile(
28+
path.resolve(src, 'fonts', `${font.src}`),
29+
'base64'
30+
)
31+
.then(data => postcss([perfectionist({ format: 'compressed' })]).process(
32+
`
3233
@font-face {
3334
font-family: ${fontFamily};
3435
src: ${toDataURI(font.src, data)};
3536
${[
36-
'font-weight',
37-
'font-style',
38-
'font-stretch',
39-
'font-variant',
40-
'font-feature-settings',
41-
'unicode-range',
42-
]
43-
.map(prop => font[prop] ? `${prop}: ${font[prop]};` : '')
44-
.join('')}
37+
'font-weight',
38+
'font-style',
39+
'font-stretch',
40+
'font-variant',
41+
'font-feature-settings',
42+
'unicode-range',
43+
]
44+
.map(prop => font[prop] ? `${prop}: ${font[prop]};` : '')
45+
.join('')}
4546
}
4647
`
47-
))
48-
.then(result => result.css);
48+
))
49+
.then(result => result.css);
4950

5051
module.exports = {
5152
description: 'Compile fonts',

‎tools/__tasks__/compile/hash/index.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ module.exports = {
113113
);
114114
})
115115
.then(normalisedAssetMap => // save the asset map
116-
mkdirpp(path.resolve(hash, 'assets')).then(() =>
116+
mkdirpp(
117+
path.resolve(hash, 'assets')
118+
).then(() =>
117119
writeFile(
118120
path.resolve(hash, 'assets', 'assets.map'),
119121
JSON.stringify(normalisedAssetMap, null, 4)

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.

Back | FazBrowse Home | New Git URL