Skip to content

Commit

Permalink
[eslint] enable keyword-spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 6, 2021
1 parent a032b83 commit bb8eab9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
11 changes: 10 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
"eqeqeq": [2, "allow-null"],
"func-call-spacing": 2,
"indent": [2, 2],
"keyword-spacing": ["error", {
before: true,
after: true,
overrides: {
return: { after: true },
throw: { after: true },
case: { after: true }
}
}],
"max-len": [1, 99, 2],
"no-cond-assign": [2, "always"],
"no-return-assign": [2, "always"],
Expand All @@ -47,7 +56,7 @@
"named": "never",
"asyncArrow": "always",
}],

"eslint-plugin/consistent-output": [
"error",
"always",
Expand Down
2 changes: 1 addition & 1 deletion resolvers/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exports.resolve = function (source, file, settings) {
if (configPath) {
try {
webpackConfig = require(configPath);
} catch(e) {
} catch (e) {
console.log('Error resolving webpackConfig', e);
throw e;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/importType.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function isScopedMain(name) {
}

function isRelativeToParent(name) {
return/^\.\.$|^\.\.[\\/]/.test(name);
return /^\.\.$|^\.\.[\\/]/.test(name);
}

const indexFiles = ['.', './', './index', './index.js'];
Expand Down
4 changes: 2 additions & 2 deletions utils/module-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ exports.default = function moduleRequire(p) {
const eslintPath = require.resolve('eslint');
const eslintModule = createModule(eslintPath);
return require(Module._resolveFilename(p, eslintModule));
} catch(err) { /* ignore */ }
} catch (err) { /* ignore */ }

try {
// try relative to entry point
return require.main.require(p);
} catch(err) { /* ignore */ }
} catch (err) { /* ignore */ }

// finally, try from here
return require(p);
Expand Down
2 changes: 1 addition & 1 deletion utils/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function tryRequire(target, sourceFile) {
} else {
resolved = require.resolve(target);
}
} catch(e) {
} catch (e) {
// If the target does not exist then just return undefined
return undefined;
}
Expand Down

0 comments on commit bb8eab9

Please sign in to comment.