Skip to content

Commit bb8eab9

Browse files
committed
[eslint] enable keyword-spacing
1 parent a032b83 commit bb8eab9

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

.eslintrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
"eqeqeq": [2, "allow-null"],
2626
"func-call-spacing": 2,
2727
"indent": [2, 2],
28+
"keyword-spacing": ["error", {
29+
before: true,
30+
after: true,
31+
overrides: {
32+
return: { after: true },
33+
throw: { after: true },
34+
case: { after: true }
35+
}
36+
}],
2837
"max-len": [1, 99, 2],
2938
"no-cond-assign": [2, "always"],
3039
"no-return-assign": [2, "always"],
@@ -47,7 +56,7 @@
4756
"named": "never",
4857
"asyncArrow": "always",
4958
}],
50-
59+
5160
"eslint-plugin/consistent-output": [
5261
"error",
5362
"always",

resolvers/webpack/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ exports.resolve = function (source, file, settings) {
8484
if (configPath) {
8585
try {
8686
webpackConfig = require(configPath);
87-
} catch(e) {
87+
} catch (e) {
8888
console.log('Error resolving webpackConfig', e);
8989
throw e;
9090
}

src/core/importType.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function isScopedMain(name) {
7575
}
7676

7777
function isRelativeToParent(name) {
78-
return/^\.\.$|^\.\.[\\/]/.test(name);
78+
return /^\.\.$|^\.\.[\\/]/.test(name);
7979
}
8080

8181
const indexFiles = ['.', './', './index', './index.js'];

utils/module-require.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ exports.default = function moduleRequire(p) {
1818
const eslintPath = require.resolve('eslint');
1919
const eslintModule = createModule(eslintPath);
2020
return require(Module._resolveFilename(p, eslintModule));
21-
} catch(err) { /* ignore */ }
21+
} catch (err) { /* ignore */ }
2222

2323
try {
2424
// try relative to entry point
2525
return require.main.require(p);
26-
} catch(err) { /* ignore */ }
26+
} catch (err) { /* ignore */ }
2727

2828
// finally, try from here
2929
return require(p);

utils/resolve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function tryRequire(target, sourceFile) {
4242
} else {
4343
resolved = require.resolve(target);
4444
}
45-
} catch(e) {
45+
} catch (e) {
4646
// If the target does not exist then just return undefined
4747
return undefined;
4848
}

0 commit comments

Comments
 (0)