Skip to content

Commit

Permalink
Upgrade ESLint and Prettier
Browse files Browse the repository at this point in the history
ESLint is a major update which required a new configuration file format as well as using an 8.0.0 alpha version of @typescript-eslint.

Also fixed all violations reported by updated ESLint and Prettier.
  • Loading branch information
cmoesel committed Jul 22, 2024
1 parent 1e1297a commit d534e4e
Show file tree
Hide file tree
Showing 19 changed files with 289 additions and 271 deletions.
16 changes: 0 additions & 16 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

54 changes: 54 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import tsParser from '@typescript-eslint/parser';
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: [
'dist/*',
'coverage/*',
'build*/*',
'**/*.d.ts',
'src/public/',
'src/types/',
'regression/output*',
'**/generated'
]
},
...compat.extends('plugin:@typescript-eslint/recommended', 'prettier'),
{
languageOptions: {
parser: tsParser,
ecmaVersion: 2018,
sourceType: 'module'
},

rules: {
semi: ['error', 'always'],

quotes: [
'error',
'single',
{
avoidEscape: true
}
],

'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'off'
}
}
];
Loading

0 comments on commit d534e4e

Please sign in to comment.