-
-
Notifications
You must be signed in to change notification settings - Fork 396
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-tsc] How to use with lint-stage #686
Comments
Are you sure that this will work? |
yes, i agree I know that vue-tsc will recheck the entire program, but is there a better way to check vue files? |
Maybe just use |
But what I use now is pre_commit 😭 |
@1018715564 Please treat vue-tsc as just tsc, maybe tsc can specify files in cli, I think there have been some discussions: lint-staged/lint-staged#468 |
I already have an optimal lint-stage configuration. If anyone needs it, just use vue-tsc as tsc. // lint-staged.config.js
module.exports = {
'*.{ts,tsx}': ['prettier --write', 'eslint --fix', 'tsc --noEmit'],
'*.vue': ['prettier --write', 'eslint --fix', 'vue-tsc --noEmit'],
'*.{json,js,jsx}': ['prettier --write', 'eslint --fix']
} "scripts": {
"lint-staged": "lint-staged",
} |
This configuration is still wrong. |
I run this configuration successfully without errors; you can send out the error to see |
please https://github.com/seho-code-life/project_template/issues/new It has nothing to do with volar, we can change a place |
Any update, I still have same issue with lint-stage |
it's ok! //.lintstagedrc.js
const fs = require('fs')
module.exports = {
'src/**/*.{js,jsx,vue,ts,tsx}': ['yarn lint'],
'*.{vue,ts}': [
() => {
return `vue-tsc --noEmit --skipLibCheck`
},
],
} |
"scripts": { "lint-staged": { |
Conceptually, it can't run on files individually (though I would be happy to be proven wrong on this), therefore it ends up being broken in lint-staged when I try it. Just run it separately, even if it's a little slower. See vuejs/language-tools#686 Running tsc per-file might work with tsc-files, but that didn't work due to Nuxt doing something clever that I don't have the patience to figure out.
Conceptually, it can't run on files individually (though I would be happy to be proven wrong on this), therefore it ends up being broken in lint-staged when I try it. Just run it separately, even if it's a little slower. See vuejs/language-tools#686 Running tsc per-file might work with tsc-files, but that didn't work due to Nuxt doing something clever that I don't have the patience to figure out.
I want to use vue-tsc for type checking in vue.
I want to use lint-stage now, but vue-tsc can't seem to find my tsconfig.json
I want to verify only the vue file in the temporary storage area. Do you know how to do it?
The text was updated successfully, but these errors were encountered: