Skip to content

Commit 0ea3d44

Browse files
committed
chore: lint module
1 parent f5d4e1a commit 0ea3d44

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@nuxtjs/eslint-config-typescript"
4+
]
5+
}

.eslintrc.js

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"scripts": {
1414
"build": "siroc build",
1515
"dev": "nuxt example",
16-
"lint": "eslint --ext .js,.vue .",
16+
"lint": "eslint --ext .js,.vue,.ts .",
1717
"release": "yarn build && yarn test && standard-version && git push --follow-tags && npm publish",
1818
"test": "yarn lint && jest"
1919
},

src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { resolve } from 'path'
22
import { renderStylesToString, extractCritical } from '@emotion/server'
33

4-
5-
export default function (moduleOptions) {
4+
function emotionModule (moduleOptions) {
65
const defaults = {
76
ssr: 'critical',
87
babel: {
@@ -33,6 +32,7 @@ export default function (moduleOptions) {
3332
const renderFn = functionMap[options.ssr]
3433

3534
if (typeof renderFn === 'undefined') {
35+
// eslint-disable-next-line no-console
3636
console.error(`[emotion] Invalid value "${options.ssr}" for \`emotion.ssr\``)
3737
return
3838
}
@@ -75,10 +75,12 @@ function critical (options) {
7575
})
7676
}
7777

78-
function ssr (options) {
78+
function ssr () {
7979
this.nuxt.hook('vue-renderer:ssr:templateParams', (params) => {
8080
params.APP = renderStylesToString(params.APP)
8181
})
8282
}
8383

84-
module.exports.meta = require('../package.json')
84+
emotionModule.meta = require('../package.json')
85+
86+
export default emotionModule

0 commit comments

Comments
 (0)