Skip to content

Commit fc447d2

Browse files
authored
Merge pull request #798 from Sim-sat/only-export-components
fix(lint): only-export-components
2 parents ab31594 + 366f0fe commit fc447d2

9 files changed

Lines changed: 7 additions & 10 deletions

File tree

SparkyFitnessFrontend/eslint.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export default tseslint.config(
8181
{
8282
files: ['src/hooks/**/*.{ts,tsx}'],
8383
rules: {
84+
'react-refresh/only-export-components': 'off',
8485
'no-restricted-imports': [
8586
'error',
8687
{
@@ -122,5 +123,11 @@ export default tseslint.config(
122123
rules: {
123124
'react-refresh/only-export-components': 'off',
124125
},
126+
},
127+
{
128+
files: ['src/contexts/**/*.{ts,tsx}'],
129+
rules: {
130+
'react-refresh/only-export-components': 'off',
131+
},
125132
}
126133
);

SparkyFitnessFrontend/src/contexts/ActiveUserContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const ActiveUserContext = createContext<ActiveUserContextType | undefined>(
2121
undefined
2222
);
2323

24-
// eslint-disable-next-line react-refresh/only-export-components
2524
export const useActiveUser = () => {
2625
const context = useContext(ActiveUserContext);
2726
if (context === undefined) {

SparkyFitnessFrontend/src/contexts/ChatbotVisibilityContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const ChatbotVisibilityContext = createContext<
1212
ChatbotVisibilityContextType | undefined
1313
>(undefined);
1414

15-
// eslint-disable-next-line react-refresh/only-export-components
1615
export const useChatbotVisibility = () => {
1716
const context = useContext(ChatbotVisibilityContext);
1817
if (!context) {

SparkyFitnessFrontend/src/contexts/PreferencesContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ const PreferencesContext = createContext<PreferencesContextType | undefined>(
140140
undefined
141141
);
142142

143-
// eslint-disable-next-line react-refresh/only-export-components
144143
export const usePreferences = () => {
145144
const context = useContext(PreferencesContext);
146145
if (!context) {

SparkyFitnessFrontend/src/contexts/ThemeContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ interface ThemeContextType {
1515

1616
const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
1717

18-
// eslint-disable-next-line react-refresh/only-export-components
1918
export const useTheme = () => {
2019
const context = useContext(ThemeContext);
2120
if (!context) {

SparkyFitnessFrontend/src/contexts/WaterContainerContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export const WaterContainerProvider: React.FC<{ children: ReactNode }> = ({
7474
);
7575
};
7676

77-
// eslint-disable-next-line react-refresh/only-export-components
7877
export const useWaterContainer = () => {
7978
const context = useContext(WaterContainerContext);
8079
if (context === undefined) {

SparkyFitnessFrontend/src/hooks/useAuth.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({
236236
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
237237
};
238238

239-
// eslint-disable-next-line react-refresh/only-export-components
240239
export const useAuth = () => {
241240
const context = useContext(AuthContext);
242241
if (context === undefined) {

SparkyFitnessFrontend/src/pages/Reports/BodyBatteryGauge.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,4 @@ const BodyBatteryGauge: React.FC<BodyBatteryGaugeProps> = ({
155155
);
156156
};
157157

158-
// eslint-disable-next-line react-refresh/only-export-components
159-
export { getBodyBatteryStatusInfo };
160158
export default BodyBatteryGauge;

SparkyFitnessFrontend/src/pages/Reports/SpO2Gauge.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,4 @@ const SpO2Gauge = ({ value, size = 160, strokeWidth = 12 }: SpO2GaugeProps) => {
120120
);
121121
};
122122

123-
// eslint-disable-next-line react-refresh/only-export-components
124-
export { getSpO2StatusInfo };
125123
export default SpO2Gauge;

0 commit comments

Comments
 (0)