Use standard and prettier (#10)

* switch from custom eslint config to standard + prettier

* fix new standard eslint violations

* add editorconfig file

* auto-fix all other violations

* update lint yarn script

* remove jshint comment
This commit is contained in:
Spencer
2019-07-09 13:24:13 -07:00
committed by GitHub
parent f69840c50f
commit 7c1573fb07
119 changed files with 4506 additions and 3521 deletions

View File

@ -1,5 +1,5 @@
const webpack = require('webpack')
const { jsLoader, ignoreLoader, rel } = require('./lib')
const webpack = require('webpack');
const { jsLoader, ignoreLoader, rel } = require('./lib');
module.exports = {
context: rel('src'),
@ -23,4 +23,4 @@ module.exports = {
'process.env.NODE_ENV': '"production"',
}),
],
}
};

View File

@ -1,5 +1,5 @@
const webpack = require('webpack')
const { jsLoader, ignoreLoader, rel } = require('./lib')
const webpack = require('webpack');
const { jsLoader, ignoreLoader, rel } = require('./lib');
module.exports = {
context: rel('src'),
@ -8,14 +8,14 @@ module.exports = {
filename: 'elasticsearch.js',
path: rel('dist'),
library: 'elasticsearch',
libraryTarget: 'umd'
libraryTarget: 'umd',
},
module: {
rules: [
jsLoader(),
ignoreLoader([
'src/lib/connectors/jquery.js',
'src/lib/connectors/angular.js'
'src/lib/connectors/angular.js',
]),
],
},
@ -24,4 +24,4 @@ module.exports = {
'process.env.NODE_ENV': '"production"',
}),
],
}
};

View File

@ -1,5 +1,5 @@
const webpack = require('webpack')
const { jsLoader, ignoreLoader, rel } = require('./lib')
const webpack = require('webpack');
const { jsLoader, ignoreLoader, rel } = require('./lib');
module.exports = {
context: rel('src'),
@ -23,4 +23,4 @@ module.exports = {
'process.env.NODE_ENV': '"production"',
}),
],
}
};

View File

@ -1,13 +1,12 @@
const rel = require('path').resolve.bind(null, __dirname, '..')
const rel = require('path').resolve.bind(null, __dirname, '..');
function ignoreLoader(ignores) {
return {
loader: 'null-loader',
test(path) {
return ignores.some(ignore => path.includes(ignore))
return ignores.some(ignore => path.includes(ignore));
},
}
};
}
function jsLoader() {
@ -18,18 +17,21 @@ function jsLoader() {
options: {
babelrc: false,
presets: [
['@babel/preset-env', {
targets: {
browsers: [
'last 2 versions',
'> 5%',
'Safari 7', // for PhantomJS support
]
}
}]
]
}
}
[
'@babel/preset-env',
{
targets: {
browsers: [
'last 2 versions',
'> 5%',
'Safari 7', // for PhantomJS support
],
},
},
],
],
},
};
}
module.exports = { ignoreLoader, jsLoader, rel }
module.exports = { ignoreLoader, jsLoader, rel };