Skip to content

Commit

Permalink
chore: Upgrade to ESLint 9 (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas authored May 25, 2024
1 parent f206489 commit ade8b99
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 159 deletions.
16 changes: 0 additions & 16 deletions .eslintrc

This file was deleted.

47 changes: 47 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import prettier from 'eslint-plugin-prettier';
import _import from 'eslint-plugin-import';
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 [
...compat.extends('eslint:recommended', 'prettier'),
{
plugins: {
prettier,
import: _import
},

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

ecmaVersion: 2022,
sourceType: 'module'
},

rules: {
'no-unused-vars': ['error', { caughtErrors: 'none' }],
'prettier/prettier': [
'error',
{
singleQuote: true,
printWidth: 120
}
],

'import/no-unresolved': 2
}
}
];
1 change: 0 additions & 1 deletion lib/featured-slide.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
import _ from 'lodash';
import createDebug from 'debug';
import { getHost, getPort, getOptions, getPuppeteerLaunchConfig } from './config.js';
Expand Down
1 change: 0 additions & 1 deletion lib/print.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
import path from 'node:path';
import createDebug from 'debug';
import { getPuppeteerLaunchConfig, getPageOptions, revealBasePath } from './config.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default async () => {

const server = app.listen(port);

console.log(`Reveal-server started at http://${host}:${port}`); // eslint-disable-line no-console
console.log(`Reveal-server started at http://${host}:${port}`);

return [server, `http://${host}:${port}/${initialPath}`];
};
1 change: 0 additions & 1 deletion lib/static.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
import fs from 'fs-extra';
import path from 'node:path';
import _ from 'lodash';
Expand Down
Loading

0 comments on commit ade8b99

Please sign in to comment.