Skip to content

Commit

Permalink
feat: upgrade ESLint to version 9 (#1558)
Browse files Browse the repository at this point in the history
  • Loading branch information
pospisilf authored Oct 9, 2024
1 parent 0cc4673 commit 8143dcc
Show file tree
Hide file tree
Showing 11 changed files with 430 additions and 494 deletions.
54 changes: 0 additions & 54 deletions .eslintrc.json

This file was deleted.

66 changes: 66 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// eslint.config.js

import { defineConfig } from 'eslint-define-config';
import ts from '@typescript-eslint/parser';
import tsEslint from '@typescript-eslint/eslint-plugin';
import stylisticEslint from '@stylistic/eslint-plugin';

export default defineConfig([
{
ignores: ['**/*.test.js'],
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: ts,
parserOptions: {
ecmaVersion: 2024,
sourceType: 'module',
project: './tsconfig.json',
ecmaFeatures: {
impliedStrict: true,
},
},
globals: {
// declare global variables here
browser: 'readonly',
es2024: true,
mocha: 'readonly',
},
},
plugins: {
'@typescript-eslint': tsEslint,
'@stylistic': stylisticEslint,
},
rules: {
'@typescript-eslint/no-var-requires': 'off', // allows require statements outside of imports
'@typescript-eslint/no-floating-promises': 'warn',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
caughtErrors: 'none', // ignore unused variables in catch blocks
},
],
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
],
'@stylistic/semi': 'warn',
curly: 'warn',
eqeqeq: ['warn', 'always'],
'no-redeclare': 'warn',
'no-throw-literal': 'warn',
},
},
]);
Loading

0 comments on commit 8143dcc

Please sign in to comment.