Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin import incorrect in docs #35

Closed
tanepiper opened this issue Jun 7, 2022 · 1 comment
Closed

Plugin import incorrect in docs #35

tanepiper opened this issue Jun 7, 2022 · 1 comment

Comments

@tanepiper
Copy link

What version of ESLint are you using?

8.12

What version of eslint-plugin-astro are you using?

0.10.2

What did you do?

Documention advises to use "plugin:astro/recommended" - however in the library the export is "plugin:astro/configs/recommended" Configuration
{
  "env": {
    "node": true,
    "es2022": true,
    "browser": true,
    "astro/astro": true
  },
  "extends": ["plugin:prettier/recommended", "eslint:recommended", "plugin:astro/configs/recommended"],
  "root": true,
  "ignorePatterns": ["**/*"],
  "plugins": ["@nrwl/nx"],
  "parserOptions": {
    "parserOptions": {
      "ecmaVersion": "latest",
      "sourceType": "module"
    },
    "ecmaFeatures": { "modules": true }
  },
  "overrides": [
    {
      "files": ["*.ts", "*.tsx", "*.js", "*.jsx", "*.mjs"],
      "rules": {
        "@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
        "@nrwl/nx/enforce-module-boundaries": [
          "error",
          {
            "enforceBuildableLibDependency": true,
            "allow": [],
            "depConstraints": [
              {
                "sourceTag": "*",
                "onlyDependOnLibsWithTags": ["*"]
              }
            ]
          }
        ]
      }
    },
    {
      "files": ["*.ts", "*.tsx"],
      "extends": ["plugin:@nrwl/nx/typescript"],
      "rules": {}
    },
    {
      "files": ["*.js", "*.jsx", "*.mjs"],
      "extends": ["plugin:@nrwl/nx/javascript"],
      "rules": {}
    },
    {
      "files": ["*.astro"],
      "plugins": ["astro"],
      "parser": "astro-eslint-parser",
      "parserOptions": {
        "parser": "@typescript-eslint/parser",
        "extraFileExtensions": [".astro"]
      },
      "rules": {}
    }
  ]
}

<!-- Paste your code here -->

What did you expect to happen?

Expected plugin to work as advised in docs

What actually happened?

Plugin, as described in docs, fails to load, as described in docs,

Link to Minimal Reproducible Example

N/A

Additional comments

Here is the compiled node module, the config should be restructured but is not, or documentation should be updated to above plugin import.

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
const rules_1 = require("./utils/rules");
const processor_1 = require("./processor");
const environment_1 = require("./environment");
const base_1 = __importDefault(require("./configs/base"));
const recommended_1 = __importDefault(require("./configs/recommended"));
const all_1 = __importDefault(require("./configs/all"));
const configs = {
    base: base_1.default,
    recommended: recommended_1.default,
    all: all_1.default,
};
const rules = rules_1.rules.reduce((obj, r) => {
    obj[r.meta.docs.ruleName] = r;
    return obj;
}, {});
module.exports = {
    configs,
    rules,
    processors: {
        ".astro": processor_1.processor,
        astro: processor_1.processor,
    },
    environments: {
        astro: environment_1.environment,
    },
};
@tanepiper
Copy link
Author

NVM this seemed to only affect VSCode, a full restart fixed it

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

No branches or pull requests

1 participant