🚨(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:
@@ -10,5 +10,5 @@ module.exports = {
|
|||||||
rootDir: __dirname,
|
rootDir: __dirname,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ignorePatterns: ['.eslintrc.js'],
|
ignorePatterns: ['node_modules', '.eslintrc.js'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import { CunninghamProvider } from '@openfun/cunningham-react';
|
|||||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
||||||
|
|
||||||
import './globals.css';
|
|
||||||
|
|
||||||
import { useCunninghamTheme } from '@/cunningham';
|
import { useCunninghamTheme } from '@/cunningham';
|
||||||
import '@/i18n/initI18n';
|
import '@/i18n/initI18n';
|
||||||
|
|
||||||
|
import './globals.css';
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ module.exports = {
|
|||||||
tsconfigRootDir: __dirname,
|
tsconfigRootDir: __dirname,
|
||||||
project: ["./tsconfig.json"],
|
project: ["./tsconfig.json"],
|
||||||
},
|
},
|
||||||
|
ignorePatterns: ["node_modules"],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,4 +17,5 @@ module.exports = {
|
|||||||
sourceType: 'module',
|
sourceType: 'module',
|
||||||
ecmaVersion: 'latest',
|
ecmaVersion: 'latest',
|
||||||
},
|
},
|
||||||
|
ignorePatterns: ['node_modules'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const globalRules = {
|
|||||||
],
|
],
|
||||||
pathGroupsExcludedImportTypes: ['builtin'],
|
pathGroupsExcludedImportTypes: ['builtin'],
|
||||||
'newlines-between': 'always',
|
'newlines-between': 'always',
|
||||||
|
warnOnUnassignedImports: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'no-alert': 'error',
|
'no-alert': 'error',
|
||||||
|
|||||||
@@ -46,4 +46,5 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
ignorePatterns: ['node_modules'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ module.exports = {
|
|||||||
'plugin:@tanstack/eslint-plugin-query/recommended',
|
'plugin:@tanstack/eslint-plugin-query/recommended',
|
||||||
'plugin:jsx-a11y/recommended',
|
'plugin:jsx-a11y/recommended',
|
||||||
],
|
],
|
||||||
|
parserOptions: {
|
||||||
|
babelOptions: {
|
||||||
|
presets: [require.resolve('next/babel')],
|
||||||
|
},
|
||||||
|
},
|
||||||
settings: {
|
settings: {
|
||||||
'jsx-a11y': {
|
'jsx-a11y': {
|
||||||
polymorphicPropName: 'as',
|
polymorphicPropName: 'as',
|
||||||
@@ -26,4 +31,5 @@ module.exports = {
|
|||||||
'react-hooks/exhaustive-deps': 'error',
|
'react-hooks/exhaustive-deps': 'error',
|
||||||
},
|
},
|
||||||
overrides: common.eslintTS,
|
overrides: common.eslintTS,
|
||||||
|
ignorePatterns: ['node_modules'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,4 +21,5 @@ module.exports = {
|
|||||||
plugins: ['playwright'],
|
plugins: ['playwright'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
ignorePatterns: ['node_modules'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ module.exports = {
|
|||||||
tsconfigRootDir: __dirname,
|
tsconfigRootDir: __dirname,
|
||||||
project: ['./tsconfig.json'],
|
project: ['./tsconfig.json'],
|
||||||
},
|
},
|
||||||
|
ignorePatterns: ['node_modules'],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user