Skip to content

Commit

Permalink
Merge pull request #21 from ymmooot/typescript
Browse files Browse the repository at this point in the history
fix: export decorator type
  • Loading branch information
ymmooot authored May 31, 2019
2 parents 37115a6 + 669d045 commit bfe8310
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
},
overrides: [
{
files: ['**/*.spec.js'],
files: ['./test/**/*.spec.*'],
env: {
jest: true,
},
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
"lint:fix": "eslint --ext .ts --ext .js --fix src test"
},
"files": [
"lib",
"types/*.d.ts"
"lib"
],
"typings": "./types/index.d.ts",
"typings": "./lib/index.d.ts",
"devDependencies": {
"@semantic-release/changelog": "^3.0.2",
"@semantic-release/commit-analyzer": "^6.1.0",
Expand All @@ -44,7 +43,7 @@
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-jest": "^22.5.1",
"eslint-plugin-jest": "^22.6.4",
"eslint-plugin-prettier": "^3.0.1",
"jest": "^24.8.0",
"prettier": "^1.17.0",
Expand Down
4 changes: 2 additions & 2 deletions types/index.d.ts → src/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue, { ComponentOptions } from 'vue'
import Vue, { ComponentOptions } from 'vue';

declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
Expand All @@ -8,6 +8,6 @@ declare module 'vue/types/options' {

declare module 'vue/types/vue' {
interface Vue {
_uid: number
_uid: number;
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './declaration.d';
import createJsonldMixin from './createMixin';
import decorator from './decorator';

Expand Down
3 changes: 1 addition & 2 deletions test/decorator_ts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Component from 'vue-class-component';
import Jsonld from '../src/decorator';

describe('Jsonld decorator', () => {

test('typecheck', () => {
const checker = {};

Expand All @@ -15,7 +14,7 @@ describe('Jsonld decorator', () => {
}
}

const component = new MockComponent()
const component = new MockComponent();

expect(component.jsonld).toBeUndefined();
expect(component.$options.jsonld()).toBe(checker);
Expand Down
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"outDir": "./lib/",
"target": "es5",
"sourceMap": false,
"declaration": true,
"types": [
"./types/"
],
"declaration": true
},
"include": [
"src/**/*"
Expand Down
1 change: 0 additions & 1 deletion tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"allowJs": true,
"noEmit": true,
"types": [
"./types/",
"@types/jest"
],
},
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ eslint-plugin-import@^2.17.3:
read-pkg-up "^2.0.0"
resolve "^1.11.0"

eslint-plugin-jest@^22.5.1:
eslint-plugin-jest@^22.6.4:
version "22.6.4"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.6.4.tgz#2895b047dd82f90f43a58a25cf136220a21c9104"
integrity sha512-36OqnZR/uMCDxXGmTsqU4RwllR0IiB/XF8GW3ODmhsjiITKuI0GpgultWFt193ipN3HARkaIcKowpE6HBvRHNg==
Expand Down

0 comments on commit bfe8310

Please sign in to comment.