🚨(frontend) fix some eslint warnings

- Eslint tried to search some configs in the node_modules folder,
we ignore node_modules in the eslint config now.
- Adapt next eslint to use next/babel.
This commit is contained in:
Anthony LC
2024-01-26 13:12:45 +01:00
committed by Anthony LC
parent ce55721b5d
commit cbe356214d
9 changed files with 15 additions and 3 deletions

View File

@@ -10,5 +10,5 @@ module.exports = {
rootDir: __dirname,
},
},
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: ['node_modules', '.eslintrc.js'],
};

View File

@@ -4,11 +4,11 @@ import { CunninghamProvider } from '@openfun/cunningham-react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import './globals.css';
import { useCunninghamTheme } from '@/cunningham';
import '@/i18n/initI18n';
import './globals.css';
const queryClient = new QueryClient();
export default function RootLayout({

View File

@@ -5,4 +5,5 @@ module.exports = {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
ignorePatterns: ["node_modules"],
};

View File

@@ -17,4 +17,5 @@ module.exports = {
sourceType: 'module',
ecmaVersion: 'latest',
},
ignorePatterns: ['node_modules'],
};

View File

@@ -48,6 +48,7 @@ const globalRules = {
],
pathGroupsExcludedImportTypes: ['builtin'],
'newlines-between': 'always',
warnOnUnassignedImports: true,
},
],
'no-alert': 'error',

View File

@@ -46,4 +46,5 @@ module.exports = {
},
},
],
ignorePatterns: ['node_modules'],
};

View File

@@ -8,6 +8,11 @@ module.exports = {
'plugin:@tanstack/eslint-plugin-query/recommended',
'plugin:jsx-a11y/recommended',
],
parserOptions: {
babelOptions: {
presets: [require.resolve('next/babel')],
},
},
settings: {
'jsx-a11y': {
polymorphicPropName: 'as',
@@ -26,4 +31,5 @@ module.exports = {
'react-hooks/exhaustive-deps': 'error',
},
overrides: common.eslintTS,
ignorePatterns: ['node_modules'],
};

View File

@@ -21,4 +21,5 @@ module.exports = {
plugins: ['playwright'],
},
],
ignorePatterns: ['node_modules'],
};

View File

@@ -7,4 +7,5 @@ module.exports = {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
ignorePatterns: ['node_modules'],
};