* 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
38 lines
732 B
JavaScript
38 lines
732 B
JavaScript
const rel = require('path').resolve.bind(null, __dirname, '..');
|
|
|
|
function ignoreLoader(ignores) {
|
|
return {
|
|
loader: 'null-loader',
|
|
test(path) {
|
|
return ignores.some(ignore => path.includes(ignore));
|
|
},
|
|
};
|
|
}
|
|
|
|
function jsLoader() {
|
|
return {
|
|
test: /\.js$/,
|
|
include: rel('src'),
|
|
loader: 'babel-loader',
|
|
options: {
|
|
babelrc: false,
|
|
presets: [
|
|
[
|
|
'@babel/preset-env',
|
|
{
|
|
targets: {
|
|
browsers: [
|
|
'last 2 versions',
|
|
'> 5%',
|
|
'Safari 7', // for PhantomJS support
|
|
],
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
};
|
|
}
|
|
|
|
module.exports = { ignoreLoader, jsLoader, rel };
|