Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Mark imported config #19

Closed
3 tasks done
erosman opened this issue Mar 29, 2024 · 2 comments
Closed
3 tasks done

Mark imported config #19

erosman opened this issue Mar 29, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@erosman
Copy link

erosman commented Mar 29, 2024

Clear and concise description of the problem

  • Configs
    Use a reference instead of anonymous #1 e.g. js.configs.recommended, or @eslint/js.configs.recommended,
import js from "@eslint/js"; 
// ---
export default [
  js.configs.recommended, 

  // ---
]:
  • Rules
    It would be useful to mark rules that are imported e.g. js.configs.recommended so that they can be differentiated from the manually added rules.

Suggested solution

as above

Alternative

No response

Additional context

No response

Validations

@erosman erosman added the enhancement New feature or request label Mar 29, 2024
@antfu
Copy link
Owner

antfu commented Mar 29, 2024

I am trying to push that direction: eslint/eslint#18231

The config-viewer gets the data from runtime, so we can't possibly know the source for each config. That would require configs to provide the name properly later.

@antfu antfu closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2024
@erosman
Copy link
Author

erosman commented Mar 29, 2024

configs.recommended

[ESLint Config Viewer] Config payload

const payload = await $fetch<Payload | ErrorInfo>('/api/get')

Data example

    "constructor-super": {
      "type": "problem",
      "docs": {
        "description": "Require `super()` calls in constructors",
        "recommended": true,
        "url": "https://eslint.org/docs/latest/rules/constructor-super"
      },
      "name": "constructor-super",
      "plugin": "eslint"
    },

It would be helpful to mark rules with "recommended": true, to show that they are part of configs.recommended.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants