fluid-project / fluid-lint-all

Consolidated linting logic free from any particular build technology
BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

esllint.json check reports errors when sourceType is module #51

Closed jobara closed 1 year ago

jobara commented 2 years ago

Describe the bug

When your code is a module, you need to set the sourceType to module in the eslint's parser options. However doing this causes the eslint.json check to report (-1:1) 'use strict' is unnecessary inside of modules. error for all checked json files.

I tried setting the following configuration in .fluidlintallrc.json but it didn't help. In the end I disabled the eslint.json check.

    "eslint": {
        "json": {
            "options": {
                "overrideConfig": {
                    "rules": {
                        "strict": ["error", "never"]
                    }
                }
            }
        }
    }

To reproduce

Steps to reproduce the behavior:

  1. In .eslintrc.json set the sourceType parserOption to module
  2. Run the linting, making sure to include json files in the checks

Expected behavior

The eslint.json check shouldn't check for strict mode when the code is declared a module.

duhrer commented 1 year ago

@jobara, I don't actually have any projects that are a module, if you have a branch/project I could check out for testing purposes, that would help me look into this.

duhrer commented 1 year ago

Justin and I discussed this, he couldn't remember why this was needed. I'll close for now, we can always reopen if needed.