diff --git a/lua/guard-collection/formatter.lua b/lua/guard-collection/formatter.lua index 5a2974c..d3fffd8 100644 --- a/lua/guard-collection/formatter.lua +++ b/lua/guard-collection/formatter.lua @@ -56,8 +56,8 @@ M.dprint = { } M.eslint_d = { - cmd = 'eslint_d', - args = { '--fix-to-stdout', '--stdin', '--stdin-filename' }, + cmd = 'npx', + args = { 'eslint_d', '--fix-to-stdout', '--stdin', '--stdin-filename' }, fname = true, stdin = true, } @@ -137,8 +137,8 @@ M.pg_format = { } M.prettier = { - cmd = 'prettier', - args = { '--stdin-filepath' }, + cmd = 'npx', + args = { 'prettier', '--stdin-filepath' }, fname = true, stdin = true, } diff --git a/lua/guard-collection/linter/eslint.lua b/lua/guard-collection/linter/eslint.lua index 6776077..f4c93f1 100644 --- a/lua/guard-collection/linter/eslint.lua +++ b/lua/guard-collection/linter/eslint.lua @@ -1,8 +1,8 @@ local lint = require('guard.lint') return { - cmd = 'eslint', - args = { '--format', 'json', '--stdin', '--stdin-filename' }, + cmd = 'npx', + args = { 'eslint', '--format', 'json', '--stdin', '--stdin-filename' }, stdin = true, fname = true, find = { @@ -11,6 +11,9 @@ return { '.eslintrc.yaml', '.eslintrc.yml', '.eslintrc.json', + 'eslint.config.js', + 'eslint.config.cjs', + 'eslint.config.mjs', }, parse = lint.from_json({ get_diagnostics = function(...) diff --git a/lua/guard-collection/linter/eslint_d.lua b/lua/guard-collection/linter/eslint_d.lua index 5a1f4bb..1c527de 100644 --- a/lua/guard-collection/linter/eslint_d.lua +++ b/lua/guard-collection/linter/eslint_d.lua @@ -1,8 +1,8 @@ local lint = require('guard.lint') return { - cmd = 'eslint_d', - args = { '--format', 'json', '--stdin', '--stdin-filename' }, + cmd = 'npx', + args = { 'eslint_d', '--format', 'json', '--stdin', '--stdin-filename' }, stdin = true, fname = true, find = { @@ -11,6 +11,9 @@ return { '.eslintrc.yaml', '.eslintrc.yml', '.eslintrc.json', + 'eslint.config.js', + 'eslint.config.cjs', + 'eslint.config.mjs', }, parse = lint.from_json({ get_diagnostics = function(...) diff --git a/lua/guard-collection/linter/stylelint.lua b/lua/guard-collection/linter/stylelint.lua index 1426c3d..95a4f9c 100644 --- a/lua/guard-collection/linter/stylelint.lua +++ b/lua/guard-collection/linter/stylelint.lua @@ -1,8 +1,8 @@ local lint = require('guard.lint') return { - cmd = 'stylelint', - args = { '--formatter', 'json', '--stdin', '--stdin-filename' }, + cmd = 'npx', + args = { 'stylelint', '--formatter', 'json', '--stdin', '--stdin-filename' }, stdin = true, fname = true, find = { diff --git a/test/linter/flake8_spec.lua b/test/linter/flake8_spec.lua index c62f40c..0d8ff52 100644 --- a/test/linter/flake8_spec.lua +++ b/test/linter/flake8_spec.lua @@ -21,7 +21,7 @@ describe('flake8', function() end_col = 0, end_lnum = 0, lnum = 0, - message = "'os' imported but unused [401]", + message = "'os' imported but unused[401]", namespace = ns, severity = 3, source = 'flake8', @@ -32,7 +32,7 @@ describe('flake8', function() end_col = 0, end_lnum = 2, lnum = 2, - message = 'expected 2 blank lines, found 1 [302]', + message = 'expected 2 blank lines, found 1[302]', namespace = ns, severity = 1, source = 'flake8', @@ -43,7 +43,7 @@ describe('flake8', function() end_col = 9, end_lnum = 4, lnum = 4, - message = 'indentation is not a multiple of 4 [111]', + message = 'indentation is not a multiple of 4[111]', namespace = ns, severity = 1, source = 'flake8', @@ -54,7 +54,7 @@ describe('flake8', function() end_col = 9, end_lnum = 4, lnum = 4, - message = 'over-indented [117]', + message = 'over-indented[117]', namespace = ns, severity = 1, source = 'flake8', @@ -65,7 +65,7 @@ describe('flake8', function() end_col = 15, end_lnum = 4, lnum = 4, - message = 'multiple spaces after keyword [271]', + message = 'multiple spaces after keyword[271]', namespace = ns, severity = 1, source = 'flake8', @@ -76,7 +76,7 @@ describe('flake8', function() end_col = 17, end_lnum = 4, lnum = 4, - message = "undefined name 'bar' [821]", + message = "undefined name 'bar'[821]", namespace = ns, severity = 3, source = 'flake8', @@ -87,7 +87,7 @@ describe('flake8', function() end_col = 0, end_lnum = 5, lnum = 5, - message = 'expected 2 blank lines after class or function definition, found 0 [305]', + message = 'expected 2 blank lines after class or function definition, found 0[305]', namespace = ns, severity = 1, source = 'flake8', @@ -98,7 +98,7 @@ describe('flake8', function() end_col = 79, end_lnum = 5, lnum = 5, - message = 'line too long (80 > 79 characters) [501]', + message = 'line too long (80 > 79 characters)[501]', namespace = ns, severity = 1, source = 'flake8', diff --git a/test/linter/luacheck_spec.lua b/test/linter/luacheck_spec.lua index 9f18b38..468c98b 100644 --- a/test/linter/luacheck_spec.lua +++ b/test/linter/luacheck_spec.lua @@ -21,7 +21,7 @@ describe('luacheck', function() end_col = 0, end_lnum = 4, lnum = 4, - message = "accessing undefined variable 'U' [113]", + message = "accessing undefined variable 'U'[113]", namespace = ns, severity = 2, source = 'luacheck',