Freelance Projects, Design and Programming Tutorials
Encountered issues such as no-var errors when using ESLint
When I use ESLint to check my code, there is a rule that targets the var keyword, and the rule name is no-var. the no-var rule is a native rule of ESLint. However, I am only using the plugin:@typescript-eslint/recommended preset rule set and haven’t used the native ESLint rule set. Why am I getting no-var errors?
I have a requirement for a Vue 3 project. I want to use vue3-essential and @typescript-eslint/recommended to scan the code in the <script> section marked with lang='ts' in Vue files. I also want to use vue3-essential and eslint:recommended to scan the code in the <script> section not marked with lang='ts', which is JavaScript code, in Vue files. How should I configure the .eslintrc.js file to achieve this goal?
Why does the TypeScript-ESLint official website mark a piece of code as non-compliant with a specific rule, but when I use the @typescript-eslint/recommended preset ruleset, it doesn’t detect the error? For example, the code var pattern1 = /x00/; should violate the no-control-regex rule, but ESLint does not detect it, even though I have used the @typescript-eslint/recommended preset ruleset.