This commit is contained in:
Ray Elliott 2022-08-04 10:44:47 +01:00
parent 71c5af4b85
commit 0ce62a3c96
1 changed files with 17 additions and 16 deletions

View File

@ -194,24 +194,25 @@ local null_ls = require("null-ls")
local null_ls_utils = require("null-ls.utils") local null_ls_utils = require("null-ls.utils")
local root = null_ls_utils.get_root() local root = null_ls_utils.get_root()
local eslint_command = root .. "/node_modules/eslint/bin/eslint.js" local eslint_command = root .. "/node_modules/eslint/bin/eslint.js"
print(eslint_command); -- print(eslint_command);
local sources = { local sources = {
null_ls.builtins.formatting.prettierd, null_ls.builtins.formatting.prettierd,
null_ls.builtins.diagnostics.eslint.with({ null_ls.builtins.diagnostics.eslint.with({
condition = function(utils) condition = function(utils)
local has_file = utils.root_has_file({"node_modules/@wordpress/scripts/config/.eslintrc.js"}) local has_file = utils.root_has_file({
print("condition") "node_modules/@wordpress/scripts/config/.eslintrc.js"
print(has_file) })
return has_file print("condition")
end, print(has_file)
extra_args = { return has_file
"--no-eslintrc", end,
"--config ", extra_args = {
root .. "/node_modules/@wordpress/scripts/config/.eslintrc.js", "--no-eslintrc", "--config ",
"--ignore-path ", root .. "/node_modules/@wordpress/scripts/config/.eslintrc.js",
root .. "/node_modules/@wordpress/scripts/config/.eslintignore" "--ignore-path ",
} root .. "/node_modules/@wordpress/scripts/config/.eslintignore"
}
}), -- }), --
null_ls.builtins.diagnostics.phpcs.with({ null_ls.builtins.diagnostics.phpcs.with({
condition = function(utils) condition = function(utils)