Skip to content

Commit

Permalink
Upgrade ESLint and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer committed Oct 15, 2024
1 parent 49081d8 commit 6af9e90
Show file tree
Hide file tree
Showing 12 changed files with 734 additions and 695 deletions.
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ updates:
- dependency-name: 'node-fetch'
update-types:
- 'version-update:semver-major'
- dependency-name: 'eslint'
update-types:
- 'version-update:semver-major'
87 changes: 87 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/* eslint-disable import/no-named-as-default-member */

import js from '@eslint/js';
import vitest from '@vitest/eslint-plugin';
import prettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default [
{
ignores: [
'.git/*',
'.vscode/*',
'coverage/*',
'dist/*',
'node_modules/*',
'playwright-report/*',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
prettier,
{
files: ['**/*.{js,mjs,cjs,ts,cts,mts}'],
languageOptions: {
globals: {
...globals.node,
...globals.es2021,
},
parserOptions: {
project: ['tsconfig.json', 'tests/tsconfig.json'],
warnOnUnsupportedTypeScriptVersion: false,
},
},
plugins: { 'simple-import-sort': simpleImportSort },
settings: {
'import/resolver': {
typescript: {
project: ['tsconfig.json', 'tests/tsconfig.json'],
},
},
},
rules: {
'@typescript-eslint/consistent-type-imports': [
1,
{ fixStyle: 'inline-type-imports' },
],
'no-console': 1,
'no-warning-comments': ['warn', { terms: ['todo', 'fixme', '@@@'] }],
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': ['error', { 'prefer-inline': true }],
'import/order': 'off',
},
},
{
files: ['src/**/*.{js,mjs,cjs,ts,cts,mts}'],
languageOptions: {
globals: {
...globals.browser,
...globals.es2021,
},
},
},
{
files: ['tests/**/*.{spec,test}.{js,ts}'],
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
'@typescript-eslint/unbound-method': 'off',
},
},
];
Loading

0 comments on commit 6af9e90

Please sign in to comment.