Skip to content

Commit

Permalink
Merge pull request #819 from swaroopar/feature/fixStyles
Browse files Browse the repository at this point in the history
enable eslint for CSS modules
  • Loading branch information
iskey committed May 25, 2024
2 parents 86654eb + 358ce69 commit bec033d
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 15 deletions.
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@
"plugin:@typescript-eslint/strict-type-checked",
"plugin:prettier/recommended",
"plugin:deprecation/recommended",
"plugin:react/recommended"
"plugin:react/recommended",
"plugin:css-modules/recommended"
],
"plugins": [
"react",
"@typescript-eslint",
"@tanstack/query",
"require-explicit-generics"
"require-explicit-generics",
"css-modules"
],
"rules": {
"react/jsx-uses-react": "error",
Expand All @@ -61,7 +63,14 @@
{
"count": 1
}
]
],
"css-modules/no-undef-class": [
2,
{
"camelCase": true
}
],
"css-modules/no-unused-class": "off"
},
"ignorePatterns": [
"src/xpanse-api/**",
Expand Down Expand Up @@ -107,6 +116,7 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-react-app": "7.0.1",
"eslint-plugin-css-modules": "^2.12.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Descriptions, Space, Tag } from 'antd';
import React from 'react';
import appStyles from '../../../../../styles/app.module.css';
import catalogStyles from '../../../../../styles/catalog.module.css';
import registerStyles from '../../../../../styles/register.module.css';
import oclDisplayStyles from '../../../../../styles/ocl-display.module.css';
import { ServiceTemplateDetailVo } from '../../../../../xpanse-api/generated';
import { ApiDoc } from '../../../common/doc/ApiDoc';
import { AgreementText } from '../../../common/ocl/AgreementText';
Expand All @@ -30,7 +30,7 @@ function ServiceDetail({ serviceDetails }: { serviceDetails: ServiceTemplateDeta
</h3>
<Space size={[0, 8]} wrap>
{serviceDetails.regions.map((region) => (
<Tag key={region.name} className={registerStyles.oclDisplayTag} color='orange'>
<Tag key={region.name} className={oclDisplayStyles.oclDisplayTag} color='orange'>
{region.area ? `${region.area}: ${region.name}` : region.name}
</Tag>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { EnvironmentOutlined } from '@ant-design/icons';
import { Divider, Empty, Image, Tabs } from 'antd';
import { Empty, Image, Tabs } from 'antd';
import { Tab } from 'rc-tabs/lib/interface';
import React, { useMemo } from 'react';
import { createSearchParams, useNavigate, useSearchParams } from 'react-router-dom';
Expand Down Expand Up @@ -211,8 +211,6 @@ function ServiceProvider({
updateServiceHostingType={onChangeServiceHostingType}
/>
<ServiceDetail serviceDetails={activeServiceDetail} />

<Divider />
<ServicePolicies
key={activeServiceDetail.id}
serviceDetails={activeServiceDetail}
Expand Down
2 changes: 0 additions & 2 deletions src/components/content/common/ocl/DisplayOclData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ function DisplayOclData({ ocl }: { ocl: Ocl }): React.JSX.Element | string {
{ocl.name}
</Paragraph>
</Tooltip>
<br />
<br />
</div>
<div>
<b>Cloud Service Provider</b>
Expand Down
4 changes: 3 additions & 1 deletion src/components/content/credentials/AddCredential.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import TextArea from 'antd/es/input/TextArea';
import { ColumnsType } from 'antd/es/table';
import React, { ChangeEvent, useCallback, useEffect, useRef, useState } from 'react';
import credentialStyles from '../../../styles/credential.module.css';
import cspSelectStyles from '../../../styles/csp-select-drop-down.module.css';

import {
AdminService,
ApiError,
Expand Down Expand Up @@ -360,7 +362,7 @@ function AddCredential({ role, onCancel }: { role: string | undefined; onCancel:
<Select loading={getActiveCspsQuery.isLoading} onSelect={handleCspSelect} size={'large'}>
{activeCspList.current.map((csp: CredentialVariables.csp) => {
return (
<Select.Option key={csp} value={csp} className={credentialStyles.cspSelectDropDown}>
<Select.Option key={csp} value={csp} className={cspSelectStyles.cspSelectDropDown}>
<Image
className={credentialStyles.customSelect}
width={100}
Expand Down
6 changes: 3 additions & 3 deletions src/components/content/credentials/UpdateCredential.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function UpdateCredential({
render: (value: string, record) =>
record.isMandatory ? (
<Tooltip placement='topLeft' title={value}>
<span className={styles.addCredentialFromVariablesValue}>*</span>
<span className={styles.addCredentialFormVariablesValue}>*</span>
{value}
</Tooltip>
) : (
Expand Down Expand Up @@ -235,7 +235,7 @@ function UpdateCredential({
msg={tipMessage}
onRemove={onRemove}
></CredentialTip>
<div className={styles.credentialFromInput}>
<div className={styles.credentialFormInput}>
<Form.Item label='Csp' name='csp'>
<Image
width={100}
Expand Down Expand Up @@ -264,7 +264,7 @@ function UpdateCredential({
></Table>
</Form.Item>
</div>
<Form.Item className={styles.credentialFromButton}>
<Form.Item className={styles.credentialFormButton}>
<Button
type='primary'
loading={updateCredentialRequest.isPending}
Expand Down
3 changes: 2 additions & 1 deletion src/components/layouts/footer/LayoutFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

import { Layout } from 'antd';
import React from 'react';
import appStyles from '../../../styles/app.module.css';
import { footerText } from '../../utils/constants';

function LayoutFooter(): React.JSX.Element {
return <Layout.Footer>{footerText}</Layout.Footer>;
return <Layout.Footer className={appStyles.antLayoutFooter}>{footerText}</Layout.Footer>;
}

export default LayoutFooter;

0 comments on commit bec033d

Please sign in to comment.