Skip to content

Commit

Permalink
fix(tsconfig): extend @vue/tsconfig (#31)
Browse files Browse the repository at this point in the history
* fix(tsconfig): extend vue tsconfig

chore: tsconfig settings

* revert: add moduleResolution
  • Loading branch information
adamdehaven authored Aug 22, 2023
1 parent a023489 commit 5e01f63
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
48 changes: 23 additions & 25 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ module.exports = {
'standard',
],
rules: {
quotes: ['error', 'single', { avoidEscape: true }],
quotes: ['error', 'single', {
avoidEscape: true,
}],
'no-multi-spaces': 'error',
'no-trailing-spaces': 'error',
'no-empty': 'off',
Expand All @@ -34,29 +36,25 @@ module.exports = {
'vue/attributes-order': ['error', {
alphabetical: true,
}],
'@typescript-eslint/no-explicit-any': 'off',
// Avoids false errors like “'NodeListOf' is not defined”.
'no-undef': 'off',
// Turns off some non-TypeScript rules in favor of their specific TypeScript rules to avoid false negatives:
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
// Ensures ESLint understands that `defineEmits<{ ... }>()` does _not_ fail this rule.
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'error',
'@typescript-eslint/consistent-type-imports': ['error', {
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
}],
},
overrides: [
{
files: ['*.ts', '*.vue'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
// Avoids false errors like “'NodeListOf' is not defined”.
'no-undef': 'off',
// Turns off some non-TypeScript rules in favor of their specific TypeScript rules to avoid false negatives:
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
// Ensures ESLint understands that `defineEmits<{ ... }>()` does _not_ fail this rule.
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'error',
},
},
],
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@vitejs/plugin-vue": "^4.2.3",
"@vitest/ui": "^0.34.1",
"@vue/test-utils": "^2.4.1",
"@vue/tsconfig": "^0.4.0",
"autoprefixer": "^10.4.14",
"c8": "^8.0.1",
"cheerio": "^1.0.0-rc.12",
Expand Down
6 changes: 1 addition & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"baseUrl": ".",
"lib": [
"esnext",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,11 @@
js-beautify "1.14.9"
vue-component-type-helpers "1.8.4"

"@vue/tsconfig@^0.4.0":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@vue/tsconfig/-/tsconfig-0.4.0.tgz#f01e2f6089b5098136fb084a0dd0cdd4533b72b0"
integrity sha512-CPuIReonid9+zOG/CGTT05FXrPYATEqoDGNrEaqS4hwcw5BUNM2FguC0mOwJD4Jr16UpRVl9N0pY3P+srIbqmg==

"@vue/[email protected]":
version "1.8.8"
resolved "https://registry.yarnpkg.com/@vue/typescript/-/typescript-1.8.8.tgz#8efb375d448862134492a044f4e96afada547500"
Expand Down

0 comments on commit 5e01f63

Please sign in to comment.