Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: allow comma-dangle in eslintrc because compete with prettier #1649

Merged
merged 1 commit into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"sourceType": "script"
},
"rules": {
"comma-dangle": ["error", "never"],
"consistent-return": "off",
"no-param-reassign": "off",
"no-underscore-dangle": "off",
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
client-src/live/web_modules/
node_modules
CHANGELOG.md
*.bundle.js
60 changes: 30 additions & 30 deletions bin/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,44 @@ const BASIC_GROUP = 'Basic options:';
const options = {
bonjour: {
type: 'boolean',
describe: 'Broadcasts the server via ZeroConf networking on start'
describe: 'Broadcasts the server via ZeroConf networking on start',
},
lazy: {
type: 'boolean',
describe: 'Lazy'
describe: 'Lazy',
},
inline: {
type: 'boolean',
default: true,
describe:
'Inline mode (set to false to disable including client scripts like livereload)'
'Inline mode (set to false to disable including client scripts like livereload)',
},
progress: {
type: 'boolean',
describe: 'Print compilation progress in percentage',
group: BASIC_GROUP
group: BASIC_GROUP,
},
'hot-only': {
type: 'boolean',
describe: 'Do not refresh page if HMR fails',
group: ADVANCED_GROUP
group: ADVANCED_GROUP,
},
stdin: {
type: 'boolean',
describe: 'close when stdin ends'
describe: 'close when stdin ends',
},
open: {
type: 'string',
describe: 'Open the default browser, or optionally specify a browser name'
describe: 'Open the default browser, or optionally specify a browser name',
},
useLocalIp: {
type: 'boolean',
describe: 'Open default browser with local IP'
describe: 'Open default browser with local IP',
},
'open-page': {
type: 'string',
describe: 'Open default browser with the specified page',
requiresArg: true
requiresArg: true,
},
color: {
type: 'boolean',
Expand All @@ -63,106 +63,106 @@ const options = {
return require('supports-color').stdout;
},
group: DISPLAY_GROUP,
describe: 'Enables/Disables colors on the console'
describe: 'Enables/Disables colors on the console',
},
info: {
type: 'boolean',
group: DISPLAY_GROUP,
default: true,
describe: 'Info'
describe: 'Info',
},
quiet: {
type: 'boolean',
group: DISPLAY_GROUP,
describe: 'Quiet'
describe: 'Quiet',
},
'client-log-level': {
type: 'string',
group: DISPLAY_GROUP,
default: 'info',
describe: 'Log level in the browser (info, warning, error or none)'
describe: 'Log level in the browser (info, warning, error or none)',
},
https: {
type: 'boolean',
group: SSL_GROUP,
describe: 'HTTPS'
describe: 'HTTPS',
},
key: {
type: 'string',
describe: 'Path to a SSL key.',
group: SSL_GROUP
group: SSL_GROUP,
},
cert: {
type: 'string',
describe: 'Path to a SSL certificate.',
group: SSL_GROUP
group: SSL_GROUP,
},
cacert: {
type: 'string',
describe: 'Path to a SSL CA certificate.',
group: SSL_GROUP
group: SSL_GROUP,
},
pfx: {
type: 'string',
describe: 'Path to a SSL pfx file.',
group: SSL_GROUP
group: SSL_GROUP,
},
'pfx-passphrase': {
type: 'string',
describe: 'Passphrase for pfx file.',
group: SSL_GROUP
group: SSL_GROUP,
},
'content-base': {
type: 'string',
describe: 'A directory or URL to serve HTML content from.',
group: RESPONSE_GROUP
group: RESPONSE_GROUP,
},
'watch-content-base': {
type: 'boolean',
describe: 'Enable live-reloading of the content-base.',
group: RESPONSE_GROUP
group: RESPONSE_GROUP,
},
'history-api-fallback': {
type: 'boolean',
describe: 'Fallback to /index.html for Single Page Applications.',
group: RESPONSE_GROUP
group: RESPONSE_GROUP,
},
compress: {
type: 'boolean',
describe: 'Enable gzip compression',
group: RESPONSE_GROUP
group: RESPONSE_GROUP,
},
port: {
describe: 'The port',
group: CONNECTION_GROUP
group: CONNECTION_GROUP,
},
'disable-host-check': {
type: 'boolean',
describe: 'Will not check the host',
group: CONNECTION_GROUP
group: CONNECTION_GROUP,
},
socket: {
type: 'String',
describe: 'Socket to listen',
group: CONNECTION_GROUP
group: CONNECTION_GROUP,
},
public: {
type: 'string',
describe: 'The public hostname/ip address of the server',
group: CONNECTION_GROUP
group: CONNECTION_GROUP,
},
host: {
type: 'string',
default: 'localhost',
describe: 'The hostname/ip address the server will bind to',
group: CONNECTION_GROUP
group: CONNECTION_GROUP,
},
'allowed-hosts': {
type: 'string',
describe:
'A comma-delimited string of hosts that are allowed to access the dev server',
group: CONNECTION_GROUP
}
group: CONNECTION_GROUP,
},
};

module.exports = options;
6 changes: 3 additions & 3 deletions bin/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const colors = {
}

return msg;
}
},
};

// eslint-disable-next-line
Expand Down Expand Up @@ -103,7 +103,7 @@ function bonjour(options) {
name: 'Webpack Dev Server',
port: options.port,
type: 'http',
subtypes: ['webpack']
subtypes: ['webpack'],
});

process.on('exit', () => {
Expand All @@ -118,5 +118,5 @@ module.exports = {
colors,
version,
bonjour,
defaultTo
defaultTo,
};
6 changes: 3 additions & 3 deletions bin/webpack-dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ yargs.options(options);
const argv = yargs.argv;

const config = require('webpack-cli/bin/convert-argv')(yargs, argv, {
outputFilename: '/bundle.js'
outputFilename: '/bundle.js',
});
// Taken out of yargs because we must know if
// it wasn't given by the user, in which case
Expand Down Expand Up @@ -201,7 +201,7 @@ function processOptions(config) {
if (!options.stats) {
options.stats = {
cached: false,
cachedAssets: false
cachedAssets: false,
};
}

Expand Down Expand Up @@ -313,7 +313,7 @@ function startDevServer(config, options) {

if (options.progress) {
new webpack.ProgressPlugin({
profile: argv.profile
profile: argv.profile,
}).apply(compiler);
}

Expand Down
6 changes: 3 additions & 3 deletions client-src/default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function sendMsg(type, data) {
self.postMessage(
{
type: `webpack${type}`,
data
data,
},
'*'
);
Expand Down Expand Up @@ -176,7 +176,7 @@ const onSocketMsg = {
close() {
log.error('[WDS] Disconnected!');
sendMsg('Close');
}
},
};

let hostname = urlParts.hostname;
Expand Down Expand Up @@ -215,7 +215,7 @@ const socketUrl = url.format({
pathname:
urlParts.path == null || urlParts.path === '/'
? '/sockjs-node'
: querystring.parse(urlParts.path).sockPath || urlParts.path
: querystring.parse(urlParts.path).sockPath || urlParts.path,
});

socket(socketUrl, onSocketMsg);
Expand Down
2 changes: 1 addition & 1 deletion client-src/default/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const colors = {
magenta: '7FACCA',
cyan: 'C3C2EF',
lightgrey: 'EBE7E3',
darkgrey: '6D7891'
darkgrey: '6D7891',
};
ansiHTML.setColors(colors);

Expand Down
12 changes: 6 additions & 6 deletions client-src/default/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ module.exports = {
exclude: /node_modules|web_modules/,
use: [
{
loader: 'babel-loader'
}
]
}
]
}
loader: 'babel-loader',
},
],
},
],
},
};
16 changes: 8 additions & 8 deletions client-src/live/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $(() => {
$errors.hide();
iframe.hide();
header.css({
borderColor: '#96b5b4'
borderColor: '#96b5b4',
});

const onSocketMsg = {
Expand All @@ -38,7 +38,7 @@ $(() => {
okness.text('');
status.text('App updated. Recompiling...');
header.css({
borderColor: '#96b5b4'
borderColor: '#96b5b4',
});
$errors.hide();
if (!hot) iframe.hide();
Expand All @@ -50,7 +50,7 @@ $(() => {
okness.text('');
status.text('App ready.');
header.css({
borderColor: ''
borderColor: '',
});
$errors.hide();
if (!hot) iframe.show();
Expand All @@ -70,7 +70,7 @@ $(() => {
okness.text('Errors while compiling.');
$errors.text(`\n${stripAnsi(errors.join('\n\n\n'))}\n\n`);
header.css({
borderColor: '#ebcb8b'
borderColor: '#ebcb8b',
});
$errors.show();
iframe.hide();
Expand All @@ -82,19 +82,19 @@ $(() => {
'\n\n\n Lost connection to webpack-dev-server.\n Please restart the server to reestablish connection...\n\n\n\n'
);
header.css({
borderColor: '#ebcb8b'
borderColor: '#ebcb8b',
});
$errors.show();
iframe.hide();
}
},
};

socket('/sockjs-node', onSocketMsg);

iframe.on('load', () => {
status.text('App ready.');
header.css({
borderColor: ''
borderColor: '',
});
iframe.show();
});
Expand All @@ -114,7 +114,7 @@ $(() => {
} else {
status.text('App updated. Reloading app...');
header.css({
borderColor: '#96b5b4'
borderColor: '#96b5b4',
});
try {
let old = `${iframe[0].contentWindow.location}`;
Expand Down
Loading