Closed mitow7821 closed 3 years ago
Checklist
Tell us about your environment
Please show your full configuration:
module.exports = { env: { browser: true, es2021: true, }, extends: [ "eslint:recommended", "airbnb-base", "plugin:vue/vue3-recommended", "prettier", ], parser: "vue-eslint-parser", parserOptions: { parser: "@babel/eslint-parser", ecmaVersion: 2021, sourceType: "module", }, plugins: ["vue"], rules: { "vue/attribute-hyphenation": "off", "import/prefer-default-export": "off", "import/extensions": ["error", "ignorePackages"], "no-underscore-dangle": "off", "class-methods-use-this": "off", "import/no-cycle": ["error", { maxDepth: 1 }], "new-cap": ["error", { properties: false }], "no-param-reassign": "off", "consistent-return": "off", "no-plusplus": ["error", { allowForLoopAfterthoughts: true }], "newline-before-return": "error", }, settings: { "import/resolver": { alias: { map: [ ["@", "./src"], ["@a", "./src/api"], ["@s", "./src/store"], ["@m", "./src/modules"], ["@c", "./src/components"], ["@l", "./src/layouts"], ["@h", "./src/helpers"], ], extensions: [".js", ".vue"], }, }, }, };
What did you do?
<script setup> defineProps({ alert: { type: Object, required: true, }, }); </script>
What did you expect to happen? I want to use defineProps and defineEmits macros, but eslint throws error "defineProps is not defined" - no undef.
What actually happened?
error 'defineProps' is not defined no-undef
Repository to reproduce this issue Create empty project with vue 3.2.1 and use defineProps macro inside <script setup>
<script setup>
fixed defining global in eslint config
globals: { defineProps: "readonly", defineEmits: "readonly", defineExpose: "readonly", }
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
What did you expect to happen? I want to use defineProps and defineEmits macros, but eslint throws error "defineProps is not defined" - no undef.
What actually happened?
error 'defineProps' is not defined no-undef
Repository to reproduce this issue Create empty project with vue 3.2.1 and use defineProps macro inside
<script setup>