Skip to content
Snippets Groups Projects
Commit 03810c9a authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

chore(deps): update typescript-eslint monorepo to v6 (major)

parent bb193db6
No related branches found
No related tags found
2 merge requests!124MEP,!113chore(deps): update typescript-eslint monorepo to v6 (major)
.eslintrc.js
\ No newline at end of file
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/eslint-recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
'eslint:recommended',
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:react-hooks/recommended',
'react-app',
],
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
root: true,
overrides: [
{
files: ['**/*.{ts,tsx}'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
// This enables a lot of type checking
// 'plugin:@typescript-eslint/recommended-requiring-type-checking', // Uses the recommended rules from @typescript-eslint/eslint-plugin
'plugin:@typescript-eslint/stylistic-type-checked',
],
files: ['**/*.{ts,tsx}'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
......@@ -30,16 +33,11 @@ module.exports = {
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off', // fixes a build error
},
},
],
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
'react/react-in-jsx-scope': 'off',
......
......@@ -16,7 +16,7 @@ const ImagePicker: React.FC<ImagePickerProps> = ({
imageURL,
handleChange,
}) => {
const [imageNames, setImageNames] = useState<Array<string[]>>([])
const [imageNames, setImageNames] = useState<string[][]>([])
const [selectedImageURL, setSelectedImageURL] = useState<string>(
imageURL && imageURL !== null ? imageURL : ''
)
......
......@@ -18,7 +18,7 @@ import Loader from '../Loader/Loader'
import CustomEditor from '../Newsletter/CustomEditor'
import './popups.scss'
const OPTIONS: Array<Option> = [
const OPTIONS: Option[] = [
{
value: durationEnum.hours,
label: 'Heures',
......
......@@ -7,9 +7,10 @@ import Newsletter from '../Newsletter/Newsletter'
import Popups from '../Popups/Popups'
import Prices from '../Prices/Prices'
export const links: {
[key: string]: { label: string; path: string; adminOnly?: boolean }
} = {
export const links: Record<
string,
{ label: string; path: string; adminOnly?: boolean }
> = {
newsletter: {
label: 'Newsletter',
path: '/newsletter',
......
......@@ -4,7 +4,7 @@ declare module '*.svg' {
}
declare module '*.scss' {
const styles: { [className: string]: string }
const styles: Record<string, string>
export default styles
}
......
......@@ -17,5 +17,5 @@
"jsx": "react-jsx",
"useUnknownInCatchVariables": false
},
"include": ["src"]
"include": ["**/*.ts", "**/*.tsx"]
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment