Skip to content

fix: configure patches for linter#1027

Open
ht1204 wants to merge 1 commit into
mate-academy:mainfrom
ht1204:developer
Open

fix: configure patches for linter#1027
ht1204 wants to merge 1 commit into
mate-academy:mainfrom
ht1204:developer

Conversation

@ht1204
Copy link
Copy Markdown

@ht1204 ht1204 commented Oct 10, 2025

Description

  • Testing suite approach for split integer.
  • ESlinter proposal configuration.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

I am approving your submission because the splitInteger functionality and its Jest tests meet the core requirements and run as expected. Nice job covering the main behaviors (equal splits, non-equal ascending splits, and cases where value < parts).

Minor improvements (non-blocking):

  • eslint.config.js: If your project isn’t ESM, switch to CommonJS (require/module.exports), and map globals values to strings like 'readonly' to avoid ESLint flat-config interpretation issues.
  • .eslintrc.js: Consider using 'off' instead of 0 for rule levels for clarity.
  • .github/workflows/test.yml: Consider adding Node 18.x to the matrix and using newer action versions plus npm ci for CI reliability.

Optional enhancement: Add a property-based test that asserts sum equals value, length equals numberOfParts, sorted order, and max - min <= 1 across more inputs. Overall, well done.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread eslint.config.js
@@ -0,0 +1,22 @@
import globals from "globals";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You're using top-level ES module syntax (import / export default) here. Ensure your project is configured for ESM (package.json contains "type": "module") or convert this file to CommonJS (const globals = require('globals') / module.exports = [...]). If your environment doesn't support ESM, ESLint will fail to load this config. Also, note that the globals package is CommonJS — when using ESM interop you may want to import it as import * as globals from 'globals' to avoid getting undefined (depending on your bundler/Node version).

Comment thread eslint.config.js
Comment on lines +8 to +10
globals: {
...globals.node,
...globals.jest,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

languageOptions.globals in the flat config usually expects values like "readonly" or "writable" (strings). The globals package exports objects whose values are booleans (or may not match the string form). Spreading ...globals.node and ...globals.jest here will put those boolean values into the config which may not be interpreted as intended by ESLint. Consider mapping them, for example:

const mapToReadonly = (g) => Object.fromEntries(Object.keys(g).map(k => [k, 'readonly']));
...
globals: {
  ...mapToReadonly(globals.node),
  ...mapToReadonly(globals.jest),
},

Or verify your ESLint version accepts boolean globals in the flat config format.

strategy:
matrix:
node-version: [12.x]
node-version: [20.x]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The workflow matrix only includes Node 20.x. Consider expanding this to include at least the current LTS (for example, 18.x) so your tests run against multiple supported Node versions and surface compatibility issues earlier. If you intentionally want to test only Node 20, add a short comment explaining that decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants