Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use eslint 9 #2151

Merged
merged 1 commit into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

63 changes: 63 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import prettier from 'eslint-plugin-prettier';
import unicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [
{
ignores: [
'browserscripts/*',
'tools/*',
'test/data/*',
'docker/webpagereplay/*',
'vendor/*'
]
},
...compat.extends('eslint:recommended', 'plugin:unicorn/recommended'),
{
plugins: {
prettier,
unicorn
},

languageOptions: {
globals: {
...globals.node
},

ecmaVersion: 'latest',
sourceType: 'module'
},

rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'none',
arrowParens: 'avoid',
embeddedLanguageFormatting: 'off'
}
],

'no-extra-semi': 'off',
'no-mixed-spaces-and-tabs': 'off',
'no-unexpected-multiline': 'off',
'no-return-await': 'error',
'require-atomic-updates': 'off',
'unicorn/filename-case': 'off',
'unicorn/prevent-abbreviations': 'off'
}
}
];
2 changes: 1 addition & 1 deletion lib/chrome/networkManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class NetworkManager {

async waitForNetworkIdle() {
const startTime = Date.now();
// eslint-disable-next-line no-constant-condition

while (true) {
const now = Date.now();
const sinceLastResponseRequest =
Expand Down
3 changes: 2 additions & 1 deletion lib/core/engine/command/measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ export class Measure {

const alias = this.options.urlMetaData
? this.options.urlMetaData[url]
: undefined || this.result[this.numberOfMeasuredPages].alias;
: // eslint-disable-next-line no-constant-binary-expression
undefined || this.result[this.numberOfMeasuredPages].alias;
const res = await this.engineDelegate.afterPageCompleteCheck(
this.browser,
this.index,
Expand Down
2 changes: 1 addition & 1 deletion lib/firefox/networkManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class NetworkManager {
});

const startTime = Date.now();
// eslint-disable-next-line no-constant-condition

while (true) {
const now = Date.now();
const sinceLastResponseRequest =
Expand Down
Loading
Loading