eslint-plugin-vue
eslint-plugin-vue copied to clipboard
`vue/block-order` not only checks `.vue` but also `.ts` and `.js` files
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.
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"]
}