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

Update to Eslint 9 #60

Merged
merged 1 commit into from
Jul 14, 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
2 changes: 0 additions & 2 deletions testrunner/.eslintignore

This file was deleted.

7 changes: 3 additions & 4 deletions testrunner/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ if (nconf.get('help')) {
'--config Path to a JSON/yaml configuration file that will replace default config.'
);
console.log('--version The version number.');
// eslint-disable-next-line unicorn/no-process-exit

process.exit();
}

if (nconf.get('version')) {
console.log(version);
// eslint-disable-next-line unicorn/no-process-exit

process.exit();
}

Expand All @@ -73,14 +73,13 @@ try {
nconf.defaults(configFromFile);
} catch (error) {
console.error('Error reading configuration file:', error);
// eslint-disable-next-line unicorn/no-process-exit

process.exit(1);
}

try {
validate(getFilteredConfig());
} catch {
// eslint-disable-next-line unicorn/no-process-exit
process.exit(1);
}

Expand Down
53 changes: 53 additions & 0 deletions testrunner/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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: ['sitespeed-result/*', 'default/*']
},
...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'
}
],

'require-atomic-updates': 0,
'no-extra-semi': 0,
'no-mixed-spaces-and-tabs': 0
}
}
];
Loading