Skip to content

Commit

Permalink
use eslint and js standard style
Browse files Browse the repository at this point in the history
  • Loading branch information
hifarer committed Nov 16, 2017
1 parent 06b5f2e commit 92a51a0
Show file tree
Hide file tree
Showing 34 changed files with 2,538 additions and 676 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./dist/
9 changes: 9 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"parserOptions": {
"sourceType": "module"
},
"extends": "standard",
"plugins": [
"html"
]
}
24 changes: 12 additions & 12 deletions build/dev-server.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@

const path = require('path');
const express = require('express');
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const webpackConfig = require('./webpack.dev.config.js');
const path = require('path')
const express = require('express')
const webpack = require('webpack')
const webpackDevMiddleware = require('webpack-dev-middleware')
const webpackHotMiddleware = require('webpack-hot-middleware')
const webpackConfig = require('./webpack.dev.config.js')

const compiler = webpack(webpackConfig);
const compiler = webpack(webpackConfig)

const app = express();
const app = express()

app.use(express.static(path.join(__dirname, '../')));
app.use(express.static(path.join(__dirname, '../')))

app.use(webpackDevMiddleware(compiler, {
// public path should be the same with webpack config
publicPath: webpackConfig.output.publicPath,
noInfo: true
}));
}))

app.use(webpackHotMiddleware(compiler));
app.use(webpackHotMiddleware(compiler))

app.listen(8888);
app.listen(8888)
24 changes: 12 additions & 12 deletions build/webpack.dev.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

const webpack = require('webpack');
const path = require('path');
const autoprefixer = require('autoprefixer');
const webpack = require('webpack')
const path = require('path')
const autoprefixer = require('autoprefixer')

module.exports = {

Expand All @@ -25,7 +25,7 @@ module.exports = {
module: {
rules: [
{
test: /\.vue$/,
test: /\.vue$/,
use: [{
loader: 'vue-loader',
options: {
Expand All @@ -37,20 +37,20 @@ module.exports = {
})
]
}
}],
}],
exclude: /node_modules/
},
{
test: /\.js$/,
use: 'babel-loader',
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(css|less)$/,
test: /\.(css|less)$/,
use: ['css-loader', 'less-loader', 'postcss-loader']
},
{
test: /\.(png|jpg|gif)$/,
test: /\.(png|jpg|gif)$/,
use: 'url-loader?limit=8192'
}
]
Expand All @@ -71,14 +71,14 @@ module.exports = {
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue',
root: 'Vue',
root: 'Vue'
},
vuex: {
commonjs: 'vuex',
commonjs2: 'vuex',
amd: 'vuex',
root: 'Vuex',
root: 'Vuex'
}
}

};
}
28 changes: 14 additions & 14 deletions build/webpack.plug.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

const webpack = require('webpack');
const path = require('path');
const autoprefixer = require('autoprefixer');
const webpack = require('webpack')
const path = require('path')
const autoprefixer = require('autoprefixer')

const pkg = require('../package.json');
const banner = pkg.name + ' v' + pkg.version + '\n' + pkg.repository.url;
const pkg = require('../package.json')
const banner = pkg.name + ' v' + pkg.version + '\n' + pkg.repository.url

module.exports = {

Expand All @@ -26,7 +26,7 @@ module.exports = {
module: {
rules: [
{
test: /\.vue$/,
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
Expand All @@ -39,20 +39,20 @@ module.exports = {
})
]
}
}],
}],
exclude: /node_modules/
},
{
test: /\.js$/,
loader: 'babel-loader',
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(css|less)$/,
test: /\.(css|less)$/,
use: ['css-loader', 'less-loader', 'postcss-loader']
},
{
test: /\.(png|jpg|gif)$/,
test: /\.(png|jpg|gif)$/,
loader: 'url-loader?limit=8192'
}
]
Expand Down Expand Up @@ -80,14 +80,14 @@ module.exports = {
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue',
root: 'Vue',
root: 'Vue'
},
vuex: {
commonjs: 'vuex',
commonjs2: 'vuex',
amd: 'vuex',
root: 'Vuex',
root: 'Vuex'
}
}

};
}
30 changes: 15 additions & 15 deletions build/webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

const webpack = require('webpack');
const path = require('path');
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const webpack = require('webpack')
const path = require('path')
const autoprefixer = require('autoprefixer')
const ExtractTextPlugin = require('extract-text-webpack-plugin')

const pkg = require('../package.json');
const banner = pkg.name + ' v' + pkg.version + '\n' + pkg.repository.url;
const pkg = require('../package.json')
const banner = pkg.name + ' v' + pkg.version + '\n' + pkg.repository.url

module.exports = {

Expand All @@ -27,7 +27,7 @@ module.exports = {
module: {
rules: [
{
test: /\.vue$/,
test: /\.vue$/,
use: [{
loader: 'vue-loader',
options: {
Expand All @@ -39,23 +39,23 @@ module.exports = {
})
]
}
}],
}],
exclude: /node_modules/
},
{
test: /\.js$/,
use: 'babel-loader',
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(css|less)$/,
test: /\.(css|less)$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader!less-loader!postcss-loader'
})
},
{
test: /\.(png|jpg|gif)$/,
test: /\.(png|jpg|gif)$/,
use: 'url-loader?limit=8192'
}
]
Expand Down Expand Up @@ -84,14 +84,14 @@ module.exports = {
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue',
root: 'Vue',
root: 'Vue'
},
vuex: {
commonjs: 'vuex',
commonjs2: 'vuex',
amd: 'vuex',
root: 'Vuex',
root: 'Vuex'
}
}

};
}
5 changes: 2 additions & 3 deletions dist/language/lang.en.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const lang = {

app: {},

removeFormat: {title: 'Remove format'},
Expand Down Expand Up @@ -64,5 +63,5 @@ const lang = {
},
table: {title: 'Table'},
undo: {title: 'Undo'},
redo: {title: 'Redo'},
}
redo: {title: 'Redo'}
}
2 changes: 1 addition & 1 deletion dist/script/vueditor.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 92a51a0

Please sign in to comment.