Skip to content

Eslint config is broken and is not working + enhancing it by add some rules #9190

Closed

Description

@MV88

Description

I checked current config is broken and has never worked since March 2021 !
check here the broken part https://github.com/geosolutions-it/MapStore2/blob/master/utility/eslint/index.js#L235

now we got
✖4095 problems (4095 errors, 0 warnings)
with --fix becomes
✖ 3869 problems (3869 errors, 0 warnings)

338 PropType is defined but prop is never used "react/no-unused-prop-types": 2
185 render should be placed after
3308 is missing in props validation "react/prop-types": [2, { "ignore": ["children"] }],

enhancements

in order to improve the current codebase we can add the following rules

  • "react/no-unused-prop-types": 2,
  • "object-curly-spacing": [2, "never"], that has autofix
  • "comma-dangle": [ 2, "always-multiline" ], that has autofix

How to reproduce

  • check lint running in actions or locally, both in a project and in the main mapstore repo

Expected Result

to work fine with no errors

Current Result

actually it is not executed because of some errors, you can notice this with vscode if you open

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

Activity

  1. added this to the 2023.02.00 milestone on May 24, 2023
  2. self-assigned this
    on May 24, 2023
  3. offtherailz commented on May 24, 2023

    @offtherailz
    Member

    My opinions about new rules:

    • "react/no-unused-prop-types": 2, LGTM
    • "object-curly-spacing": [2, "never"], that has autofix - LGTM
    • "comma-dangle": [ 2, "always-multiline" ], that has autofix - I personally do not like it to much, because JSON can not have this form in any case, so for constistency, I'd prefer to continue writing the same way. Anyway I understand the advantages in terms of code manipulation and diff

    I can suggest also for the future

    • eslint object-curly-newline: ["error", { "consistent": true }]
    • Formatting JSON too

    Anyway, in general, I'd like to reduce as much as possible our style rules in favor of standard ones, if possible, so we do not have to maintain a custom eslint configuration. We should see if there is some common used standard config that matches our requirements, maybe the best option

  4. MV88 commented on May 24, 2023

    @MV88
    ContributorAuthor

    just want pin out that "comma-dangle" rule is not applied to json, but i feel it is kinda handy to have it,
    feel free to reject it, no problem for me

  5. modified the milestones: 2023.02.00, 2024.01.00 on Sep 14, 2023
  6. tdipisa commented on Mar 4, 2024

    @tdipisa
    Member

    Closed in favor of #10005

  7. removed this from the 2024.01.00 milestone on Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions