Skip to content

Commit

Permalink
Update esllint and other dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Jul 14, 2024
1 parent a596a55 commit 2bde980
Show file tree
Hide file tree
Showing 7 changed files with 292 additions and 223 deletions.
2 changes: 0 additions & 2 deletions server/.eslintignore

This file was deleted.

6 changes: 3 additions & 3 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,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 @@ -55,7 +55,7 @@ try {
nconf.defaults(configFromFile);
} catch (error) {
console.error('Error reading configuration file:', error);
// eslint-disable-next-line unicorn/no-process-exit

process.exit(1);
}

Expand Down
53 changes: 53 additions & 0 deletions server/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: ['config/*', 'public/**/*']
},
...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

0 comments on commit 2bde980

Please sign in to comment.