Skip to content

Commit 0c677f8

Browse files
committed
resolve merge conflicts'
2 parents 52332f0 + b70f3ec commit 0c677f8

File tree

521 files changed

+53317
-18585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

521 files changed

+53317
-18585
lines changed

.eslintrc.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module.exports = {
2+
ignorePatterns: ['**/*.css'],
3+
env: {
4+
browser: true,
5+
es6: true,
6+
node: true,
7+
},
8+
settings: {
9+
react: {
10+
version: 'detect',
11+
},
12+
'import/resolver': {
13+
node: {
14+
paths: ['src'],
15+
extensions: ['.js', '.jsx'],
16+
},
17+
},
18+
},
19+
extends: [
20+
'airbnb',
21+
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
22+
'plugin:react-hooks/recommended',
23+
'plugin:react/jsx-runtime',
24+
'plugin:import/recommended',
25+
'prettier/react',
26+
'plugin:prettier/recommended', // use prettier as a eslint rule
27+
],
28+
globals: {
29+
Atomics: 'readonly',
30+
SharedArrayBuffer: 'readonly',
31+
},
32+
parser: 'babel-eslint',
33+
parserOptions: {
34+
ecmaFeatures: {
35+
jsx: true,
36+
},
37+
ecmaVersion: 2018,
38+
sourceType: 'module',
39+
},
40+
plugins: ['react', 'testing-library', 'prettier'],
41+
rules: {
42+
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
43+
'no-underscore-dangle': 'off',
44+
'react/prop-types': 'off',
45+
'react-hooks/exhaustive-deps': 'off',
46+
'react/jsx-key': 'off',
47+
'react/jsx-uses-react': 'off',
48+
'react/display-name': 'off',
49+
'react/no-direct-mutation-state': 'off',
50+
'react/no-unknown-property': 'off',
51+
'react/destructuring-assignment': 'off',
52+
'react/react-in-jsx-scope': 'off',
53+
'import/no-duplicates': 'off',
54+
'import/no-named-as-default': 'off',
55+
'jsx-a11y/label-has-associated-control': 'off',
56+
'jsx-a11y/no-static-element-interactions': 'off',
57+
'jsx-a11y/click-events-have-key-events': 'off',
58+
'jsx-a11y/control-has-associated-label': 'off',
59+
'no-alert': 'error',
60+
'no-console': 'error',
61+
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
62+
},
63+
overrides: [
64+
{
65+
files: ['**/*.test.js', '**/*.test.jsx'],
66+
env: {
67+
jest: true,
68+
},
69+
},
70+
],
71+
};

.eslintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"rules": {
3+
"no-restricted-imports": [
4+
"error",
5+
{
6+
"patterns": [
7+
"*.css",
8+
"!*.module.css",
9+
"!index.css"
10+
]
11+
}
12+
]
13+
}
14+
}

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
concurrency:
88
group: Build and Deploy / ${{ github.ref_name == 'main' && 'Production' || 'Development' }}
99
cancel-in-progress: true
10-
jobs:
10+
jobs:
1111
# Build
1212
build:
1313
name: Build
@@ -62,4 +62,4 @@ jobs:
6262
domain: ${{ vars.SURGE_DOMAIN }}
6363
project: './build'
6464
login: ${{ secrets.SURGE_LOGIN }}
65-
token: ${{ secrets.SURGE_TOKEN }}
65+
token: ${{ secrets.SURGE_TOKEN }}

.github/workflows/pull_request_test.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,41 @@ on:
55
branches:
66
- development
77
jobs:
8+
# CSS Enforcement
9+
css-check:
10+
name: Enforce CSS Modules
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Check for disallowed .css files in changed files
19+
run: |
20+
# Get list of changed CSS files in this PR
21+
changed_files=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD | grep '\.css$' || true)
22+
23+
if [ -z "$changed_files" ]; then
24+
echo "No CSS files changed in this PR"
25+
exit 0
26+
fi
27+
28+
echo "Changed CSS files:"
29+
echo "$changed_files"
30+
31+
# Check if any of the changed files are disallowed
32+
disallowed=$(echo "$changed_files" | grep -vE '(\.module\.css$|index\.css$)' || true)
33+
34+
if [ -n "$disallowed" ]; then
35+
echo "❌ Disallowed CSS file detected! Only '.module.css' (or 'index.css') files are permitted."
36+
echo "The following files violate the CSS Module policy:"
37+
echo "$disallowed"
38+
exit 1
39+
else
40+
echo "✅ CSS Module Enforcement Check passed - all changed CSS files are valid"
41+
fi
42+
843
test:
944
runs-on: ubuntu-latest
1045
steps:
@@ -20,4 +55,4 @@ jobs:
2055
- name: Run Unit Tests for Changed Files Only
2156
run: yarn run test:changed
2257
- name: Run Lint
23-
run: yarn run lint
58+
run: yarn run lint

.husky/pre-commit

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,25 @@
33

44
echo ""
55
echo "🛡️ Husky pre-commit hook triggered"
6+
7+
# Block plain .css files (except .module.css and index.css)
8+
for file in $(git diff --cached --name-only --diff-filter=ACM | grep '\.css$'); do
9+
case "$file" in
10+
*index.css) ;; # allow index.css
11+
*.module.css) ;; # allow module.css
12+
*)
13+
echo "$file is not allowed. Use .module.css instead."
14+
exit 1
15+
;;
16+
esac
17+
done
18+
619
echo "🛠️ Attempting to auto-fix lint issues (if possible)..."
720
echo "🔍 Running ESLint via lint-staged on staged files:"
8-
git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx)$' || echo "No JS/TS files staged."
21+
git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx|css)$' || echo "No JS/TS/CSS files staged."
922

1023
# Run lint-staged only if relevant files are staged
11-
if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx)$'; then
24+
if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx|css)$'; then
1225
npx lint-staged
1326
lint_exit_code=$?
1427

@@ -20,5 +33,5 @@ if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx)$'; then
2033
exit $lint_exit_code
2134
fi
2235
else
23-
echo "ℹ️ No JS/TS files to lint. Skipping lint-staged."
36+
echo "ℹ️ No JS/TS/CSS files to lint. Skipping lint-staged."
2437
fi

.stylelintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"no-duplicate-selectors": true
4+
}
5+
}

dummy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// trigger reopen

eslint.config.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,9 @@ module.exports = [
2929
'public/**',
3030
'build/**',
3131
// Ignore test files inside /src/components
32-
'src/components/BMDashboard/_tests_/BMDashboard.test.jsx',
3332
'src/components/Reports/PeopleReport/components/PeopleTasksPieChart.test.jsx',
3433
// Ignore entire component folders
3534
'src/components/Badge/**',
36-
'src/components/Projects/**',
37-
'src/components/SummaryManagement/**',
38-
'src/components/TeamMemberTasks/**',
39-
'src/components/Teams/TeamMembersPopup.jsx',
40-
'src/components/UserProfile/**',
41-
'src/components/Announcements/index.jsx',
4235
],
4336
},
4437

jest.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616

1717
// Bundle mapper for d3 import and other custom mocks
1818
moduleNameMapper: {
19-
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
19+
'^d3$': '<rootDir>/src/__mocks__/d3.js',
2020
'react-leaflet': '<rootDir>/src/_tests_/__mocks__/react-leaflet.js',
2121
'marker-cluster-group': '<rootDir>/src/_tests_/__mocks__/react-leaflet-cluster.js',
2222
'\\.(css|less|scss|sass)$': 'identity-obj-proxy', // <-- Added to mock CSS/SCSS files
@@ -38,7 +38,12 @@ module.exports = {
3838
testURL: 'http://localhost',
3939

4040
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
41-
transformIgnorePatterns: ['/node_modules/(?!d3|d3-array|internmap|delaunator|robust-predicates)'],
41+
transformIgnorePatterns: [
42+
'/node_modules/(?!d3|d3-[^/]+|internmap|delaunator|robust-predicates)/',
43+
],
44+
transform: {
45+
'^.+\\.[jt]sx?$': 'babel-jest',
46+
},
4247

4348
// Indicates whether each individual test should be reported during the run
4449
verbose: false,

0 commit comments

Comments
 (0)