Skip to content

Commit 34f3547

Browse files
feat: Add linting rule to enforce consistent type imports
1 parent 62ab288 commit 34f3547

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.eslintrc.cjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ module.exports = {
88
'@vue/airbnb'
99
],
1010
parserOptions: {
11-
ecmaVersion: 'latest'
11+
parser: '@typescript-eslint/parser',
12+
ecmaVersion: 'latest',
13+
project: ['./tsconfig.json']
1214
},
1315
overrides: [
1416
{
15-
files: ['*.vue'],
17+
files: ['*.vue', '*.ts'],
1618
rules: {
1719
'vue/multi-word-component-names': 'off'
1820
}
@@ -64,6 +66,7 @@ module.exports = {
6466
'vue/max-attributes-per-line': 'off',
6567
'no-spaced-func': 'off',
6668
'vuejs-accessibility/form-control-has-label': 'off',
69+
'@typescript-eslint/consistent-type-imports': 'error',
6770
'vue/first-attribute-linebreak': 'off',
6871
indent: ['off'],
6972
curly: ['error', 'multi', 'consistent'],

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "vite build && vue-tsc",
1212
"types": "vue-tsc ",
1313
"preview": "vite preview",
14-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
14+
"lint": "eslint src/"
1515
},
1616
"repository": {
1717
"type": "git",
@@ -44,11 +44,12 @@
4444
"vue-tsc": "^2.0.5"
4545
},
4646
"peerDependencies": {
47-
"vue": "^3.4.21"
47+
"vue": ">=3.0.0"
4848
},
4949
"files": [
5050
"dist",
5151
"package.json",
52-
"README.md"
52+
"README.md",
53+
"license"
5354
]
5455
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"noUnusedParameters": true,
1818
"noFallthroughCasesInSwitch": true
1919
},
20-
"include": ["src/**/*.ts", "src/**/*.css", "src/**/*.d.ts", "src/**/*.tsx", "src/components/*.vue"],
20+
"include": ["src"],
2121
"exclude": ["node_modules"],
2222
"references": [{ "path": "./tsconfig.node.json" }]
2323
}

0 commit comments

Comments
 (0)