Skip to content

Commit

Permalink
[eslint] fix eslint failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 3, 2021
1 parent c8876b1 commit 3761435
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Expand Up @@ -15,7 +15,7 @@
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 6,
"ecmaVersion": 2020,
},
"rules": {
"comma-dangle": [2, "always-multiline"],
Expand Down
8 changes: 4 additions & 4 deletions resolvers/webpack/index.js
Expand Up @@ -271,18 +271,18 @@ function createWebpack1ResolveSync(webpackRequire, resolveConfig, plugins) {
makeRootPlugin(ModulesInRootPlugin, 'module', resolveConfig.root),
new ModulesInDirectoriesPlugin(
'module',
resolveConfig.modulesDirectories || resolveConfig.modules || ['web_modules', 'node_modules']
resolveConfig.modulesDirectories || resolveConfig.modules || ['web_modules', 'node_modules'],
),
makeRootPlugin(ModulesInRootPlugin, 'module', resolveConfig.fallback),
new ModuleAsFilePlugin('module'),
new ModuleAsDirectoryPlugin('module'),
new DirectoryDescriptionFilePlugin(
'package.json',
['module', 'jsnext:main'].concat(resolveConfig.packageMains || webpack1DefaultMains)
['module', 'jsnext:main'].concat(resolveConfig.packageMains || webpack1DefaultMains),
),
new DirectoryDefaultFilePlugin(['index']),
new FileAppendPlugin(resolveConfig.extensions || ['', '.webpack.js', '.web.js', '.js']),
new ResultSymlinkPlugin()
new ResultSymlinkPlugin(),
);


Expand Down Expand Up @@ -422,7 +422,7 @@ function findConfigPath(configPath, packageDir) {
}

const maybePath = path.resolve(
path.join(packageDir, 'webpack.config' + maybeExtension)
path.join(packageDir, 'webpack.config' + maybeExtension),
);
if (fs.existsSync(maybePath)) {
configPath = maybePath;
Expand Down
9 changes: 9 additions & 0 deletions tests/.eslintrc
@@ -0,0 +1,9 @@
{
"env": {
"mocha": true,
},
"rules": {
"max-len": 0,
"import/default": 0,
},
}
8 changes: 0 additions & 8 deletions tests/.eslintrc.yml

This file was deleted.

5 changes: 5 additions & 0 deletions utils/.eslintrc
@@ -0,0 +1,5 @@
{
"parserOptions": {
"ecmaVersion": 6,
},
}
6 changes: 1 addition & 5 deletions utils/parse.js
Expand Up @@ -52,11 +52,7 @@ exports.default = function parse(path, content, context) {
console.warn('Line ' + e.lineNumber + ', column ' + e.column + ': ' + e.message);
}
if (!ast || typeof ast !== 'object') {
console.warn(
'`parseForESLint` from parser `' +
parserPath +
'` is invalid and will just be ignored'
);
console.warn('`parseForESLint` from parser `' + parserPath + '` is invalid and will just be ignored');
} else {
return ast;
}
Expand Down
5 changes: 1 addition & 4 deletions utils/resolve.js
Expand Up @@ -217,10 +217,7 @@ const erroredContexts = new Set();
*/
function resolve(p, context) {
try {
return relative( p
, context.getFilename()
, context.settings
);
return relative(p, context.getFilename(), context.settings);
} catch (err) {
if (!erroredContexts.has(context)) {
// The `err.stack` string starts with `err.name` followed by colon and `err.message`.
Expand Down

0 comments on commit 3761435

Please sign in to comment.