Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into btudpates
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Apr 19, 2024
2 parents dcce67c + 8f7f4e1 commit 755d784
Show file tree
Hide file tree
Showing 2,469 changed files with 744,966 additions and 1,110,627 deletions.
6 changes: 3 additions & 3 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Copyright 2017 The Lighthouse Authors. All Rights Reserved.
* 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
* 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.
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';

Expand Down
14 changes: 8 additions & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
**/third_party/**
**/source-maps/**

lighthouse-cli/test/fixtures/byte-efficiency/bundle.js
cli/test/fixtures/byte-efficiency/bundle.js

/dist/**
dist

coverage/**

!.eslintrc.js
!.eslintrc.cjs

lighthouse-core/lib/cdt/generated/SourceMap.js
lighthouse-core/scripts/legacy-javascript/variants
core/scripts/legacy-javascript/variants

third-party/**

# ignore d.ts files until we can properly lint them
*.d.ts
**/*.d.ts
**/*.d.cts

page-functions-test-case*out*.js
120 changes: 120 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';

/**
* eslint does not support ESM rc files, so this must be a .cjs file.
* @see https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats
* @see https://github.com/eslint/eslint/issues/13481
*/

module.exports = {
// All subdirectory eslintrcs extend from this one.
root: true,
// start with google standard style
// https://github.com/google/eslint-config-google/blob/master/index.js
extends: ['eslint:recommended', 'google'],
plugins: [
'eslint-plugin-local-rules',
'eslint-plugin-import',
],
env: {
node: true,
es6: true,
},
rules: {
// 2 == error, 1 == warning, 0 == off
'import/order': [2, {
'groups': [
'builtin',
'external',
['sibling', 'parent'],
'index',
'object',
'type',
],
'newlines-between': 'always',
}],
'import/group-exports': 2,
'import/exports-last': 2,
'eqeqeq': 2,
'indent': [2, 2, {
SwitchCase: 1,
VariableDeclarator: 2,
CallExpression: {arguments: 'off'},
MemberExpression: 'off',
FunctionExpression: {body: 1, parameters: 2},
ignoredNodes: [
'ConditionalExpression > :matches(.consequent, .alternate)',
'VariableDeclarator > ArrowFunctionExpression > :expression.body',
'CallExpression > ArrowFunctionExpression > :expression.body',
],
}],
'no-floating-decimal': 2,
'max-len': [2, 100, {
ignorePattern: 'readJson\\(|^import ',
ignoreComments: true,
ignoreUrls: true,
tabWidth: 2,
}],
'no-empty': [2, {
allowEmptyCatch: true,
}],
'no-implicit-coercion': [2, {
boolean: false,
number: true,
string: true,
}],
'no-unused-expressions': [2, {
allowShortCircuit: true,
allowTernary: false,
}],
'no-unused-vars': [2, {
vars: 'all',
args: 'after-used',
argsIgnorePattern: '(^reject$|^_+$)',
varsIgnorePattern: '(^_$|^LH$|^Lantern$)',
}],
'no-cond-assign': 2,
'space-infix-ops': 2,
'strict': [2, 'global'],
'prefer-const': 2,
'curly': [2, 'multi-line'],
'comma-dangle': [2, {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
}],
'operator-linebreak': ['error', 'after', {'overrides': {'?': 'ignore', ':': 'ignore'}}],

// Custom lighthouse rules
'local-rules/require-file-extension': 2,

// Disabled rules
'require-jsdoc': 0,
'valid-jsdoc': 0,
'arrow-parens': 0,
},
overrides: [
{
files: ['cli/test/smokehouse/test-definitions/*.js'],
rules: {
'max-len': 0,
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
globalReturn: true,
jsx: false,
},
sourceType: 'module',
},
};
93 changes: 0 additions & 93 deletions .eslintrc.js

This file was deleted.

5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.js eol=lf
**/locales/*.json linguist-generated=true
**/locales/*.json linguist-generated=true
build/** linguist-generated=false
report/assets/styles.css linguist-generated=false
report/renderer/components.js linguist-generated=true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ about: Suggest an idea to us!

<!-- Before creating an feature request please make sure you are using the latest version. -->

<!-- If this is a new audit please review the audit doc https://github.com/GoogleChrome/lighthouse/blob/master/docs/new-audits.md -->
<!-- If this is a new audit please review the audit doc https://github.com/GoogleChrome/lighthouse/blob/main/docs/new-audits.md -->

**Feature request summary**
<!-- Describe what you want to be added -->
Expand Down
23 changes: 18 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ body:
id: faq
attributes:
label: FAQ
description: Please double check that this isn't one of our most common questions already answered by [documentation]((https://github.com/GoogleChrome/lighthouse/blob/master/docs).
description: Please double check that this isn't one of our most common questions already answered by [documentation]((https://github.com/GoogleChrome/lighthouse/blob/main/docs).
options:
- label: Yes, my issue is not about [variability](https://github.com/GoogleChrome/lighthouse/blob/master/docs/variability.md) or [throttling](https://github.com/GoogleChrome/lighthouse/blob/master/docs/throttling.md).
- label: Yes, my issue is not about [variability](https://github.com/GoogleChrome/lighthouse/blob/main/docs/variability.md) or [throttling](https://github.com/GoogleChrome/lighthouse/blob/main/docs/throttling.md).
required: true
- label: Yes, my issue is not about a specific accessibility audit (file with [axe-core](https://github.com/dequelabs/axe-core) instead).
required: true
Expand Down Expand Up @@ -59,28 +59,41 @@ body:
- node
- PageSpeed Insights
- Chrome DevTools
- web.dev
- WebPageTest
- Other
validations:
required: true
- type: input
id: version
attributes:
label: Lighthouse Version
description: What version of Lighthouse were you using? The version of Lighthouse can be found at the bottom of every report.
description: >
What version of Lighthouse were you using? The version of Lighthouse can be found at the bottom of every report. (Note: if using the CLI, you should be using the latest version, see https://github.com/GoogleChrome/lighthouse/releases)
validations:
required: true
- type: input
id: chromeversion
attributes:
label: Chrome Version
description: What version of Chrome were you using? (Only applicable if you ran locally)
description: >
What version of Chrome were you using? (Only applicable if you ran locally using Node, the CLI or DevTools) (Note: you should be using at least the Stable version of Chrome, see https://chromiumdash.appspot.com/releases. If you are not on a recent version, first try upgrading Chrome.)
validations:
required: false
- type: input
id: nodeversion
attributes:
label: Node Version
description: What version of node.js were you using? (Only applicable to CLI and node)
description: >
What version of node.js were you using? (Only applicable to CLI and node) (Note: the minimum Node version we support is 14.15.0)
validations:
required: false
- type: input
id: os
attributes:
label: OS
description: >
What OS are you using? (Note: specific granularity not necessary, enough to say Windows / Mac / Linux, etc.)
validations:
required: false
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
Thank you for submitting a pull request!
See CONTRIBUTING.MD for help in getting a change landed.
https://github.com/GoogleChrome/lighthouse/blob/master/CONTRIBUTING.md
https://github.com/GoogleChrome/lighthouse/blob/main/CONTRIBUTING.md
-->

**Summary**
Expand Down
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: '/'
allow:
- "production"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
include: "scope"
- package-ecosystem: 'github-actions' # Necessary to update action hash
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 2
20 changes: 15 additions & 5 deletions .github/scripts/bump-nightly-version.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
#!/usr/bin/env bash

##
# @license Copyright 2020 The Lighthouse Authors. All Rights Reserved.
# 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
# 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.
# @license
# Copyright 2020 Google LLC
# SPDX-License-Identifier: Apache-2.0
##

set -euxo pipefail

DATE=$(date --date=yesterday '+%Y%m%d')
PATCH=$(node -e "console.log(require('./package.json').version)")
node lighthouse-core/scripts/release/bump-versions.js "$PATCH-dev.$DATE"
PKG_VERSION=$(node -e "console.log(require('./package.json').version)")
BASE_VERSION="$PKG_VERSION-dev.$DATE"
VERSION="$BASE_VERSION"

i=0
while npx [email protected] lighthouse "$VERSION"
do
((i++))
VERSION="$BASE_VERSION-$i"
done

node core/scripts/release/bump-versions.js "$VERSION"
Loading

0 comments on commit 755d784

Please sign in to comment.