Skip to content

Commit 7852561

Browse files
authored
Replacing with TypeScript (#97)
* Replacing with TypeScript * Fix docs build
1 parent 1deb997 commit 7852561

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2005
-936
lines changed

.eslintrc.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,27 @@ module.exports = {
1212
'prettier',
1313
'prettier/vue'
1414
],
15-
plugins: [],
15+
plugins: ['@typescript-eslint'],
1616
parserOptions: {
1717
ecmaVersion: 2015
1818
},
1919
rules: {
2020
'object-shorthand': 'error'
21-
}
21+
},
22+
overrides: [
23+
{
24+
files: ['*.ts'],
25+
extends: [
26+
'plugin:@typescript-eslint/recommended',
27+
'prettier/@typescript-eslint'
28+
],
29+
parser: 'vue-eslint-parser',
30+
parserOptions: {
31+
parser: '@typescript-eslint/parser'
32+
},
33+
rules: {
34+
'@typescript-eslint/no-non-null-assertion': 'off'
35+
}
36+
}
37+
]
2238
}

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ jobs:
3131
- name: Test
3232
run: yarn test
3333
- name: Integration Test
34-
run: yarn test:integrations
34+
run: |
35+
yarn build
36+
yarn test:integrations

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ coverage
66
*.log
77
*.swp
88
*~
9+
/dist

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"eslint.options": { "configFile": ".eslintrc.js" },
33
"eslint.validate": [
4-
"javascript"
4+
"javascript",
5+
"typescript"
56
],
67
"eslint.alwaysShowStatus": true,
78
"eslint.packageManager": "yarn",

docs/.vuepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
'use strict'
66

7+
require('ts-node').register()
78
const { withCategories } = require('../../scripts/lib/rules')
89
require('../../scripts/update-docs-headers')
910
require('../../scripts/update-docs-index')

lib/configs.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/configs.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** DON'T EDIT THIS FILE; was created by scripts. */
2+
import base from './configs/base'
3+
import recommended from './configs/recommended'
4+
5+
export = {
6+
base,
7+
recommended
8+
}

lib/configs/base.js renamed to lib/configs/base.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
'use strict'
2-
3-
module.exports = {
1+
export = {
42
parser: require.resolve('vue-eslint-parser'),
53
plugins: ['@intlify/vue-i18n'],
64
overrides: [

lib/configs/recommended.js renamed to lib/configs/recommended.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/** DON'T EDIT THIS FILE; was created by scripts. */
2-
'use strict'
3-
4-
module.exports = {
2+
export = {
53
extends: [require.resolve('./base')],
64
parserOptions: {
75
ecmaVersion: 2018,

lib/index.js renamed to lib/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
* @fileoverview ESLint plugin for vue-i18n
33
* @author kazuya kawaguchi (a.k.a. kazupon)
44
*/
5-
'use strict'
5+
import configs from './configs'
6+
import rules from './rules'
67

7-
module.exports = {
8-
configs: require('./configs'),
9-
rules: require('./rules')
8+
export = {
9+
configs,
10+
rules
1011
}

0 commit comments

Comments
 (0)