Skip to content

Commit 3a3a95d

Browse files
committed
Fix code formatting
1 parent 30a46f3 commit 3a3a95d

File tree

7 files changed

+1064
-51
lines changed

7 files changed

+1064
-51
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
"license": "MIT",
1313
"scripts": {
1414
"build": "cross-env NODE_ENV=production webpack",
15-
"clean": "rm -rf dist/"
15+
"clean": "rm -rf dist/",
16+
"check": "standard"
1617
},
1718
"devDependencies": {
1819
"@babel/core": "^7.6.4",
1920
"babel-loader": "^8.0.6",
2021
"cross-env": "^6.0.3",
22+
"standard": "^14.3.1",
2123
"vue-loader": "^15.7.2",
2224
"vue-template-compiler": "^2.6.10",
2325
"webpack": "^4.41.2",

src/directive.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* Copyright (C) 2019 Xvezda <https://xvezda.com/> */
2-
import { replacer, pattern } from './utils';
2+
import { replacer, pattern } from './utils'
33

4-
export function bind(el, binding, vnode) {
5-
let innerHTML = el.innerHTML;
6-
innerHTML = innerHTML.replace(pattern, replacer);
7-
el.innerHTML = innerHTML;
8-
vnode.context.$emit('replaced', vnode);
4+
export function bind (el, binding, vnode) {
5+
let innerHTML = el.innerHTML
6+
innerHTML = innerHTML.replace(pattern, replacer)
7+
el.innerHTML = innerHTML
8+
vnode.context.$emit('replaced', vnode)
99
}
1010

1111
export default {
12-
bind,
12+
bind
1313
}

src/filter.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/* Copyright (C) 2020 Xvezda <https://xvezda.com/> */
2-
import { replacer, pattern } from './utils';
2+
import { replacer } from './utils'
33

4-
export function filter(value) {
5-
if (!value) return '';
4+
export function filter (value) {
5+
if (!value) return ''
66

7-
return replacer(undefined, value);
7+
return replacer(undefined, value)
88
}
99

1010
export default {
11-
filter,
11+
filter
1212
}

src/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/* Copyright (C) 2019 Xvezda <https://xvezda.com/> */
2-
import VueChromeI18n from './components/VueChromeI18n';
3-
import { bind } from './directive';
4-
import { filter } from './filter';
2+
import VueChromeI18n from './components/VueChromeI18n'
3+
import { bind } from './directive'
4+
import { filter } from './filter'
55

6-
export function install(Vue, options) {
7-
Vue.component('vue-chrome-i18n', VueChromeI18n);
6+
export function install (Vue, options) {
7+
Vue.component('vue-chrome-i18n', VueChromeI18n)
88
Vue.directive('chrome-i18n', {
99
bind: bind
10-
});
11-
Vue.filter('chrome-i18n', filter);
10+
})
11+
Vue.filter('chrome-i18n', filter)
1212
}
1313

1414
export default {
15-
install,
15+
install
1616
}

src/utils.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
/* Copyright (C) 2019 Xvezda <https://xvezda.com/> */
2-
export const pattern = /__MSG_([A-Za-z0-9_-]+)__/g;
2+
export const pattern = /__MSG_([A-Za-z0-9_-]+)__/g
33

4-
export function replacer(match, p1, offset, string) {
5-
return chrome.i18n.getMessage(p1);
4+
export function replacer (match, p1, offset, string) {
5+
return chrome.i18n.getMessage(p1) // eslint-disable-line no-undef
66
}
77

8-
export function nl2br(string) {
8+
export function nl2br (string) {
99
try {
10-
return string.replace(/\n/g, '<br>');
11-
} catch(e) {
12-
return string;
10+
return string.replace(/\n/g, '<br>')
11+
} catch (e) {
12+
return string
1313
}
1414
}
1515

16-
1716
export default {
1817
replacer,
1918
pattern,
20-
nl2br,
19+
nl2br
2120
}

webpack.config.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* Copyright (C) 2019 Xvezda <https://xvezda.com/> */
2-
var path = require('path');
3-
var webpack = require('webpack');
4-
const { VueLoaderPlugin } = require('vue-loader');
2+
var path = require('path')
3+
const { VueLoaderPlugin } = require('vue-loader')
54

65
module.exports = {
76
mode: process.env.NODE_ENV,
@@ -14,7 +13,7 @@ module.exports = {
1413
libraryTarget: 'umd'
1514
},
1615
resolve: {
17-
extensions: ['.js', '.vue'],
16+
extensions: ['.js', '.vue']
1817
},
1918
optimization: {
2019
minimize: true
@@ -35,4 +34,4 @@ module.exports = {
3534
plugins: [
3635
new VueLoaderPlugin()
3736
]
38-
};
37+
}

0 commit comments

Comments
 (0)