Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
@vue/eslint-config-typescript
Advanced tools
@vue/eslint-config-typescript is an ESLint configuration package specifically designed for Vue.js projects that use TypeScript. It provides a set of rules and configurations to ensure code quality and consistency in Vue.js applications written in TypeScript.
TypeScript Support
This configuration extends the recommended rules from both Vue and TypeScript ESLint plugins, ensuring that your TypeScript code in Vue components is linted according to best practices.
{"extends":["plugin:vue/vue3-essential","plugin:@typescript-eslint/recommended","@vue/typescript/recommended"],"parserOptions":{"ecmaVersion":2020,"sourceType":"module"}}
Vue Specific Rules
Includes Vue-specific linting rules to catch common issues in Vue components, such as unused variables in script setup and unused components.
{"rules":{"vue/script-setup-uses-vars":"error","vue/no-unused-components":"warn"}}
TypeScript Specific Rules
Provides TypeScript-specific linting rules to catch issues like unused variables and to enforce or relax certain TypeScript practices.
{"rules":{"@typescript-eslint/no-unused-vars":["error",{"argsIgnorePattern":"^_"}],"@typescript-eslint/explicit-function-return-type":"off"}}
This package provides a set of TypeScript-specific linting rules for ESLint. It is more general-purpose compared to @vue/eslint-config-typescript, which is tailored specifically for Vue.js projects.
This plugin provides Vue.js specific linting rules for ESLint. While it supports Vue.js, it does not include TypeScript-specific configurations, making it less comprehensive for projects that use both Vue.js and TypeScript.
This package extends Airbnb's ESLint configuration to support TypeScript. It is a good choice for projects that follow Airbnb's style guide but does not include Vue.js specific rules.
eslint-config-typescript for vue-cli
See @typescript-eslint/eslint-plugin for available rules.
This config is specifically designed to be used by Vue CLI setups and is not meant for outside use (it can be used but some adaptations on the user side might be needed - for details see the config file).
A part of its design is that this config may implicitly depend on
other parts of Vue CLI setups, such as eslint-plugin-vue
being
extended in the same resulting config.
This config requires several peer dependencies. So it's recommended to use the install-peerdeps
command:
npx install-peerdeps --dev @vue/eslint-config-typescript
This package comes with 2 rulesets.
@vue/eslint-config-typescript
This ruleset is the base configuration for Vue-TypeScript projects.
Besides setting the parser and plugin options, it also turns off several conflicting rules in the eslint:recommended
ruleset.
So when used alongside other sharable configs, this config should be placed at the end of the extends
array.
An example .eslintrc.js
:
module.exports = {
extends: [
'plugin:vue/essential',
'eslint:recommended',
'@vue/typescript'
]
}
@vue/eslint-config-typescript/recommended
This is extended from the @typescript-eslint/recommended
ruleset, which is an opinionated ruleset.
See the originial documentation for more information.
Some of its rules, however, might conflict with prettier
.
So when used alongside other sharable configs, this config should be placed after all other configs except for the prettier
ones in the extends
array.
And make sure to also include the @typescript-eslint
sub ruleset of the prettier
config.
An example .eslintrc.js
:
module.exports = {
extends: [
'plugin:vue/essential',
'@vue/airbnb',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/prettier/@typescript-eslint'
]
}
FAQs
ESLint config for TypeScript + Vue.js projects
The npm package @vue/eslint-config-typescript receives a total of 712,966 weekly downloads. As such, @vue/eslint-config-typescript popularity was classified as popular.
We found that @vue/eslint-config-typescript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.