From 09e59f5b16d22b8eeac2265125e4c55eeedca142 Mon Sep 17 00:00:00 2001 From: HyBer <59885141+BBboy01@users.noreply.github.com> Date: Wed, 29 May 2024 12:57:33 +0800 Subject: [PATCH 1/6] feat: update node package call from --- lua/guard-collection/formatter.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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, } From f0864636665a392d8f1f5d6bf26619bad575ad89 Mon Sep 17 00:00:00 2001 From: HyBer <59885141+BBboy01@users.noreply.github.com> Date: Wed, 29 May 2024 12:59:22 +0800 Subject: [PATCH 2/6] Update eslint.lua --- lua/guard-collection/linter/eslint.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(...) From a127d2e5827d8e9e6fa0cf903598f03bf83403c0 Mon Sep 17 00:00:00 2001 From: HyBer <59885141+BBboy01@users.noreply.github.com> Date: Wed, 29 May 2024 12:59:59 +0800 Subject: [PATCH 3/6] Update eslint_d.lua --- lua/guard-collection/linter/eslint_d.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(...) From 55fab7238c0f0e257d126e438033c8895fa1a69c Mon Sep 17 00:00:00 2001 From: HyBer <59885141+BBboy01@users.noreply.github.com> Date: Wed, 29 May 2024 13:00:31 +0800 Subject: [PATCH 4/6] Update stylelint.lua --- lua/guard-collection/linter/stylelint.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 = { From 7df7e83d140b94cde162593858ffb36531c0cbb2 Mon Sep 17 00:00:00 2001 From: HyBer <59885141+BBboy01@users.noreply.github.com> Date: Wed, 29 May 2024 13:24:46 +0800 Subject: [PATCH 5/6] test: flake_8 --- test/linter/flake8_spec.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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', From ac2d1fe8e415f104432bed347c551b63d0851026 Mon Sep 17 00:00:00 2001 From: HyBer <59885141+BBboy01@users.noreply.github.com> Date: Wed, 29 May 2024 13:30:31 +0800 Subject: [PATCH 6/6] Update luacheck_spec.lua --- test/linter/luacheck_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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',