Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

48 changes: 48 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: 2.1

jobs:
build:
docker:
- image: cimg/node:20.17
working_directory: ~/project
steps:
- checkout
- restore_cache:
keys:
- v1-npm-deps-{{ checksum "package-lock.json" }}
- v1-npm-deps-
- run:
name: Install dependencies
command: npm ci
- save_cache:
key: v1-npm-deps-{{ checksum "package-lock.json" }}
paths:
- ~/.npm
- run:
name: Lint
command: npm run lint
- run:
name: Check formatting
command: npm run format:check
- run:
name: Run tests with coverage
command: npm run test
- run:
name: Build application
command: npm run build
- run:
name: Prepare artifacts
command: |
mkdir -p dist
mkdir -p coverage
- store_artifacts:
path: dist
destination: dist
- store_artifacts:
path: coverage
destination: coverage

workflows:
ci:
jobs:
- build
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Companion file for eslint-plugin-import `import/no-unused-modules` under ESLint flat config.
* See https://github.com/import-js/eslint-plugin-import/issues/3079
*/
module.exports = {
root: true,
ignorePatterns: ['dist', 'node_modules', 'coverage'],
};
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,17 @@
# dependencies
/node_modules

# build output
/dist
/coverage
/coverage/

# local env
.env
.env.*

# production
/build

# misc
.DS_Store
12 changes: 12 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh

set -euo pipefail
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-commit hook is not portable

Medium Severity

The pre-commit hook's set -euo pipefail isn't supported by common sh implementations like dash. On such systems, the script exits early, preventing lint-staged from running and blocking commits.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0164ed6. Configure here.


echo ""
echo "🔍 Running pre-commit checks (lint-staged)..."

if ! npm run lint-staged; then
echo ""
echo "❌ Linting or formatting failed. Fix issues before committing."
exit 1
fi
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.17.0
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
build
coverage
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"semi": true,
"trailingComma": "es5",
"printWidth": 90
}
109 changes: 109 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import js from '@eslint/js';
import globals from 'globals';
import importPlugin from 'eslint-plugin-import';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import testingLibrary from 'eslint-plugin-testing-library';
import unusedImports from 'eslint-plugin-unused-imports';
import vitestPlugin from 'eslint-plugin-vitest';

export default [
{
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
},
js.configs.recommended,
{
files: ['**/*.{js,jsx}'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint command cannot run

Medium Severity

Adding eslint.config.mjs switches ESLint to flat config, but the existing npm run lint still passes --ext. ESLint 9 rejects --ext in flat-config mode, so the new CI lint step fails before checking files.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0164ed6. Configure here.

languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.es2024,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
import: importPlugin,
'unused-imports': unusedImports,
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.json'],
},
},
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'import/no-unused-modules': [
'error',
{
unusedExports: true,
ignoreExports: [
'src/**/*.test.js',
'src/**/*.test.jsx',
'src/mocks/**',
/** Internal surfaces: same-file “private” exports and re-exports for the partition feature. */
'src/features/drilldown/utils.js',
'src/features/drilldown/selectors.js',
'src/components/common/partition/partitionChartOptions.js',
'src/features/partition/dmaPartitionModel.js',
'src/app/store.js',
'src/index.jsx',
'vite.config.js',
'vitest.config.mjs',
],
},
],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule breaks existing exports

Medium Severity

import/no-unused-modules is enabled without ignoring existing dual named/default exports like DmaIcicleDrillBridge and DmaPartitionChart. npm run lint now fails on unchanged source files, so the new CI pipeline cannot pass.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0164ed6. Configure here.

},
},
{
files: ['**/*.{test,spec}.{js,jsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.es2024,
...globals.vitest,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'testing-library': testingLibrary,
vitest: vitestPlugin,
},
rules: {
...testingLibrary.configs.react.rules,
...vitestPlugin.configs.recommended.rules,
'import/no-unused-modules': 'off',
},
},
];
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Simple Adder</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./src/index.jsx"></script>
</body>
</html>
Loading