Skip to content

Commit 461742b

Browse files
committed
fix: fix eslint config rules
Signed-off-by: Alexandre Philibeaux <[email protected]>
1 parent 3d63b26 commit 461742b

File tree

16 files changed

+37
-17
lines changed

16 files changed

+37
-17
lines changed

eslint.config.mjs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ export default [
2525
defaultVersion: '18', // Default React version to use when the version you have installed cannot be detected.
2626
// If not provided, defaults to the latest React version.
2727
},
28+
'import/resolver': {
29+
typescript: {
30+
project: [
31+
'./tsconfig.json', // Root config
32+
'./packages/**/tsconfig.json',
33+
],
34+
},
35+
},
2836
},
2937
languageOptions: {
3038
globals: {
@@ -35,7 +43,6 @@ export default [
3543
...scw.map(config => ({ ...config, files: ['**/*.js'] })),
3644
{
3745
files: ['**/*.js'],
38-
3946
languageOptions: {
4047
parser: babelParser,
4148
parserOptions: {
@@ -56,7 +63,9 @@ export default [
5663
sourceType: 'script',
5764

5865
parserOptions: {
59-
project: ['tsconfig.json'],
66+
project: ['tsconfig.json', 'packages/**/tsconfig.json'],
67+
projectService: true,
68+
tsconfigRootDir: import.meta.dirname,
6069
},
6170
},
6271
},
@@ -73,7 +82,7 @@ export default [
7382
sourceType: 'script',
7483

7584
parserOptions: {
76-
project: ['tsconfig.json'],
85+
project: ['tsconfig.json', 'packages/**/tsconfig.json'],
7786
},
7887
},
7988

packages/cookie-consent/src/CookieConsentProvider/CookieConsentProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type { SerializeOptions } from 'cookie'
21
import cookie from 'cookie'
3-
import type { PropsWithChildren } from 'react'
2+
import type { SerializeOptions } from 'cookie'
43
import {
54
createContext,
65
useCallback,
@@ -9,6 +8,7 @@ import {
98
useMemo,
109
useState,
1110
} from 'react'
11+
import type { PropsWithChildren } from 'react'
1212
import { uniq } from '../helpers/array'
1313
import { stringToHash } from '../helpers/misc'
1414
import { isCategoryKind } from './helpers'

packages/eslint-config-react/shared.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ export default [
3737
},
3838

3939
groups: [
40-
['builtin', 'external'],
40+
'builtin',
41+
'external',
4142
'internal',
4243
'parent',
4344
'sibling',
4445
'index',
46+
// "type",
4547
],
4648
'newlines-between': 'never',
4749
},

packages/eslint-config-react/stylistic.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ export default [
4141
'@stylistic/arrow-parens': 'off',
4242
'@stylistic/multiline-ternary': 'off',
4343
'@stylistic/no-trailing-spaces': 'off',
44+
'@stylistic/comma-style': 'off',
45+
'@stylistic/func-call-spacing': 'off',
46+
'@stylistic/jsx-wrap-multilines': 'off',
47+
'@stylistic/member-delimiter-style': 'off',
48+
'@stylistic/jsx-curly-brace-presence': 'off',
49+
'@stylistic/jsx-curly-newline': 'off',
50+
'@stylistic/jsx-one-expression-per-line': 'off',
51+
'@stylistic/max-statements-per-line ': 'off',
4452
// -------------------------------------- ///
4553

4654
'@stylistic/brace-style': defaultAirBnbRules['brace-style'],

packages/eslint-config-react/typescript.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default [
1919
'airbnb-base',
2020
'plugin:@typescript-eslint/recommended',
2121
'plugin:@typescript-eslint/recommended-requiring-type-checking',
22+
'plugin:import/recommended',
2223
'plugin:import/typescript',
2324
),
2425
),

packages/use-dataloader/src/DataLoaderProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { ReactElement, ReactNode } from 'react'
21
import { createContext, useCallback, useContext, useMemo, useRef } from 'react'
2+
import type { ReactElement, ReactNode } from 'react'
33
import {
44
DEFAULT_MAX_CONCURRENT_REQUESTS,
55
KEY_IS_NOT_STRING_ERROR,

packages/use-i18n/src/__tests__/formatDate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, test } from 'vitest'
2-
import type { FormatDateOptions } from '../formatDate'
32
import formatDate, { supportedFormats } from '../formatDate'
3+
import type { FormatDateOptions } from '../formatDate'
44

55
const locales = ['en', 'fr', 'de', 'ro', 'es']
66

packages/use-i18n/src/__tests__/formatUnit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, test } from 'vitest'
2-
import type { FormatUnitOptions } from '../formatUnit'
32
import formatUnit, { supportedUnits } from '../formatUnit'
3+
import type { FormatUnitOptions } from '../formatUnit'
44

55
const locales = ['en', 'fr', 'ro']
66

packages/use-i18n/src/formatters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { NumberFormatOptions } from '@formatjs/ecma402-abstract'
2-
import type { Cache } from '@formatjs/fast-memoize'
32
import { memoize, strategies } from '@formatjs/fast-memoize'
3+
import type { Cache } from '@formatjs/fast-memoize'
44
import IntlTranslationFormat from 'intl-messageformat'
55

66
// Deeply inspired by https://github.com/formatjs/formatjs/blob/7406e526a9c5666cee22cc2316dad1fa1d88697c/packages/intl-messageformat/src/core.ts

0 commit comments

Comments
 (0)