Skip to content

Commit 117a0f4

Browse files
committed
chore: add typechecking for configs
1 parent d386d5a commit 117a0f4

File tree

7 files changed

+67
-72
lines changed

7 files changed

+67
-72
lines changed

.github/workflows/release.yml renamed to .github/workflows/formatting-types.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Check Formatting
1+
name: Formatting and Types
22
on:
33
- push
44
- pull_request
55

66
jobs:
7-
check-formatting:
8-
name: Check Formatting
7+
formatting-types:
8+
name: Formatting and Types
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
@@ -34,3 +34,6 @@ jobs:
3434

3535
- name: Check formatting
3636
run: pnpm run format
37+
38+
- name: Check types
39+
run: pnpm run typecheck

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
module.exports = {
1+
// @ts-check
2+
/** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */
3+
const eslintConfig = {
24
parser: '@typescript-eslint/parser',
35
parserOptions: {
4-
project: ['./tsconfig.eslint.json'],
56
sourceType: 'module',
67
ecmaVersion: 2018,
7-
tsconfigRootDir: __dirname,
88
},
99
plugins: ['@typescript-eslint', 'import', 'simple-import-sort'],
1010
extends: [
@@ -70,3 +70,5 @@ module.exports = {
7070
],
7171
reportUnusedDisableDirectives: true,
7272
};
73+
74+
module.exports = eslintConfig;

jest.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
module.exports = {
1+
// @ts-check
2+
/** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */
3+
const eslintConfig = {
24
settings: {
35
jest: {
46
version: 26,
@@ -21,3 +23,5 @@ module.exports = {
2123
},
2224
],
2325
};
26+
27+
module.exports = eslintConfig;

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
],
1515
"scripts": {
1616
"format": "prettier --check .",
17-
"format:fix": "prettier --write ."
17+
"format:fix": "prettier --write .",
18+
"typecheck": "tsc"
1819
},
1920
"dependencies": {
2021
"@intlify/eslint-plugin-vue-i18n": "0.11.1",
@@ -32,7 +33,9 @@
3233
"vue-eslint-parser": "7.6.0"
3334
},
3435
"devDependencies": {
35-
"prettier": "2.3.2"
36+
"@typescript-eslint/experimental-utils": "4.28.1",
37+
"prettier": "2.3.2",
38+
"typescript": "4.3.5"
3639
},
3740
"peerDependencies": {
3841
"eslint": ">= 7"

0 commit comments

Comments
 (0)