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

vue/block-order not only checks .vue but also .ts and .js files #2502

Open
doorahmie opened this issue Jul 9, 2024 · 3 comments
Open

vue/block-order not only checks .vue but also .ts and .js files #2502

doorahmie opened this issue Jul 9, 2024 · 3 comments
Labels
needs repro Need a repository that can reproduce the problem, or a link to DEMO.

Comments

@doorahmie
Copy link

Is this normal operation? If so, what part should I fix? I think this rule should only apply to .vue files.
Thanks for reading my question.

image

Here is my .eslintrc.js.

  root: true,
  env: {
    node: true,
  },
  extends: [
    "plugin:vue/vue3-essential",
    "eslint:recommended",
    "@vue/typescript/recommended",
    "plugin:prettier/recommended",
  ],
  parserOptions: {
    ecmaVersion: 2020,
  },
  rules: {
    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
    "@typescript-eslint/no-explicit-any": "off",
    "no-unused-vars": "warn",
    "vue/attributes-order": "error",
    "vue/order-in-components": "error",
    "vue/block-order": ["warn", { order: ["template", "script", "style"] }],
  },
  overrides: [
    {
      files: [
        "**/__tests__/*.{j,t}s?(x)",
        "**/tests/unit/**/*.spec.{j,t}s?(x)",
      ],
      env: {
        jest: true,
      },
    },
  ],
};

and here is my tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "moduleResolution": "node",
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "useDefineForClassFields": true,
    "sourceMap": true,
    "baseUrl": ".",
    "types": ["webpack-env", "jest"],
    "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
    "allowJs": true,
    "checkJs": false
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
  ],
  "exclude": ["node_modules"]
}
@doorahmie
Copy link
Author

the RED PATH means root path.

@doorahmie doorahmie changed the title "vue/block-order" not only checks **.vue**, but also checks **.ts** and **.js** files. "vue/block-order" not only checks ".vue", but also checks ".ts" and ".js" files. Jul 9, 2024
@FloEdelmann
Copy link
Member

What is the @vue/typescript/recommended config? It looks similar to https://github.com/vuejs/eslint-config-typescript, but that one is only supported for @vue/cli & create-vue setups and is imported with @vue/eslint-config-typescript.

@FloEdelmann
Copy link
Member

Please provide a Stackblitz or GitHub repo so we can debug the issue.

@FloEdelmann FloEdelmann added the needs repro Need a repository that can reproduce the problem, or a link to DEMO. label Jul 9, 2024
@FloEdelmann FloEdelmann changed the title "vue/block-order" not only checks ".vue", but also checks ".ts" and ".js" files. vue/block-order not only checks .vue but also checks .ts and .js files Jul 9, 2024
@FloEdelmann FloEdelmann changed the title vue/block-order not only checks .vue but also checks .ts and .js files vue/block-order not only checks .vue but also .ts and .js files Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Need a repository that can reproduce the problem, or a link to DEMO.
Projects
None yet
Development

No branches or pull requests

2 participants