Skip to content

Commit

Permalink
ESLint 9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ronny130286 committed Dec 1, 2024
1 parent 54d4e9e commit ed41285
Show file tree
Hide file tree
Showing 6 changed files with 2,794 additions and 208 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

54 changes: 0 additions & 54 deletions .eslintrc.js

This file was deleted.

77 changes: 77 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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: ['**/build/', '**/.prettierrc.js', '**/.eslintrc.js', 'admin/words.js', '**/test/', '.dev-server/**'],
},
...compat.extends('plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'),
{
plugins: {},

languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',

parserOptions: {
project: './tsconfig.json',
},
},

rules: {
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-explicit-any': 'off',

'@typescript-eslint/no-use-before-define': [
'error',
{
functions: false,
typedefs: false,
classes: false,
},
],

'@typescript-eslint/no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
},
],

'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
},
],

'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'no-var': 'error',
'prefer-const': 'error',
'no-trailing-spaces': 'error',
},
},
{
files: ['**/*.test.ts'],

rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
];
Loading

0 comments on commit ed41285

Please sign in to comment.