Skip to content

Commit 03eb7aa

Browse files
committed
chore(ci): upgrade to lighthouserc.js
1 parent cde4a48 commit 03eb7aa

File tree

3 files changed

+49
-38
lines changed

3 files changed

+49
-38
lines changed

.lighthouserc.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* @license Copyright 2019 Google Inc. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5+
*/
6+
'use strict';
7+
8+
module.exports = {
9+
ci: {
10+
assert: {
11+
preset: 'lighthouse:recommended',
12+
assertions: {
13+
'dom-size': ['error', {maxNumericValue: 3000}],
14+
15+
'uses-rel-preload': 'off',
16+
'uses-responsive-images': 'off',
17+
'uses-rel-preconnect': 'off',
18+
'offscreen-images': 'off',
19+
'unused-javascript': 'off',
20+
21+
label: 'off',
22+
'content-width': 'off',
23+
'color-contrast': 'off',
24+
bypass: 'off',
25+
'tap-targets': 'off',
26+
27+
'apple-touch-icon': 'off',
28+
'maskable-icon': 'off',
29+
'installable-manifest': 'off',
30+
'offline-start-url': 'off',
31+
'service-worker': 'off',
32+
'splash-screen': 'off',
33+
'themed-omnibox': 'off',
34+
'works-offline': 'off',
35+
},
36+
},
37+
upload: {
38+
urlReplacementPatterns: [
39+
's/[0-9a-f]{12}$/HASH/',
40+
's#:[0-9]{3,5}/#:PORT/#',
41+
's/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/UUID/ig',
42+
],
43+
},
44+
},
45+
};

lighthouserc.json

-35
This file was deleted.

packages/utils/test/lighthouserc.test.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@ describe('lighthouserc.js', () => {
239239
});
240240

241241
it('.json', () => {
242-
const expected = path.join(LH_ROOT, 'lighthouserc.json');
243-
expect(rc.findRcFile(LH_ROOT)).toEqual(expected);
242+
tempFile = path.join(tempDir, 'lighthouserc.json');
243+
writeJSONFile(tempFile, {});
244+
expect(rc.findRcFile(tempDir)).toEqual(tempFile);
244245
});
245246

246247
it('.yaml', () => {
@@ -261,7 +262,7 @@ describe('lighthouserc.js', () => {
261262
});
262263

263264
it('should find an rcfile find-up-style when recursive is true', () => {
264-
const expected = path.join(LH_ROOT, 'lighthouserc.json');
265+
const expected = path.join(LH_ROOT, '.lighthouserc.js');
265266
expect(rc.findRcFile(__dirname, {recursive: true})).toEqual(expected);
266267
});
267268

0 commit comments

Comments
 (0)