Skip to content

Commit

Permalink
infra: migrate to eslint@9 (#2539)
Browse files Browse the repository at this point in the history
  • Loading branch information
AviVahl authored Aug 3, 2024
1 parent dca837d commit b0dc5ef
Show file tree
Hide file tree
Showing 14 changed files with 741 additions and 564 deletions.
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

54 changes: 0 additions & 54 deletions .eslintrc

This file was deleted.

51 changes: 51 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { fixupPluginRules } from '@eslint/compat';
import pluginJs from '@eslint/js';
import configPrettier from 'eslint-config-prettier';
import pluginNoOnlyTests from 'eslint-plugin-no-only-tests';
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import pluginTypescript from 'typescript-eslint';

/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: ['**/dist/', '**/dist-engine/', '**/*.{js,mjs,cjs}'] },
pluginJs.configs.recommended,

...pluginTypescript.configs.recommendedTypeChecked,
{ languageOptions: { parserOptions: { projectService: true } } },

pluginReact.configs.flat.recommended,
// pluginReact.configs.flat['jsx-runtime'],
{ settings: { react: { version: 'detect' } } },

{
plugins: {
'react-hooks': pluginReactHooks,
'no-only-tests': fixupPluginRules(pluginNoOnlyTests),
},
},
configPrettier,

{
rules: {
// "no-console": "error",
'no-empty-pattern': 'off',
'react/prop-types': 'off',
// "react-hooks/rules-of-hooks": "error",
'react-hooks/exhaustive-deps': 'error',
'no-only-tests/no-only-tests': 'error',

'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/unbound-method': 'off',
},
},
];
Loading

0 comments on commit b0dc5ef

Please sign in to comment.