Skip to content

Commit 3edf034

Browse files
committed
Appease the linter
1 parent 634fd67 commit 3edf034

File tree

10 files changed

+25
-20
lines changed

10 files changed

+25
-20
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
const environment = require('webpacker')
2+
23
module.exports = environment.toWebpackConfig()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
const environment = require('webpacker')
2+
23
module.exports = environment.toWebpackConfig()

lib/install/config/webpack/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
const environment = require('webpacker')
2+
23
module.exports = environment.toWebpackConfig()

node_module/asset_host.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { public_output_path } = require('./config')
1+
const config = require('./config')
22
const { resolve } = require('path')
33

44

@@ -16,7 +16,7 @@ function formatPublicPath(host = '', path = '') {
1616
}
1717

1818
module.exports = {
19-
path: resolve('public', public_output_path),
20-
publicPath: `/${public_output_path}/`.replace(/([^:]\/)\/+/g, '$1'),
21-
publicPathWithHost: formatPublicPath(process.env.ASSET_HOST, public_output_path)
19+
path: resolve('public', config.public_output_path),
20+
publicPath: `/${config.public_output_path}/`.replace(/([^:]\/)\/+/g, '$1'),
21+
publicPathWithHost: formatPublicPath(process.env.ASSET_HOST, config.public_output_path)
2222
}

node_module/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { join, resolve } = require('path')
1+
const { resolve } = require('path')
22
const { safeLoad } = require('js-yaml')
33
const { readFileSync } = require('fs')
44

node_module/environment.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint global-require: 0 */
2+
/* eslint import/no-dynamic-require: 0 */
3+
14
const config = require('./config')
25
const assetHost = require('./asset_host')
36

@@ -10,17 +13,17 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
1013
const ManifestPlugin = require('webpack-manifest-plugin')
1114

1215
function getLoaderMap() {
13-
const result = new Map
16+
const result = new Map()
1417
const paths = sync(resolve(__dirname, 'loaders', '*.js'))
15-
paths.forEach(path => {
18+
paths.forEach((path) => {
1619
const name = basename(path, extname(path))
1720
result.set(name, require(path))
1821
})
1922
return result
2023
}
2124

2225
function getPluginMap() {
23-
const result = new Map
26+
const result = new Map()
2427
result.set('Environment', new webpack.EnvironmentPlugin(JSON.parse(JSON.stringify(process.env))))
2528
result.set('ExtractText', new ExtractTextPlugin('[name]-[contenthash].css'))
2629
result.set('Manifest', new ManifestPlugin({ publicPath: assetHost.publicPath, writeToFileEmit: true }))
@@ -32,19 +35,15 @@ function getExtensionsGlob() {
3235
if (!extensions.length) {
3336
throw new Error('You must configure at least one extension to compile in webpacker.yml')
3437
}
35-
if (extensions.length === 1) {
36-
return `**/${extensions[0]}`
37-
} else {
38-
return `**/*{${extensions.join(',')}}`
39-
}
38+
return extensions.length === 1 ? `**/${extensions[0]}` : `**/*{${extensions.join(',')}}`
4039
}
4140

4241
function getEntryObject() {
4342
const result = {}
4443
const glob = getExtensionsGlob()
4544
const rootPath = join(config.source_path, config.source_entry_path)
4645
const paths = sync(join(rootPath, glob))
47-
paths.forEach(path => {
46+
paths.forEach((path) => {
4847
const namespace = relative(join(rootPath), dirname(path))
4948
const name = join(namespace, basename(path, extname(path)))
5049
result[name] = resolve(path)

node_module/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint global-require: 0 */
2+
/* eslint import/no-dynamic-require: 0 */
3+
14
const { existsSync } = require('fs')
25

36
function createEnvironmentInstance() {
@@ -6,7 +9,7 @@ function createEnvironmentInstance() {
69
path = './environment'
710
}
811
const constructor = require(path)
9-
return new constructor
12+
return new constructor()
1013
}
1114

1215
module.exports = createEnvironmentInstance()

node_module/loaders/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const ExtractTextPlugin = require('extract-text-webpack-plugin')
22
const path = require('path')
3-
const { dev_server } = require('../config')
3+
const config = require('../config')
44

55
const postcssConfigPath = path.resolve(process.cwd(), '.postcssrc.yml')
66
const isProduction = process.env.NODE_ENV === 'production'
7-
const extractCSS = !(dev_server && dev_server.hmr)
7+
const extractCSS = !(config.dev_server && config.dev_server.hmr)
88

99
const extractOptions = {
1010
fallback: 'style-loader',

node_module/loaders/vue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const { dev_server } = require('../config')
1+
const config = require('../config')
22

33
const isProduction = process.env.NODE_ENV === 'production'
4-
const extractCSS = !(dev_server && dev_server.hmr)
4+
const extractCSS = !(config.dev_server && config.dev_server.hmr)
55

66
module.exports = {
77
test: /\.vue$/,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"scripts": {
4545
"test": "echo \"Error: no test specified\" && exit 1",
46-
"lint": "yarn run eslint lib/"
46+
"lint": "eslint {node_module,lib}/"
4747
},
4848
"repository": {
4949
"type": "git",

0 commit comments

Comments
 (0)