Skip to content

Commit

Permalink
Merge pull request #6356 from entur/eslint-9
Browse files Browse the repository at this point in the history
Eslint 9 upgrades
  • Loading branch information
leonardehrenfried authored Jan 2, 2025
2 parents ac8058b + 57898e6 commit c5ba6e8
Show file tree
Hide file tree
Showing 9 changed files with 1,342 additions and 1,158 deletions.
42 changes: 0 additions & 42 deletions client/.eslintrc.cjs

This file was deleted.

4 changes: 3 additions & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ node_modules
dist
dist-ssr
*.local
output

# Editor directories and files
.vscode/*
Expand All @@ -27,4 +28,5 @@ dist-ssr
src/gql/

# Vite cache folder
.vite/
.vite/

2 changes: 1 addition & 1 deletion client/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
dist/
output/
src/gql/
40 changes: 40 additions & 0 deletions client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import importPlugin from 'eslint-plugin-import'
import tseslint from 'typescript-eslint'
import eslintConfigPrettier from "eslint-config-prettier"

export default tseslint.config(
{ ignores: ['output', 'node_modules', 'src/gql/**/*'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react': react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'jsx-a11y': jsxA11y,
'import': importPlugin
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
'@typescript-eslint/ban-ts-comment': "off",
'@typescript-eslint/no-unused-vars': ["error", { "caughtErrors": "all", "caughtErrorsIgnorePattern": "^_" }]
},
},
eslintConfigPrettier,
)
Loading

0 comments on commit c5ba6e8

Please sign in to comment.