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

Upgrade ESLint and Prettier #1496

Merged
merged 2 commits into from
Jul 23, 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
16 changes: 0 additions & 16 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

1 change: 0 additions & 1 deletion DEPENDENCY-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ As of 2024 June 17:
The `npm outdated` command reports some dependencies as outdated. They are not being updated at this time for the reasons given below:

- `chalk`: major version 5 causes problems for jest. Keep updated to latest 4.x release.
- `eslint`: version 8.57.0 is the newest version supported by `@typescript-eslint` packages. Update this package when the `@typescript-eslint` packages' support is updated.
- `html-minifier-terser`: major version 6 changes the functions we use to become async, which would require changing more or less the entirety of SUSHI's export functions to async.
- `junk`: major version 4 is an esmodule.
- `title-case`: major version 4 is an esmodule.
Expand Down
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
Loading