Skip to content

Commit a2a5502

Browse files
committed
eslint: reduce required options
1 parent 7022b7f commit a2a5502

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/src/main/resources/com/diffplug/spotless/npm/eslint-serve.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ app.post("/eslint/format", async (req, res) => {
2323
const ESLintOptions = {
2424
fix: true,
2525
useEslintrc: false, // would result in (gradle) cache issues
26-
resolvePluginsRelativeTo: format_data.node_modules_dir
2726
};
2827

2928
if (format_data.ts_config_root_dir) {
@@ -42,15 +41,17 @@ app.post("/eslint/format", async (req, res) => {
4241
ESLintOptions.overrideConfig = ESLintOverrideConfig;
4342
}
4443

44+
console.log("using options: " + JSON.stringify(ESLintOptions));
45+
console.log("format input: ", format_data.file_content);
46+
4547
const eslint = new ESLint(ESLintOptions);
4648

4749

48-
console.log("using options: " + JSON.stringify(ESLintOptions));
49-
console.log("format input", format_data.file_content);
5050
const lintTextOptions = {
5151
filePath: filePath,
5252
}
5353
console.log("lintTextOptions", lintTextOptions);
54+
5455
// LintResult[] // https://eslint.org/docs/latest/developer-guide/nodejs-api#-lintresult-type
5556
const results = await eslint.lintText(format_data.file_content, lintTextOptions);
5657
if (results.length !== 1) {

0 commit comments

Comments
 (0)