Skip to content

Commit 0a1faa7

Browse files
committed
[update] types and lint settings
1 parent 9384acd commit 0a1faa7

File tree

6 files changed

+50
-36
lines changed

6 files changed

+50
-36
lines changed

.eslintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@
1111
"parser": "@typescript-eslint/parser",
1212
"parserOptions": {
1313
"sourceType": "module"
14+
},
15+
"rules": {
16+
"semi": ["error", "always"],
17+
"quotes": ["error", "single", { "allowTemplateLiterals": true }]
1418
}
1519
}

package-lock.json

Lines changed: 28 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"homepage": "https://github.com/microcmsio/nuxt-microcms-module#readme",
3030
"devDependencies": {
31-
"@nuxt/types": "https://gitpkg.now.sh/nuxt/nuxt.js/packages/types?dev",
31+
"@nuxt/types": "^2.15.7",
3232
"@nuxtjs/eslint-config-typescript": "^6.0.1",
3333
"@typescript-eslint/parser": "^4.28.0",
3434
"eslint": "^7.29.0",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import module from './module'
1+
import module from './module';
22

3-
export default module
3+
export default module;

src/module.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Module } from '@nuxt/types'
2-
const path = require('path')
1+
import { Module } from '@nuxt/types';
2+
const path = require('path');
33

44
export interface Config {
55
apiKey: string;
@@ -25,16 +25,16 @@ export interface ModuleWithMeta<T> extends Module<T> {
2525
}
2626

2727
const module: ModuleWithMeta<Options> = function (this, moduleOptions) {
28-
const _options = { ...this.options.microcms, ...moduleOptions }
29-
const { fileName, mode, options } = _options
28+
const _options = { ...this.options.microcms, ...moduleOptions };
29+
const { fileName, mode, options } = _options;
3030
this.addPlugin({
3131
src: path.resolve(__dirname, 'plugin.js'),
3232
fileName: fileName || 'microcms.js',
3333
mode,
3434
options
35-
})
36-
}
35+
});
36+
};
3737

38-
module.meta = require('../package.json')
38+
module.meta = require('../package.json');
3939

40-
export default module
40+
export default module;

src/plugin.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Plugin } from '@nuxt/types'
2-
import { createClient } from 'microcms-js-sdk'
1+
import { Plugin } from '@nuxt/types';
2+
import { createClient } from 'microcms-js-sdk';
33

44
const plugin: Plugin = function (_, inject) {
5-
const _options = JSON.parse('<%= serialize(options) %>')
6-
const client = createClient(_options)
5+
const _options = JSON.parse('<%= serialize(options) %>');
6+
const client = createClient(_options);
77

8-
inject('microcms', client)
9-
}
8+
inject('microcms', client);
9+
};
1010

11-
export default plugin
11+
export default plugin;

0 commit comments

Comments
 (0)